Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 649598 - app-crypt/gnupg-2.2.5: does not find libusb on prefix with USE=usb
Summary: app-crypt/gnupg-2.2.5: does not find libusb on prefix with USE=usb
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-05 07:29 UTC by Guilherme Amadio
Modified: 2018-08-23 07:39 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gnupg-2.2.5.log (gnupg.log,21.49 KB, text/x-log)
2018-03-05 07:29 UTC, Guilherme Amadio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Guilherme Amadio gentoo-dev 2018-03-05 07:29:31 UTC
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.
Comment 1 Guilherme Amadio gentoo-dev 2018-03-05 07:35:34 UTC
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.
Comment 2 Fabian Groffen gentoo-dev 2018-03-13 09:40:58 UTC
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?
Comment 3 Kristian Fiskerstrand (RETIRED) gentoo-dev 2018-03-13 09:56:50 UTC
(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?
Comment 4 Fabian Groffen gentoo-dev 2018-03-13 10:03:35 UTC
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?
Comment 5 Kristian Fiskerstrand (RETIRED) gentoo-dev 2018-04-29 16:58:58 UTC
(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?
Comment 6 Guilherme Amadio gentoo-dev 2018-04-30 06:34:39 UTC
Oops, sorry, I missed the previous message. I will test today (on macOS 10.13) and report back.
Comment 7 Guilherme Amadio gentoo-dev 2018-04-30 06:44:16 UTC
The patch above works, and gnupg-2.2.6 is also affected by this problem.
Comment 8 Fabian Groffen gentoo-dev 2018-05-29 11:45:29 UTC
(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?
Comment 9 Larry the Git Cow gentoo-dev 2018-08-23 07:39:35 UTC
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(-)