summaryrefslogtreecommitdiff
blob: 41b77cc1a85a5e588215ed1bbd9dc6125fd793dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

DESCRIPTION="General-purpose library for iRiver's iFP portable audio players"
HOMEPAGE="https://ifp-driver.sourceforge.net/libifp/"
SRC_URI="https://downloads.sourceforge.net/ifp-driver/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm64 ppc ppc64 x86"
IUSE="doc examples static-libs"

RDEPEND="virtual/libusb:0"
DEPEND="${RDEPEND}
	doc? ( >=app-text/doxygen-1.3.7 )"

src_prepare() {
	default
	sed -i \
		-e '/CFLAGS=/s:-g -O2:${CFLAGS}:' \
		-e '/CXXFLAGS=/s:-g -O2:${CXXFLAGS}:' \
		configure || die
}

src_configure() {
	use doc || export have_doxygen=no

	econf \
		$(use_enable static-libs static) \
		$(use_enable examples) \
		--with-libusb \
		--without-kmodule
}

src_test() { :; } # hardware dependant wrt #318597

src_install() {
	emake DESTDIR="${D}" install

	find "${D}" -name '*.la' -exec rm -f {} + || die

	# clean /usr/bin after installation
	# by moving examples to examples dir
	if use examples; then
	    insinto /usr/share/${PN}/examples
	    doins "${S}"/examples/simple.c "${S}"/examples/ifpline.c
	    mv "${D}"/usr/bin/{simple,ifpline} "${D}"/usr/share/${PN}/examples || die
	else
	    rm -f "${D}"/usr/bin/{simple,ifpline} || die
	fi

	use doc && dodoc README ChangeLog TODO
}