summaryrefslogtreecommitdiff
blob: 504253df51b9a25f69e0bdfa63ee9ecf5f081c31 (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
56
57
58
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-util/xboxdrv/xboxdrv-0.5.0.ebuild,v 1.2 2010/06/28 21:58:09 angelos Exp $

EAPI=2
inherit eutils toolchain-funcs linux-info

MY_P=${PN}-linux-${PV}
DESCRIPTION="Userspace Xbox 360 Controller driver"
HOMEPAGE="http://pingus.seul.org/~grumbel/xboxdrv/"
SRC_URI="http://pingus.seul.org/~grumbel/xboxdrv/${MY_P}.tar.bz2"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="amd64 ~x86"
IUSE="daemon"

RDEPEND="dev-libs/boost
	virtual/libusb:0
	x11-libs/libX11"
DEPEND="${RDEPEND}
	dev-util/scons"
RDEPEND="${RDEPEND}
	daemon? (
		dev-python/dbus-python
		dev-python/pygobject
	)"

S=${WORKDIR}/${MY_P}

CONFIG_CHECK="~INPUT_EVDEV ~INPUT_JOYDEV ~INPUT_UINPUT ~!JOYSTICK_XPAD"

src_prepare() {
	epatch "${FILESDIR}"/${P}-build.patch
}

src_compile() {
	tc-export CXX
	scons || die "scons failed"
}

src_install() {
	dobin xboxdrv || die "dobin failed"

	if use daemon ; then
		dobin xboxdrv-daemon || die "dobin failed"
		doman doc/xboxdrv-daemon.1
	fi

	insinto /etc/hal/fdi/policy
	newins hal/xboxdrv_policy.fdi 99-xboxdrv.fdi || die "newins failed"

	insinto /etc/hal/fdi/preprobe
	newins hal/xboxdrv_preprobe.fdi 99-xboxdrv.fdi || die "newins failed"

	doman doc/xboxdrv.1
	dodoc AUTHORS NEWS PROTOCOL README TODO
}