dev-libs/leatherman: 1.12.0 stable amd64/x86 with cleanup
[gentoo.git] / dev-libs / libusb / libusb-1.0.19-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit multilib-minimal toolchain-funcs usr-ldscript
7
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"
11
12 LICENSE="LGPL-2.1"
13 SLOT="1"
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 )"
17
18 RDEPEND="udev? ( >=virtual/libudev-208:=[${MULTILIB_USEDEP},static-libs(-)?] )"
19 DEPEND="${RDEPEND}
20         doc? ( app-doc/doxygen )
21         !udev? ( virtual/os-headers )"
22
23 multilib_src_configure() {
24         ECONF_SOURCE=${S} \
25         econf \
26                 $(use_enable static-libs static) \
27                 $(use_enable udev) \
28                 $(use_enable debug debug-log) \
29                 $(use_enable test tests-build)
30 }
31
32 multilib_src_compile() {
33         emake
34
35         if multilib_is_native_abi; then
36                 use doc && emake -C doc docs
37         fi
38 }
39
40 multilib_src_test() {
41         emake check
42
43         # noinst_PROGRAMS from tests/Makefile.am
44         tests/stress || die
45 }
46
47 multilib_src_install() {
48         emake DESTDIR="${D}" install
49
50         if multilib_is_native_abi; then
51                 gen_usr_ldscript -a usb-1.0
52
53                 use doc && dohtml doc/html/*
54         fi
55 }
56
57 multilib_src_install_all() {
58         find "${ED}" -name '*.la' -delete || die
59
60         dodoc AUTHORS ChangeLog NEWS PORTING README TODO
61
62         if use examples; then
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}
67         fi
68 }