aboutsummaryrefslogtreecommitdiffstats
path: root/dev-libs/libnfc/libnfc-1.6.0_rc1-r2.ebuild
blob: fa60d2e54be24412d94b3e29a48380e47979dfed (plain) (blame)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

inherit eutils versionator

DESCRIPTION="Near Field Communications (NFC) library"
HOMEPAGE="http://www.libnfc.org/"

MY_P="${PN}-$(replace_version_separator 3 "-")"
SRC_URI="http://${PN}.googlecode.com/files/${MY_P}.tar.gz"
S="${WORKDIR}/${MY_P}"

LICENSE="LGPL-3"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="doc serial-autoprobe"

IUSE_DRIVERS="acr122 acr122s arygon pn532_uart pn53x_usb"
for drv in $IUSE_DRIVERS; do
	IUSE="${IUSE} libnfc_drivers_${drv}"
done

CDEPEND="sys-apps/pcsc-lite
		dev-libs/libusb"
DEPEND="${CDEPEND}
		doc? ( app-doc/doxygen )"
RDEPEND="${CDEPEND}"

src_prepare() {
	epatch "${FILESDIR}/add-get-easy-frameing.patch"
	use libnfc_drivers_pn532_uart && epatch "${FILESDIR}/openpcd.patch"
}

src_configure() {
	driver=""

	local drv
	for drv in $IUSE_DRIVERS; do
		if use libnfc_drivers_${drv}; then
			if [ -z "$driver" ]; then
				driver="${drv}"
			else
				driver="${driver},${drv}"
			fi
		fi
	done

	if [ -z "$driver" ]; then
		die "You have to enable at least one driver with the LIBNFC_DRIVERS variable."
	fi

	econf \
		--with-drivers="${driver}" \
		$(use_enable serial-autoprobe)
}

src_compile() {
	emake || die "Failed to compile."
	use doc && doxygen
}

src_install() {
	emake install DESTDIR="${D}" || die "Failed to install properly."
	use doc && dohtml "${S}"/doc/html/*
}