1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit multilib-minimal toolchain-funcs usr-ldscript
8 DESCRIPTION="Userspace access to USB devices"
9 HOMEPAGE="https://libusb.info/ https://github.com/libusb/libusb"
10 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
14 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
15 IUSE="debug doc examples static-libs test udev"
16 RESTRICT="!test? ( test )"
18 RDEPEND="udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP},static-libs(-)?] )"
20 doc? ( app-doc/doxygen )
21 !udev? ( virtual/os-headers )"
23 multilib_src_configure() {
26 $(use_enable static-libs static) \
28 $(use_enable debug debug-log) \
29 $(use_enable test tests-build)
32 multilib_src_compile() {
35 if multilib_is_native_abi; then
36 use doc && emake -C doc docs
43 # noinst_PROGRAMS from tests/Makefile.am
47 multilib_src_install() {
48 emake DESTDIR="${D}" install
50 if multilib_is_native_abi; then
51 gen_usr_ldscript -a usb-1.0
53 use doc && dohtml doc/html/*
57 multilib_src_install_all() {
58 find "${ED}" -name '*.la' -delete || die
60 dodoc AUTHORS ChangeLog NEWS PORTING README TODO
63 insinto /usr/share/doc/${PF}/examples
64 doins examples/*.{c,h}
65 insinto /usr/share/doc/${PF}/examples/getopt
66 doins examples/getopt/*.{c,h}