Created attachment 522428 [details] gnupg-2.2.5.log $ emerge -av1 gnupg These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] app-crypt/gnupg-2.2.5::gentoo USE="bzip2 ldap* nls readline smartcard ssl usb* -doc (-selinux) -tofu -tools -wks-server" 0 KiB Total: 1 package (1 reinstall), Size of downloads: 0 KiB Would you like to merge these packages? [Yes/No] >>> Verifying ebuild manifests >>> Emerging (1 of 1) app-crypt/gnupg-2.2.5::gentoo * gnupg-2.2.5.tar.bz2 BLAKE2B SHA512 size ;-) ... [ ok ] ... checking whether "make check" shall run all tests... yes configure: *** *** You need libusb to build the internal ccid driver. Please *** install a libusb suitable for your system. *** configure: error: *** *** Required libraries not found. Please consult the above messages *** and install them before running configure again. *** Full output in attachment.
The dependency is there, and I have libusb installed, but it is not found. $ equery l -p libusb * Searching for libusb ... [-P-] [ ] dev-libs/libusb-1.0.19-r1:1 [-P-] [ ] dev-libs/libusb-1.0.20:1 [IP-] [ ] dev-libs/libusb-1.0.21:1 I also see hard-coded /usr/include in the ebuild, which needs fixing.
The problem is not the ebuild, but configure.ac which hardcodes the search path for libusb to "" "/usr/include/libusb-1.0" "/usr/local/include/libusb-1.0" "/usr/pkg/include/libusb-1.0" and then tries to compile a program which includes <libusb.h>. So what we /could/ do, is (perhaps only for prefix?) add -I${EPREFIX}/usr/include/libusb-1.0 to CPPFLAGS using append-cppflags, which will then make it look at the Prefix installation first. @k_f: what do you think?
(In reply to Fabian Groffen from comment #2) > > So what we /could/ do, is (perhaps only for prefix?) add > -I${EPREFIX}/usr/include/libusb-1.0 to CPPFLAGS using append-cppflags, which > will then make it look at the Prefix installation first. > > @k_f: what do you think? I'm fine with using append-cppflags in prefix-specific context, as that is clearly a downstream thing we don't need to do any upstream hacking with regards to configure.ac. Will you propose a patch for review?
I was thinking about something like this: diff --git a/app-crypt/gnupg/gnupg-2.2.5.ebuild b/app-crypt/gnupg/gnupg-2.2.5.ebuild index 172d9ac8f2c..6171a21f0b0 100644 --- a/app-crypt/gnupg/gnupg-2.2.5.ebuild +++ b/app-crypt/gnupg/gnupg-2.2.5.ebuild @@ -3,7 +3,7 @@ EAPI="6" -inherit systemd toolchain-funcs +inherit flag-o-matic systemd toolchain-funcs MY_P="${P/_/-}" @@ -65,6 +65,10 @@ src_configure() { --enable-scdaemon $(use_enable usb ccid-driver) ) + if use prefix && use usb ; then + # bug #649598 + append-cppflags -I${EPREFIX}/usr/include/libusb-1.0 + fi else myconf+=( --disable-scdaemon ) fi @amadio, do you have means to quickly test if this works for you?
(In reply to Fabian Groffen from comment #4) > @amadio, do you have means to quickly test if this works for you? has this been tested?
Oops, sorry, I missed the previous message. I will test today (on macOS 10.13) and report back.
The patch above works, and gnupg-2.2.6 is also affected by this problem.
(In reply to Guilherme Amadio from comment #7) > The patch above works, and gnupg-2.2.6 is also affected by this problem. @k_f: tested and works, will you commit the change?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ec11c72ad79142c7b70862ffc87f8e65c9c40e0 commit 9ec11c72ad79142c7b70862ffc87f8e65c9c40e0 Author: Guilherme Amadio <amadio@gentoo.org> AuthorDate: 2018-08-23 07:36:42 +0000 Commit: Guilherme Amadio <amadio@gentoo.org> CommitDate: 2018-08-23 07:36:51 +0000 app-crypt/gnupg: fix bug #649598, USE=usb on prefix Closes: https://bugs.gentoo.org/649598 Suggested-by: Fabian Groffen <grobian@gentoo.org> Package-Manager: Portage-2.3.47, Repoman-2.3.10 app-crypt/gnupg/gnupg-2.2.9.ebuild | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)