sci-libs/coinor-sample: improve the long description in metadata.xml.
[gentoo.git] / sci-libs / libsigrok / libsigrok-0.3.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 inherit eutils autotools ltprune
7
8 if [[ ${PV} == "9999" ]]; then
9         EGIT_REPO_URI="git://sigrok.org/${PN}"
10         inherit git-r3 autotools
11 else
12         SRC_URI="https://sigrok.org/download/source/${PN}/${P}.tar.gz"
13         KEYWORDS="amd64 x86"
14 fi
15
16 DESCRIPTION="basic hardware drivers for logic analyzers and input/output file format support"
17 HOMEPAGE="https://sigrok.org/wiki/Libsigrok"
18
19 LICENSE="GPL-3"
20 SLOT="0/2"
21 IUSE="ftdi serial static-libs test usb"
22 RESTRICT="!test? ( test )"
23
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 )
34         virtual/pkgconfig"
35
36 src_prepare() {
37         epatch "${FILESDIR}"/${PN}-0.3.0-configure-flags.patch
38         epatch "${FILESDIR}"/${PN}-0.3.0-no-check-linkage.patch
39         eautoreconf
40
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
44         fi
45
46         # Fix implicit decl w/usleep.
47         sed -i '1i#include <unistd.h>' hardware/asix-sigma/asix-sigma.c || die
48 }
49
50 src_configure() {
51         econf \
52                 $(use_enable ftdi libftdi) \
53                 $(use_enable serial libserialport) \
54                 $(use_enable usb libusb) \
55                 $(use_enable static-libs static)
56 }
57
58 src_test() {
59         emake check
60 }
61
62 src_install() {
63         default
64         prune_libtool_files
65 }