From 884f47574979742369abc07f8b9eb866e9787a47 Mon Sep 17 00:00:00 2001 From: Denis Dupeyron Date: Fri, 29 Aug 2008 20:01:50 +0000 Subject: Last snapshot before switching to the new driver (x11-drivers/xf86-input-synaptics) with the new xorg. (Portage version: 2.2_rc8/cvs/Linux 2.6.26-gentoo-r1 i686) --- x11-drivers/synaptics/ChangeLog | 11 ++- .../synaptics-0.14.6_p20070706-fixeventgrab.patch | 82 +++++++++++++++++ .../synaptics-0.14.6_p20070706-input_api.patch | 15 ++++ x11-drivers/synaptics/synaptics-0.14.5-r1.ebuild | 6 +- x11-drivers/synaptics/synaptics-0.14.6-r1.ebuild | 4 +- x11-drivers/synaptics/synaptics-0.14.6.ebuild | 4 +- .../synaptics/synaptics-0.14.6_p20070706.ebuild | 100 +++++++++++++++++++++ 7 files changed, 214 insertions(+), 8 deletions(-) create mode 100644 x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-fixeventgrab.patch create mode 100644 x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-input_api.patch create mode 100644 x11-drivers/synaptics/synaptics-0.14.6_p20070706.ebuild (limited to 'x11-drivers') diff --git a/x11-drivers/synaptics/ChangeLog b/x11-drivers/synaptics/ChangeLog index 7c4df65436cc..ca080305ae87 100644 --- a/x11-drivers/synaptics/ChangeLog +++ b/x11-drivers/synaptics/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for x11-drivers/synaptics # Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/synaptics/ChangeLog,v 1.37 2008/07/30 13:13:24 drac Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/synaptics/ChangeLog,v 1.38 2008/08/29 20:01:49 calchan Exp $ + +*synaptics-0.14.6_p20070706 (29 Aug 2008) + + 29 Aug 2008; Denis Dupeyron + +files/synaptics-0.14.6_p20070706-fixeventgrab.patch, + +files/synaptics-0.14.6_p20070706-input_api.patch, + +synaptics-0.14.6_p20070706.ebuild: + Last snapshot before switching to the new driver + (x11-drivers/xf86-input-synaptics) with the new xorg. *synaptics-0.14.6-r3 (30 Jul 2008) diff --git a/x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-fixeventgrab.patch b/x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-fixeventgrab.patch new file mode 100644 index 000000000000..6ed8e68f8999 --- /dev/null +++ b/x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-fixeventgrab.patch @@ -0,0 +1,82 @@ +diff -urN synaptics-0.14.6_p20070706.orig/eventcomm.c synaptics-0.14.6_p20070706/eventcomm.c +--- synaptics-0.14.6_p20070706.orig/eventcomm.c 2008-08-29 09:34:11.000000000 +0200 ++++ synaptics-0.14.6_p20070706/eventcomm.c 2008-08-29 10:23:04.000000000 +0200 +@@ -41,17 +41,25 @@ + * Function Definitions + ****************************************************************************/ + +-static void ++static Bool ++grab_event_device(int fd) ++{ ++ int ret; ++ SYSCALL(ret = ioctl(fd, EVIOCGRAB, (pointer)1)); ++ return !(ret < 0); ++} ++ ++static Bool + EventDeviceOnHook(LocalDevicePtr local, SynapticsSHM *para) + { + if (para->grab_event_device) { + /* Try to grab the event device so that data don't leak to /dev/input/mice */ +- int ret; +- SYSCALL(ret = ioctl(local->fd, EVIOCGRAB, (pointer)1)); +- if (ret < 0) { ++ if(!grab_event_device(local->fd)) { + xf86Msg(X_WARNING, "%s can't grab event device, errno=%d\n", + local->name, errno); ++ return FALSE; + } ++ return TRUE; + } + } + +@@ -273,6 +281,7 @@ + char fname[64]; + int fd = -1; + Bool is_touchpad; ++ Bool is_grabbable; + + sprintf(fname, "%s/%s%d", DEV_INPUT_EVENT, EVENT_DEV_NAME, i); + SYSCALL(fd = open(fname, O_RDONLY)); +@@ -289,7 +298,14 @@ + noent_cnt = 0; + have_evdev = TRUE; + is_touchpad = event_query_is_touchpad(fd); +- if (is_touchpad) { ++ /** ++ * Check whether device can be grabbed. This means there is a race ++ * condition with EventDeviceOnHook, which can't be solved cleanly ++ * the way things are done with the current design. One possible ++ * solution would be to keep the file descriptor open. ++ */ ++ is_grabbable = grab_event_device(fd); ++ if (is_touchpad && is_grabbable) { + xf86Msg(X_PROBED, "%s auto-dev sets device to %s\n", + local->name, fname); + xf86ReplaceStrOption(local->options, "Device", fname); +diff -urN synaptics-0.14.6_p20070706.orig/synaptics.c synaptics-0.14.6_p20070706/synaptics.c +--- synaptics-0.14.6_p20070706.orig/synaptics.c 2008-08-29 09:34:11.000000000 +0200 ++++ synaptics-0.14.6_p20070706/synaptics.c 2008-08-29 10:26:01.000000000 +0200 +@@ -595,7 +595,8 @@ + return !Success; + } + +- priv->proto_ops->DeviceOnHook(local, priv->synpara); ++ if(!priv->proto_ops->DeviceOnHook(local, priv->synpara)) ++ return !Success; + + priv->comm.buffer = XisbNew(local->fd, 64); + if (!priv->comm.buffer) { +diff -urN synaptics-0.14.6_p20070706.orig/synproto.h synaptics-0.14.6_p20070706/synproto.h +--- synaptics-0.14.6_p20070706.orig/synproto.h 2008-08-29 09:34:11.000000000 +0200 ++++ synaptics-0.14.6_p20070706/synproto.h 2008-08-29 10:28:34.000000000 +0200 +@@ -77,7 +77,7 @@ + struct CommData; + + struct SynapticsProtocolOperations { +- void (*DeviceOnHook)(LocalDevicePtr local, struct _SynapticsSHM *para); ++ Bool (*DeviceOnHook)(LocalDevicePtr local, struct _SynapticsSHM *para); + void (*DeviceOffHook)(LocalDevicePtr local); + Bool (*QueryHardware)(LocalDevicePtr local, struct SynapticsHwInfo *synhw); + Bool (*ReadHwState)(LocalDevicePtr local, struct SynapticsHwInfo *synhw, diff --git a/x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-input_api.patch b/x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-input_api.patch new file mode 100644 index 000000000000..036147a4cd46 --- /dev/null +++ b/x11-drivers/synaptics/files/synaptics-0.14.6_p20070706-input_api.patch @@ -0,0 +1,15 @@ +diff -urN synaptics-0.14.6_p20070706.orig/Makefile synaptics-0.14.6_p20070706/Makefile +--- synaptics-0.14.6_p20070706.orig/Makefile 2008-08-29 09:34:11.000000000 +0200 ++++ synaptics-0.14.6_p20070706/Makefile 2008-08-29 10:40:29.000000000 +0200 +@@ -34,10 +34,9 @@ + LDCOMBINEFLAGS = -shared -lc + PICFLAG = $(call check_gcc,-fPIC,) + X_INCLUDES_ROOT = $(INSTALLED_X) +- SDKDIR = $(shell pkg-config xorg-server --variable=sdkdir) + ALLINCLUDES = -I. -I$(INSTALLED_X)/include/X11 \ + -I$(INSTALLED_X)/include/X11/extensions \ +- -I$(SDKDIR) ++ `pkg-config xorg-server --cflags` + else + INSTALLED_X = /usr/X11R6 + INPUT_MODULE_DIR = $(DESTDIR)/$(INSTALLED_X)/$(LIBDIR)/modules/input diff --git a/x11-drivers/synaptics/synaptics-0.14.5-r1.ebuild b/x11-drivers/synaptics/synaptics-0.14.5-r1.ebuild index 0710949eeae4..291f7e9343b4 100644 --- a/x11-drivers/synaptics/synaptics-0.14.5-r1.ebuild +++ b/x11-drivers/synaptics/synaptics-0.14.5-r1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2007 Gentoo Foundation +# 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.5-r1.ebuild,v 1.8 2007/10/09 07:57:35 dberkholz Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/synaptics/synaptics-0.14.5-r1.ebuild,v 1.9 2008/08/29 20:01:49 calchan Exp $ inherit toolchain-funcs eutils @@ -46,7 +46,7 @@ src_install() { install || die dodoc script/usbmouse script/usbhid alps.patch trouble-shooting.txt - dodoc COMPATIBILITY FILES INSTALL* LICENSE NEWS TODO README* + dodoc COMPATIBILITY FILES INSTALL* NEWS TODO README* # Stupid new daemon, didn't work for me because of shm issues newinitd "${FILESDIR}"/rc.init syndaemon diff --git a/x11-drivers/synaptics/synaptics-0.14.6-r1.ebuild b/x11-drivers/synaptics/synaptics-0.14.6-r1.ebuild index c0c23d55a5b0..376ffcee88d2 100644 --- a/x11-drivers/synaptics/synaptics-0.14.6-r1.ebuild +++ b/x11-drivers/synaptics/synaptics-0.14.6-r1.ebuild @@ -1,6 +1,6 @@ # 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-r1.ebuild,v 1.3 2008/04/07 15:17:56 cardoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/synaptics/synaptics-0.14.6-r1.ebuild,v 1.4 2008/08/29 20:01:49 calchan Exp $ inherit toolchain-funcs eutils @@ -48,7 +48,7 @@ src_install() { install || die dodoc script/usbmouse script/usbhid alps.patch trouble-shooting.txt - dodoc COMPATIBILITY FILES INSTALL* LICENSE NEWS TODO README* + dodoc COMPATIBILITY FILES INSTALL* NEWS TODO README* # Stupid new daemon, didn't work for me because of shm issues newinitd "${FILESDIR}"/rc.init syndaemon diff --git a/x11-drivers/synaptics/synaptics-0.14.6.ebuild b/x11-drivers/synaptics/synaptics-0.14.6.ebuild index 8395519edb6f..2f6c93589021 100644 --- a/x11-drivers/synaptics/synaptics-0.14.6.ebuild +++ b/x11-drivers/synaptics/synaptics-0.14.6.ebuild @@ -1,6 +1,6 @@ # 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.ebuild,v 1.10 2008/04/07 15:17:56 cardoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/synaptics/synaptics-0.14.6.ebuild,v 1.11 2008/08/29 20:01:49 calchan Exp $ inherit toolchain-funcs eutils @@ -43,7 +43,7 @@ src_install() { install || die dodoc script/usbmouse script/usbhid alps.patch trouble-shooting.txt - dodoc COMPATIBILITY FILES INSTALL* LICENSE NEWS TODO README* + dodoc COMPATIBILITY FILES INSTALL* NEWS TODO README* # Stupid new daemon, didn't work for me because of shm issues newinitd "${FILESDIR}"/rc.init syndaemon diff --git a/x11-drivers/synaptics/synaptics-0.14.6_p20070706.ebuild b/x11-drivers/synaptics/synaptics-0.14.6_p20070706.ebuild new file mode 100644 index 000000000000..54fb480c3367 --- /dev/null +++ b/x11-drivers/synaptics/synaptics-0.14.6_p20070706.ebuild @@ -0,0 +1,100 @@ +# 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_p20070706.ebuild,v 1.1 2008/08/29 20:01:49 calchan 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://dev.gentoo.org/~calchan/distfiles/${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" + +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}"/${P}-fixeventgrab.patch + + epatch "${FILESDIR}"/${P}-input_api.patch + + # 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}"/${PN}-0.14.6-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 +} -- cgit v1.2.3-65-gdbad