1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit ltprune toolchain-funcs multilib-minimal usr-ldscript
7 DESCRIPTION="Userspace access to USB devices"
8 HOMEPAGE="https://libusb.info/ https://github.com/libusb/libusb"
9 SRC_URI="https://github.com/${PN}/${PN}/releases/download/v${PV}/${P}.tar.bz2"
13 KEYWORDS="~alpha ~amd64 ~arm ~arm64 hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
14 IUSE="debug doc examples static-libs test udev"
15 RESTRICT="!test? ( test )"
17 RDEPEND="udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP},static-libs(-)?] )"
19 doc? ( app-doc/doxygen )
20 !udev? ( virtual/os-headers )"
22 multilib_src_configure() {
25 $(use_enable static-libs static) \
27 $(use_enable debug debug-log) \
28 $(use_enable test tests-build)
31 multilib_src_compile() {
34 if multilib_is_native_abi; then
35 use doc && emake -C doc docs
42 # noinst_PROGRAMS from tests/Makefile.am
46 multilib_src_install() {
47 emake DESTDIR="${D}" install
49 if multilib_is_native_abi; then
50 gen_usr_ldscript -a usb-1.0
52 use doc && dodoc -r doc/html
56 multilib_src_install_all() {
59 dodoc AUTHORS ChangeLog NEWS PORTING README TODO
62 insinto /usr/share/doc/${PF}/examples
63 doins examples/*.{c,h}
64 insinto /usr/share/doc/${PF}/examples/getopt
65 doins examples/getopt/*.{c,h}