summaryrefslogtreecommitdiff
blob: 31a93cc0560e74484f501b6ba25048e87caa8bd7 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-drivers/synaptics/synaptics-0.14.6-r3.ebuild,v 1.2 2008/09/06 21:40:57 chainsaw Exp $

inherit toolchain-funcs eutils linux-info

IUSE="hal"

DESCRIPTION="Driver for Synaptics touchpads"
HOMEPAGE="http://w1.894.telia.com/~u89404340/touchpad/"
SRC_URI="http://w1.894.telia.com/~u89404340/touchpad/files/${P}.tar.bz2"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"

RDEPEND="x11-libs/libXext
	 hal? ( sys-apps/hal )"
DEPEND="${RDEPEND}
	x11-base/xorg-server
	x11-proto/inputproto
	>=sys-apps/sed-4
	!x11-drivers/xf86-input-synaptics"

evdev-input_check() {
	# Check kernel config for required event interface support (either
	# built-in or as a module. Bug #134309.

	ebegin "Checking kernel config for event device support"
	linux_chkconfig_present INPUT_EVDEV
	eend $?

	if [[ $? -ne 0 ]] ; then
		ewarn "Synaptics driver requires event interface support."
		ewarn "Please enable the event interface in your kernel config."
		ewarn "The option can be found at:"
		ewarn
		ewarn "  Device Drivers"
		ewarn "    Input device support"
		ewarn "      -*- Generic input layer"
		ewarn "        <*> Event interface"
		ewarn
		ewarn "Then rebuild the kernel or install the module."
		epause 5
	fi
}

pkg_setup() {
	linux-info_pkg_setup
	evdev-input_check
}

src_unpack() {
	unpack ${A} ; cd "${S}"

	# Switch up the CC and CFLAGS stuff.
	sed -i \
		-e "s:CC = gcc:CC = $(tc-getCC):g" \
		-e "s:CDEBUGFLAGS = -O2:CDEBUGFLAGS = ${CFLAGS}:g" \
		"${S}"/Makefile

	# Fix grabbing of event devices so it will not stop working together with
	# packages which grab their devices at their own like sys-apps/inputd does.
	epatch "${FILESDIR}"/synaptics-fixeventgrab.diff

	epatch "${FILESDIR}"/synaptics_input_api.diff

	# Patch the Makefile to install the library as executable. Bug #215323.
	epatch "${FILESDIR}"/synaptics-install-so-exec.patch

	# Fix to handle multiple screens through Xinerama properly. Bug #206614.
	epatch "${FILESDIR}"/synaptics-fix-xinerama.patch

	# Adds configurable polling interval. Patch from Novell. Bug #216679.
	epatch "${FILESDIR}"/${P}-configurable_polling_interval.patch
}

src_compile() {
	emake || die
}

src_install() {
	make \
		DESTDIR="${D}" \
		PREFIX=/usr \
		MANDIR="${D}"/usr/share/man \
		install || die

	dodoc script/usbmouse script/usbhid alps.patch trouble-shooting.txt
	dodoc COMPATIBILITY FILES INSTALL* NEWS TODO README*

	# Stupid new daemon, didn't work for me because of shm issues
	newinitd "${FILESDIR}"/rc.init syndaemon
	newconfd "${FILESDIR}"/rc.conf syndaemon

	if use hal ; then
		# Have HAL assign this driver to supported touchpads.
		insinto /usr/share/hal/fdi/policy/10osvendor
		doins "${FILESDIR}"/11-x11-synaptics.fdi
	fi
}