1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils autotools ltprune
8 if [[ ${PV} == "9999" ]]; then
9 EGIT_REPO_URI="git://sigrok.org/${PN}"
10 inherit git-r3 autotools
12 SRC_URI="https://sigrok.org/download/source/${PN}/${P}.tar.gz"
16 DESCRIPTION="basic hardware drivers for logic analyzers and input/output file format support"
17 HOMEPAGE="https://sigrok.org/wiki/Libsigrok"
21 IUSE="ftdi serial static-libs test usb"
22 RESTRICT="!test? ( test )"
24 # We also support librevisa, but that isn't in the tree ...
25 LIB_DEPEND=">=dev-libs/glib-2.32.0[static-libs(+)]
26 >=dev-libs/libzip-0.8:=[static-libs(+)]
27 ftdi? ( >=dev-embedded/libftdi-0.16:=[static-libs(+)] )
28 serial? ( >=dev-libs/libserialport-0.1.0[static-libs(+)] )
29 usb? ( virtual/libusb:1[static-libs(+)] )"
30 RDEPEND="!static-libs? ( ${LIB_DEPEND//\[static-libs(+)]} )
31 static-libs? ( ${LIB_DEPEND} )"
32 DEPEND="${LIB_DEPEND//\[static-libs(+)]}
33 test? ( >=dev-libs/check-0.9.4 )
37 epatch "${FILESDIR}"/${PN}-0.3.0-configure-flags.patch
38 epatch "${FILESDIR}"/${PN}-0.3.0-no-check-linkage.patch
41 # Deal with libftdi-0.x & libftdi-1.x changes.
42 if has_version dev-embedded/libftdi:1 ; then
43 sed -i 's:libftdi >= 0.16:libftdi1 >= 0.16:g' configure || die
46 # Fix implicit decl w/usleep.
47 sed -i '1i#include <unistd.h>' hardware/asix-sigma/asix-sigma.c || die
52 $(use_enable ftdi libftdi) \
53 $(use_enable serial libserialport) \
54 $(use_enable usb libusb) \
55 $(use_enable static-libs static)