Bug 229837

Summary: security/qtkeychain: Fix build with FLAVORS="qt5"
Product: Ports & Packages Reporter: Piotr Kubaj <pkubaj>
Component: Individual Port(s)Assignee: Gleb Popov <arrowd>
Status: Closed FIXED    
Severity: Affects Only Me CC: d8zNeCFG, tcberner
Priority: --- Flags: tcberner: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch
none
patch
none
Maintainer's patch none

Description Piotr Kubaj freebsd_committer freebsd_triage 2018-07-17 15:10:20 UTC
Created attachment 195200 [details]
patch

qt5 needs localbase:ldflags.

Tested on 11-RELEASE with Poudriere.
Comment 1 Gleb Popov freebsd_committer freebsd_triage 2018-07-17 15:14:10 UTC
What problem does it solve? I launched pou testport for 11.1-RELEASE, but this would take a while.
Comment 2 Piotr Kubaj freebsd_committer freebsd_triage 2018-07-17 15:16:19 UTC
Created attachment 195201 [details]
patch

Corrected line numbers.
Comment 3 Piotr Kubaj freebsd_committer freebsd_triage 2018-07-17 15:47:50 UTC
(In reply to Gleb Popov from comment #1)
Building on CURRENT from yesterday fails with:
[20/22] : && /usr/bin/c++ -fPIC -O2 -pipe -march=native -DHARDENEDBSD -fPIE -fPIC -mretpoline -fstack-protector-all -fno-strict-aliasing  -DHARDENEDBSD -fPIE -fPIC -mretpoline -std=c++11 -O2 -pipe -march=native -DHARDENEDBSD -fPIE -fPIC -mretpoline -fstack-protector-all -fno-strict-aliasing  -DHARDENEDBSD -fPIE -fPIC -mretpoline  -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,retpolineplt -fstack-protector -shared -Wl,-soname,libqt5keychain.so.1 -o libqt5keychain.so.0.9.0 CMakeFiles/qt5keychain.dir/keychain.cpp.o CMakeFiles/qt5keychain.dir/keychain_unix.cpp.o CMakeFiles/qt5keychain.dir/gnomekeyring.cpp.o CMakeFiles/qt5keychain.dir/libsecret.cpp.o CMakeFiles/qt5keychain.dir/plaintextstore.cpp.o CMakeFiles/qt5keychain.dir/kwallet_interface.cpp.o CMakeFiles/qt5keychain.dir/moc_keychain.cpp.o CMakeFiles/qt5keychain.dir/moc_keychain_p.cpp.o CMakeFiles/qt5keychain.dir/moc_gnomekeyring_p.cpp.o  -Wl,-rpath,/usr/local/lib/qt5: -lsecret-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl /usr/local/lib/qt5/libQt5DBus.so.5.10.1 /usr/local/lib/qt5/libQt5Core.so.5.10.1 && :
FAILED: libqt5keychain.so.0.9.0
: && /usr/bin/c++ -fPIC -O2 -pipe -march=native -DHARDENEDBSD -fPIE -fPIC -mretpoline -fstack-protector-all -fno-strict-aliasing  -DHARDENEDBSD -fPIE -fPIC -mretpoline -std=c++11 -O2 -pipe -march=native -DHARDENEDBSD -fPIE -fPIC -mretpoline -fstack-protector-all -fno-strict-aliasing  -DHARDENEDBSD -fPIE -fPIC -mretpoline  -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,retpolineplt -fstack-protector -shared -Wl,-soname,libqt5keychain.so.1 -o libqt5keychain.so.0.9.0 CMakeFiles/qt5keychain.dir/keychain.cpp.o CMakeFiles/qt5keychain.dir/keychain_unix.cpp.o CMakeFiles/qt5keychain.dir/gnomekeyring.cpp.o CMakeFiles/qt5keychain.dir/libsecret.cpp.o CMakeFiles/qt5keychain.dir/plaintextstore.cpp.o CMakeFiles/qt5keychain.dir/kwallet_interface.cpp.o CMakeFiles/qt5keychain.dir/moc_keychain.cpp.o CMakeFiles/qt5keychain.dir/moc_keychain_p.cpp.o CMakeFiles/qt5keychain.dir/moc_gnomekeyring_p.cpp.o  -Wl,-rpath,/usr/local/lib/qt5: -lsecret-1 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl /usr/local/lib/qt5/libQt5DBus.so.5.10.1 /usr/local/lib/qt5/libQt5Core.so.5.10.1 && :
c++: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
/usr/bin/ld: error: unable to find library -lsecret-1
/usr/bin/ld: error: unable to find library -lgio-2.0
/usr/bin/ld: error: unable to find library -lgobject-2.0
/usr/bin/ld: error: unable to find library -lglib-2.0
/usr/bin/ld: error: unable to find library -lintl
c++: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 4 Martin Birgmeier 2018-07-17 15:54:49 UTC
Since the update to qtkeychain-0.9.0 I also have the linker error

/usr/bin/ld: cannot find -lsecret-1

-- Martin
Comment 5 Martin Birgmeier 2018-07-17 15:57:29 UTC
The patch fixes the issue for me.

-- Martin
Comment 6 Gleb Popov freebsd_committer freebsd_triage 2018-07-17 16:25:50 UTC
You both seem to be running non-KDE desktop. Just out of curiosity, what port pulled in qtkeychain for you?
Comment 7 Piotr Kubaj freebsd_committer freebsd_triage 2018-07-17 16:56:04 UTC
(In reply to Gleb Popov from comment #6)
deskutils/nextcloudclient for me.
Comment 8 Martin Birgmeier 2018-07-17 17:00:53 UTC
I am running x11/kde4

nextcloudclient pulled in qtkeychain for me, too.

-- Martin
Comment 9 Gleb Popov freebsd_committer freebsd_triage 2018-07-17 20:19:16 UTC
Created attachment 195214 [details]
Maintainer's patch

Can you check if this patch fixes issue for you?
Comment 10 Tobias C. Berner freebsd_committer freebsd_triage 2018-07-18 06:02:25 UTC
You need to add 
LIBSECRET_CMAKE_BOOL= LIBSECRET_SUPPORT
Comment 11 Piotr Kubaj freebsd_committer freebsd_triage 2018-07-18 13:27:15 UTC
No, it doesn't help.

/usr/bin/ld: error: unable to find library -lsecret-1
/usr/bin/ld: error: unable to find library -lgio-2.0
/usr/bin/ld: error: unable to find library -lgobject-2.0
/usr/bin/ld: error: unable to find library -lglib-2.0
/usr/bin/ld: error: unable to find library -lintl

The problem is that those libraries can't be found, because correct library path isn't passed.

USES=localbase:ldflags is therefore necessary.
Comment 12 commit-hook freebsd_committer freebsd_triage 2018-07-18 19:17:34 UTC
A commit references this bug:

Author: arrowd
Date: Wed Jul 18 19:17:29 UTC 2018
New revision: 474893
URL: https://svnweb.freebsd.org/changeset/ports/474893

Log:
  security/qtkeychain: Add dependency to libsecret and link to it correctly.

  PR:		229837
  Reported by:	Piotr Kubaj <pkubaj@anongoth.pl>
  Approved by:	tcberner (mentor)

Changes:
  head/security/qtkeychain/Makefile
Comment 13 Gleb Popov freebsd_committer freebsd_triage 2018-07-18 19:18:38 UTC
This should be fixed by now. Thanks for your report.