ports/175876: [new port] x11-drivers/xf86-input-wacom: split from input-wacom

Jan Beich jbeich at tormail.org
Wed Feb 6 08:20:02 UTC 2013


>Number:         175876
>Category:       ports
>Synopsis:       [new port] x11-drivers/xf86-input-wacom: split from input-wacom
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    x11
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 06 08:20:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Jan Beich
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
$ usbconfig | fgrep -i wacom
ugen0.2: <CTH-470 Wacom Co.,Ltd.> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
$ pkg info -g x\*server
xorg-server-1.12.4,1           X.Org X server and related programs
>Description:
7.X is near EoL while uwacom still doesn't work on >= 8.x. So, let's
split the X11 driver from input-wacom and tidy it up. Here's the list of
my changes:

- replace rc.d script with a sample file to simplify configuration
- use the underlying install target; this exposes xorg headers which may
  be used by gnome-settings-daemon
- drop gmake and autotools dependencies
- drop explicit xinput dependency
- require webcamd to get /dev/input/eventN
- require xinerama for xsetwacom display mapping
- explicitly disable doxygen docs
- leave input-wacom as is but set up CONFLICTS and DEPRECATED
- add wacom to xorg-drivers port
- take maintainership for the time being
- update to 0.19.0

Asking x11@ folks for review about general style of xf86-input-* drivers
and everyone else if they'd rather prefer statu quo instead.
>How-To-Repeat:
$ cd ports/x11-drivers
$ svn cp input-wacom xf86-input-wacom
$ svn patch --strip 1 /path/to/split.diff
>Fix:
--- split.diff begins here ---
Index: x11-drivers/Makefile
===================================================================
--- x11-drivers/Makefile	(revision 311735)
+++ x11-drivers/Makefile	(working copy)
@@ -17,6 +17,7 @@
     SUBDIR += xf86-input-synaptics
     SUBDIR += xf86-input-vmmouse
     SUBDIR += xf86-input-void
+    SUBDIR += xf86-input-wacom
     SUBDIR += xf86-video-apm
     SUBDIR += xf86-video-ark
     SUBDIR += xf86-video-ati
Index: x11-drivers/input-wacom/Makefile
===================================================================
--- x11-drivers/input-wacom/Makefile	(revision 311735)
+++ x11-drivers/input-wacom/Makefile	(working copy)
@@ -19,6 +19,12 @@ COMMENT=	X.Org Wacom tablet driver and kernel modu
 
 BUILD_DEPENDS=	v4l_compat>=1.0.20110603:${PORTSDIR}/multimedia/v4l_compat
 
+CONFLICTS=	xf86-input-wacom-[0-9]*
+
+# Expires just after RELEASE_7_EOL is tagged
+DEPRECATED=	uwacom doesnt work on 8.x while isdv4 since r293181
+EXPIRATION_DATE=2013-02-28
+
 MAN4=		wacom.4x
 MAN1=		xsetwacom.1
 #MANCOMPRESSED=	yes
Index: x11-drivers/xf86-input-wacom/Makefile
===================================================================
--- x11-drivers/xf86-input-wacom/Makefile	(working copy)
+++ x11-drivers/xf86-input-wacom/Makefile	(working copy)
@@ -1,123 +1,39 @@
-# New ports collection makefile for:	input-wacom
-# Date Created:				24 Oct 2008
-# Whom:					Dominic Fandrey <kamikaze at bsdforen.de>
-#
 # $FreeBSD$
-#
 
-PORTNAME=	input-wacom
-PORTVERSION=	${KLD_VERSION}.${WACOM_VERSION:C/-/./g}
-PORTREVISION=	1
-CATEGORIES=	x11-drivers kld
-MASTER_SITES=	http://www.chillt.de/bsdwacom/:bsdwacom \
-		SF/linuxwacom/xf86-input-wacom/:linuxwacom
-DISTFILES=	${BSDWACOM}.tbz:bsdwacom \
-		${LINUXWACOM}.tar.bz2:linuxwacom
+PORTNAME=	xf86-input-wacom
+PORTVERSION=	0.19.0
+CATEGORIES=	x11-drivers
+MASTER_SITES=	SF/linuxwacom/${PORTNAME}
 
-MAINTAINER=	ports at FreeBSD.org
-COMMENT=	X.Org Wacom tablet driver and kernel module
+MAINTAINER=	jbeich at tormail.org
+COMMENT=	X.Org Wacom tablet driver
 
 BUILD_DEPENDS=	v4l_compat>=1.0.20110603:${PORTSDIR}/multimedia/v4l_compat
+RUN_DEPENDS=	webcamd>0:${PORTSDIR}/multimedia/webcamd
 
-MAN4=		wacom.4x
-MAN1=		xsetwacom.1
-#MANCOMPRESSED=	yes
+CONFLICTS=	input-wacom-[0-9]*
 
-USE_GMAKE=	yes
-USE_RC_SUBR=	wacom
-
-KMODDIR?=	/boot/modules
-XINPUTMODDIR=	lib/xorg/modules/input
-MAN1DIR=	man/man1
-MAN4DIR=	man/man4
-WRKSRC=		${WRKDIR}
-
-PLIST_SUB+=	KMODDIR=${KMODDIR} \
-		XINPUTMODDIR=${XINPUTMODDIR} \
-		PORTTYPE=${PORTTYPE}
-SUB_LIST:=	${PLIST_SUB}
-SUB_FILES+=	pkg-message-${PORTTYPE}
-PKGMESSAGE=	${WRKDIR}/pkg-message-${PORTTYPE}
-
+USE_BZIP2=	yes
 XORG_CAT=	driver
-USE_XORG=	xi xrandr
+USE_XORG=	xrandr xinerama
+CONFIGURE_ARGS=	--without-doxygen
+MAN1=		xsetwacom.1
+MAN4=		wacom.4x
+SUB_FILES=	pkg-message
 
-LINUXWACOM=	xf86-input-wacom-${WACOM_VERSION}
-BSDWACOM=	bsdwacom-${KLD_VERSION}
-WACOM_VERSION=	0.15.0
-KLD_VERSION=	40
-PATCH_WRKSRC=	${WRKDIR}/${LINUXWACOM}
-CONFIGURE_WRKSRC=	${WRKDIR}/${LINUXWACOM}
-USE_AUTOTOOLS=	autoconf
-MAKE_ARGS+=	UDEV_CFLAGS=""
+post-patch:
+	@${REINPLACE_CMD} -e 's/as_fn_error.*udev/${TRUE} &/' \
+		-e 's/dir=.*xorg-server/& \
+			--define-variable prefix="$$prefix"/' \
+		${WRKSRC}/configure
+	@${REINPLACE_CMD} -e '/^SUBDIRS/s/conf//' \
+		-e '/^pkgconf/s,$$(libdir),$$(prefix)/libdata,' \
+		${WRKSRC}/Makefile.in
 
-OPTIONS_DEFINE=	UWACOMKLD
-UWACOMKLD_DESC=	Install USB kernel module (not supported on 8.x)
-
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} < 800064
-OPTIONS_DEFAULT=	UWACOMKLD
-.endif
-
-.if ${PORT_OPTIONS:MUWACOMKLD}
-.if ${OSVERSION} >= 800064
-BROKEN=		does not build with USB support
-.endif
-PLIST_SUB+=	UWACOMKLD="uwacom.ko"
-PORTTYPE=	usb
-.else
-PLIST_SUB+=	UWACOMKLD="@noinst UWACOMKLD uwacom.ko"
-PORTTYPE=	serial
-.endif
-
-do-build:
-.if ${PORT_OPTIONS:MUWACOMKLD}
-	@cd ${WRKDIR}/uwacom \
-		&& ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS}
-.endif
-	@cd ${WRKDIR}/${LINUXWACOM} \
-		&& ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_ARGS}
-
-do-install:
-.if ${PORT_OPTIONS:MUWACOMKLD}
-	@${MKDIR} ${KMODDIR}
-	@${INSTALL_KLD} ${WRKDIR}/uwacom/uwacom.ko ${KMODDIR}/
-.endif
-	@${MKDIR} ${PREFIX}/${XINPUTMODDIR} ${PREFIX}/${MAN4DIR}
-	@cd ${WRKDIR}/${LINUXWACOM}/tools/ \
-		&& ${SETENV} ${MAKE_ENV} ${GMAKE} ${INSTALL}
-	@${INSTALL} ${WRKDIR}/${LINUXWACOM}/src/.libs/wacom_drv.so \
-		${PREFIX}/${XINPUTMODDIR}/
-	@${INSTALL_MAN} ${WRKDIR}/${LINUXWACOM}/man/wacom.4x \
-		${PREFIX}/${MAN4DIR}/
-	@${INSTALL_MAN} ${WRKDIR}/${LINUXWACOM}/man/xsetwacom.1 \
-		${PREFIX}/${MAN1DIR}/
-
-plist: clean configure
-	@${ECHO} "===>  Rebuilding PLIST."
-	@${TOUCH} ${PLIST}
-	@${RM} ${PLIST}
-	@cd ${WRKDIR}/linuxwacom \
-		&& ${SETENV} ${MAKE_ENV} PREFIX=${WRKDIR}/plist ./run_configure
-	@${MKDIR} ${WRKDIR}/plist
-	@cd ${WRKDIR}/linuxwacom/${LINUXWACOM}/src/util \
-		&& ${SETENV} ${MAKE_ENV} ${GMAKE} ${INSTALL}
-	@cd ${WRKDIR}/linuxwacom \
-		&& ${SETENV} ${MAKE_ENV} ./run_configure
-	@${FIND} ${WRKDIR}/plist/ -not -type d \
-		| ${SED} "s|${WRKDIR}/plist/||1" \
-		>> ${PLIST}
-	@${FIND} -d ${WRKDIR}/plist/ -mindepth 2 -type d \
-		| ${SED} "s|${WRKDIR}/plist/|@dirrm |1" \
-		>> ${PLIST}
-	@${ECHO} "%%XINPUTMODDIR%%/wacom_drv.so" >> ${PLIST}
-	@${ECHO} "@dirrmtry %%XINPUTMODDIR%%" >> ${PLIST}
-	@${ECHO} "@cwd %%KMODDIR%%" >> ${PLIST}
-	@${ECHO} "%%UWACOMKLD%%" >> ${PLIST}
-
 post-install:
-	@${ECHO} "===>  Displaying pkg-message."
+	${MKDIR} ${PREFIX}/etc/X11/xorg.conf.d
+	${INSTALL_DATA} ${FILESDIR}/wacom.conf.sample \
+		${PREFIX}/etc/X11/xorg.conf.d
 	@${CAT} ${PKGMESSAGE}
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Index: x11-drivers/xf86-input-wacom/distinfo
===================================================================
--- x11-drivers/xf86-input-wacom/distinfo	(working copy)
+++ x11-drivers/xf86-input-wacom/distinfo	(working copy)
@@ -1,4 +1,2 @@
-SHA256 (xorg/driver/bsdwacom-40.tbz) = 42c37d321768ff29fef10eb088a87a83c94753a1b4ae5f92fd453781039a5df9
-SIZE (xorg/driver/bsdwacom-40.tbz) = 19305
-SHA256 (xorg/driver/xf86-input-wacom-0.15.0.tar.bz2) = 2e9b64c30fb223c46407bd0e105a54a1e83f378eb33ac68bd8a73fdbface000f
-SIZE (xorg/driver/xf86-input-wacom-0.15.0.tar.bz2) = 528528
+SHA256 (xorg/driver/xf86-input-wacom-0.19.0.tar.bz2) = a3d8f3ee2e8f896a577e67cb4fb36c384b1405c33c4b528268a06b2f73847bd2
+SIZE (xorg/driver/xf86-input-wacom-0.19.0.tar.bz2) = 528615
Index: x11-drivers/xf86-input-wacom/files/patch-configure.ac
===================================================================
--- x11-drivers/xf86-input-wacom/files/patch-configure.ac	(revision 311735)
+++ x11-drivers/xf86-input-wacom/files/patch-configure.ac	(working copy)
@@ -1,11 +0,0 @@
---- configure.ac.orig
-+++ configure.ac
-@@ -56,7 +56,7 @@ PKG_CHECK_MODULES(XORG, [xorg-server >= 
- PKG_CHECK_MODULES(X11, x11 xi xrandr)
- 
- # Obtain compiler/linker options for libudev used by ISDV4 code
--PKG_CHECK_MODULES(UDEV, libudev)
-+#PKG_CHECK_MODULES(UDEV, libudev)
- 
- # X Server SDK location is required to install wacom header files
- # This location is also relayed in the xorg-wacom.pc file
Index: x11-drivers/xf86-input-wacom/files/patch-include-Makefile.in
===================================================================
--- x11-drivers/xf86-input-wacom/files/patch-include-Makefile.in	(revision 0)
+++ x11-drivers/xf86-input-wacom/files/patch-include-Makefile.in	(working copy)
@@ -0,0 +1,11 @@
+--- include/Makefile.in.orig
++++ include/Makefile.in
+@@ -260,7 +260,7 @@ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-sdk_HEADERS = Xwacom.h wacom-properties.h isdv4.h wacom-util.h
++sdk_HEADERS = Xwacom.h wacom-properties.h wacom-util.h
+ all: all-am
+ 
+ .SUFFIXES:
Index: x11-drivers/xf86-input-wacom/files/pkg-message-serial.in
===================================================================
--- x11-drivers/xf86-input-wacom/files/pkg-message-serial.in	(revision 311735)
+++ x11-drivers/xf86-input-wacom/files/pkg-message-serial.in	(working copy)
@@ -1,12 +0,0 @@
-To setup the wacom driver for X run the following commands as the root user:
-# %%PREFIX%%/etc/rc.d/wacom onesetup
-
-Now open your xorg.conf file and check weather the correct serial device
-was chosen. If you are using a USB to serial converter you might have
-to change it to cuaUX.
-
-You can clean up the Xorg configuration by running the following command
-before deinstalling:
-# %%PREFIX%%/etc/rc.d/wacom onecleanup
-
-Now (re)plug in your tablet and restart X.
Index: x11-drivers/xf86-input-wacom/files/pkg-message-usb.in
===================================================================
--- x11-drivers/xf86-input-wacom/files/pkg-message-usb.in	(revision 311735)
+++ x11-drivers/xf86-input-wacom/files/pkg-message-usb.in	(working copy)
@@ -1,16 +0,0 @@
-To setup the wacom driver for X and start the kernel module upon boot
-run the following commands as the root user:
-
-# echo 'wacom_enable="YES"' >> /etc/rc.conf
-# %%PREFIX%%/etc/rc.d/wacom setup
-
-You can unload the driver and clean up the Xorg configuration by
-running the following lines before deinstalling:
-# %%PREFIX%%/etc/rc.d/wacom cleanup
-# %%PREFIX%%/etc/rc.d/wacom stop
-
-To activate the driver without rebooting run:
-
-# %%PREFIX%%/etc/rc.d/wacom start
-
-Now (re)plug in your tablet and restart X.
Index: x11-drivers/xf86-input-wacom/files/pkg-message.in
===================================================================
--- x11-drivers/xf86-input-wacom/files/pkg-message.in	(revision 0)
+++ x11-drivers/xf86-input-wacom/files/pkg-message.in	(working copy)
@@ -0,0 +1,13 @@
+To configure the driver with HAL just reattach the tablet for Xserver
+to pick it up. Otherwise, use/edit the sample configuration file:
+
+  $ cd %%PREFIX%%/etc/X11/xorg.conf.d/
+  $ cp wacom.conf.sample wacom.conf
+
+On xorg-server-1.7 and earlier you may need to also merge wacom.conf
+into xorg.conf and add the following lines to ServerLayout section
+
+	InputDevice	"wacom stylus"
+	InputDevice	"wacom eraser"
+	InputDevice	"wacom touch"
+	InputDevice	"wacom pad"
Index: x11-drivers/xf86-input-wacom/files/wacom.conf.sample
===================================================================
--- x11-drivers/xf86-input-wacom/files/wacom.conf.sample	(revision 0)
+++ x11-drivers/xf86-input-wacom/files/wacom.conf.sample	(working copy)
@@ -0,0 +1,33 @@
+# A static configuration example for Bamboo P&T for use without HAL.
+
+Section "InputDevice"
+	Identifier	"wacom stylus"
+	Driver		"wacom"
+	Option		"Type"			"stylus"
+	Option		"Device"		"/dev/input/event0"
+	Option          "AutoServerLayout"	"true"
+EndSection
+
+Section "InputDevice"
+	Identifier	"wacom eraser"
+	Driver		"wacom"
+	Option		"Type"			"eraser"
+	Option		"Device"		"/dev/input/event0"
+	Option          "AutoServerLayout"	"true"
+EndSection
+
+Section "InputDevice"
+	Identifier	"wacom touch"
+	Driver		"wacom"
+	Option		"Type"			"touch"
+	Option		"Device"		"/dev/input/event1"
+	Option          "AutoServerLayout"	"true"
+EndSection
+
+Section "InputDevice"
+	Identifier	"wacom pad"
+	Driver		"wacom"
+	Option		"Type"			"pad"
+	Option		"Device"		"/dev/input/event1"
+	Option          "AutoServerLayout"	"true"
+EndSection
Index: x11-drivers/xf86-input-wacom/files/wacom.in
===================================================================
--- x11-drivers/xf86-input-wacom/files/wacom.in	(revision 311735)
+++ x11-drivers/xf86-input-wacom/files/wacom.in	(working copy)
@@ -1,433 +0,0 @@
-#!/bin/sh 
-
-# PROVIDE: wacom
-# REQUIRE: FILESYSTEMS
-#
-# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
-# to enable this service:
-#
-# wacom_enable (bool):		Set to NO by default.
-#				Set it to YES to enable wacom.
-# wacom_types (list):		Set to "stylus eraser cursor pad touch" by
-#				default. A list of wacom profiles to set up.
-# wacom_porttype (enum):	Set to "%%PORTTYPE%%" by default.
-#				Set this to usb or serial.
-#
-# This script additionally offers setup and cleanup to configure Xorg
-# for use of the driver or remove the configuration settings.
-# The input devices are only added to the first ServerLayout section
-# and also only removed once.
-# In USB mode the file /boot/loader.conf is also adjusted.
-#
-
-. /etc/rc.subr
-
-name="wacom"
-rcvar=wacom_enable
-
-extra_commands="setup cleanup"
-setup_cmd=do_setup
-start_cmd=do_start
-stop_cmd=do_stop
-cleanup_cmd=do_cleanup
-
-#
-# Outputs the location of the Xorg configuration file.
-# Returns 1 if no file could be found.
-#
-get_xorg_conf() {
-	local config_locations config
-
-	# Possible Xorg configuration file locations, taken from the
-	# xorg.conf(5) manual page.
-	config_locations="
-/etc/X11/$XORGCONFIG
-%%PREFIX%%/etc/X11/$XORGCONFIG
-/etc/X11/xorg.conf-4
-/etc/X11/xorg.conf
-/etc/xorg.conf
-%%PREFIX%%/etc/X11/xorg.conf.$HOST
-%%PREFIX%%/etc/X11/xorg.conf-4
-%%PREFIX%%/etc/X11/xorg.conf
-%%PREFIX%%/lib/X11/xorg.conf.$HOST
-%%PREFIX%%/lib/X11/xorg.conf-4
-%%PREFIX%%/lib/X11/xorg.conf
-NONE
-"
-
-	# Find the first matching config file.
-	for config in $config_locations; {
-		test -f "$config" && break
-	}
-
-	if [ "$config" = "NONE" ]; then
-		echo "No Xorg configuration has been found." 1>&2
-		return 1
-	fi
-
-	echo "$config"
-	return 0
-}
-
-#
-# Returns the line number of the first line matching the extended regular
-# expression $2 in the file $1.
-#
-# @param $1
-#	The file to get the line number from.
-# @param $2
-#	An extend regular expression.
-# @stdout
-#	The line number of the first line matching $2.
-#
-get_first() {
-	local result IFS
-	IFS='
-'
-	result="$(/usr/bin/grep -Ein "$2" "$1")"
-	result="${result%%:*}"
-
-	# No match.
-	if [ -z "$result" ]; then
-		return 1
-	fi
-
-	echo "$result"
-	return 0
-}
-
-#
-# Returns the line numbers of lines matching the extended regular
-# expression $2 in the file $1.
-#
-# @param $1
-#	The file to get the line numbers from.
-# @param $2
-#	An extend regular expression.
-# @stdout
-#	The line numbers of lines matching $2.
-#
-get_all() {
-	local entry result IFS
-	IFS='
-'
-
-	result="$(/usr/bin/grep -Ein "$2" "$1")"
-
-	# No match.
-	if [ -z "$result" ]; then
-		return 1
-	fi
-
-	for entry in $result; {
-		echo "${entry%%:*}"
-	}
-}
-
-#
-# Returns the line number of the line before line number $2 that matches the
-# extended regular expression $3 in the file $1.
-#
-# @param $1
-#	The file to get the line number from.
-# @param $2
-#	The line before which the expression should match.
-# @param $3
-#	An extend regular expression.
-# @stdout
-#	The line number of the first line before line $2 matching $3.
-#
-get_before() {
-	local result IFS line length
-	IFS='
-'
-
-	# The length is necessary to make sure the check is run once
-	# again for the last match.
-	length="$(/usr/bin/wc -l "$1")"
-	length=${length% *}
-
-	result=-1
-	for line in $(/usr/bin/grep -Ein "$3" "$1") $(($length + 1)); {
-		line="${line%%:*}"
-
-		# We have passed the line to look for.
-		if [ $line -ge $2 ]; then
-
-			# No match before this line.
-			if [ $result -lt 0 ]; then
-				return 1
-			fi
-
-			echo "$result"
-			return 0
-		fi
-
-		result=$line
-	}
-
-	# No result.
-	return 1
-}
-
-#
-# Returns the line number of the line behind line number $2 that matches the
-# extended regular expression $3 in the file $1.
-#
-# @param $1
-#	The file to get the line number from.
-# @param $2
-#	The line behind which the expression should match.
-# @param $3
-#	An extend regular expression.
-# @stdout
-#	The line number of the first line behind line $2 matching $3.
-#
-get_behind() {
-	local IFS line
-	IFS='
-'
-
-	for line in $(/usr/bin/grep -Ein "$3" "$1"); {
-		line="${line%%:*}"
-
-		# We have passed the line to look for.
-		if [ $line -gt $2 ]; then
-			echo "$line"
-			return 0
-		fi
-	}
-
-	# No result.
-	return 1
-}
-
-#
-# Inserts a line at the end of a section of an Xorg configuration file.
-# The insertion is done on all matching sections!
-#
-section_insert_line() {
-	local file section insert sections begin end length
-	file="$1"
-	section="$2"
-	insert="$3"
-
-	# Find the beginning of the section.
-	# Start with the last section to avoid moving sections around
-	# before something is inserted into them.
-	sections="$(get_all "$file" \
-		"^[[:space:]]*Section[[:space:]]+\"$section\"" \
-		| /usr/bin/sort -nr
-	)"
-
-	if [ -z "$sections" ]; then
-		echo "Identifying section $section has failed." 1>&2
-		return 1
-	fi
-
-	for begin in $sections; {
-
-		# Find the end of the section.
-		end="$(get_behind "$file" "$begin" "^[[:space:]]*EndSection")"
-
-		if [ -z "$end" ]; then
-			echo "The section $section($begin) is not closed." 1>&2
-			return 2
-		fi
-
-		# Determine the length of the configuration file.
-		length="$(/usr/bin/wc -l "$file")"
-		length=${length% *}
-
-		# Insert the line.
-		/bin/cp "$file" "$file.$$"
-
-		/usr/bin/head -n$(($end - 1)) "$file.$$" > "$file"
-		echo "$insert" >> "$file"
-		/usr/bin/tail -n$(($length - $end + 1)) "$file.$$" >> "$file"
-	
-		/bin/rm "$file.$$"
-	}
-}
-
-#
-# Adds the necessary lines to the Xorg configuration.
-#
-do_setup() {
-	local config ident status
-
-	# Get the Xorg configuration file.
-	config="$(get_xorg_conf)"
-	status=$?
-	test $status -ne 0 && return $status
-
-	echo "Setting up configuration in $config."
-
-	# Add all the necessary sections.
-	for ident in $(eval "echo \${${name}_types}"); {
-		if /usr/bin/grep -Eqi "^[[:space:]]*Identifier[[:space:]]+\"$ident\"" "$config"; then
-			echo "Skipping $ident, because it already exists in $config."
-			continue
-		fi
-
-		echo "Inserting $ident."
-
-		echo "Section \"InputDevice\"
-	Driver		\"wacom\"
-	Identifier	\"$ident\"
-	Option		\"Type\"	\"$ident\"" >> "$config"
-
-	if [ "$(eval "echo \${${name}_porttype}")" = "usb" ]; then
-		echo "	Option		\"Device\"	\"/dev/event0\"
-	Option		\"USB\"		\"on\"" >> "$config"
-	else
-		echo "	Option		\"Device\"	\"/dev/ttyd0\"
-	Option		\"ForceDevice\"	\"ISDV4\"" >> "$config"
-	fi
-
-	echo "EndSection
-" >> "$config"
-
-		section_insert_line "$config" "ServerLayout" "	InputDevice	\"$ident\"	\"SendCoreEvents\""
-	}
-
-	if [ "$(eval "echo \${${name}_porttype}")" = "usb" ]; then
-		if ! /usr/bin/grep -qx 'uwacom_load="YES"' \
-			/boot/loader.conf; then
-			echo "Setting up /boot/loader.conf"
-			/bin/cp /boot/loader.conf /boot/loader.conf.orig
-			echo 'uwacom_load="YES"' >> /boot/loader.conf
-		fi
-	fi
-}
-
-#
-# Removes all wacom stuff from the Xorg configuration file. Beware,
-# this also affects handwritten content.
-#
-do_cleanup() {
-	local config status driver i begin last_begin end length ident IFS
-
-	# Get the Xorg configuration file.
-	config="$(get_xorg_conf)"
-	status=$?
-	test $status -ne 0 && return $status
-
-	echo "Removing wacom entries from $config."
-
-	IFS='
-'
-	while true; do
-		# Find a wacom section.
-		driver="$(get_first "$config" \
-			"^[[:space:]]*Driver[[:space:]]+\"wacom\"" \
-		)"
-
-		# Not a numeric, no more wacom sections left.
-		test -z "$driver" && break
-
-		# Find the beginning of the section.
-		begin="$(get_before "$config" "$driver" \
-			"^[[:space:]]*Section[[:space:]]+\"InputDevice\"" \
-		)"
-
-		if [ -z "$begin" ]; then
-			echo "Beginning of wacom driver section" \
-				"could not be found!" 1>&2
-			return 1
-		fi
-
-		# Find the end of the section.
-		end="$(get_behind "$config" "$driver" \
-			"^[[:space:]]*EndSection" \
-		)"
-
-		if [ -z "$end" ]; then
-			echo "The Wacom driver section is" \
-				"not closed properly." 1>&2
-			return 2
-		fi
-
-		# Determine the length of the configuration file.
-		length="$(/usr/bin/wc -l "$config")"
-		length=${length% *}
-
-		# Adjust the end by trailing newlines.
-		while [ $end -lt $length -a \
-			-z "$(/usr/bin/tail -n$(($length - $end)) "$config" \
-			| /usr/bin/head -n1)" ]; do
-			end=$(($end + 1))
-		done
-
-		# Remove the section.
-		/bin/cp "$config" "$config.$$"
-
-		/usr/bin/head -n$(($begin - 1)) "$config.$$" > "$config"
-		/usr/bin/tail -n$(($length - $end)) "$config.$$" >> "$config"
-	
-		/bin/rm "$config.$$"
-	done
-	IFS='	 
-'
-
-	echo "Cleaning up ServerLayout section."
-
-	for ident in $(eval "echo \${${name}_types}"); {
-		while true; do
-		driver="$(get_first "$config" \
-			"[[:space:]]*InputDevice[[:space:]]+\"$ident\"" \
-		)"
-
-		# There is no line matching this driver.
-		test -z "$driver" && break 
-
-		# Determine the length of the configuration file.
-		length="$(/usr/bin/wc -l "$config")"
-		length=${length% *}
-
-		# Remove the section.
-		/bin/cp "$config" "$config.$$"
-
-		/usr/bin/head -n$(($driver - 1)) "$config.$$" > "$config"
-		/usr/bin/tail -n$(($length - $driver)) "$config.$$" >> "$config"
-	
-		/bin/rm "$config.$$"
-		done
-	}
-
-	if [ "$(eval "echo \${${name}_porttype}")" = "usb" ]; then
-		if /usr/bin/grep -qx 'uwacom_load="YES"' \
-			/boot/loader.conf; then
-			echo "Cleaning up /boot/loader.conf"
-			/bin/cp /boot/loader.conf /boot/loader.conf.orig
-			/usr/bin/grep -xv 'uwacom_load="YES"' \
-				/boot/loader.conf.orig > /boot/loader.conf
-		fi
-	fi
-
-}
-
-do_start() {
-	if /sbin/kldstat | /usr/bin/grep -q uwacom; then
-		return 0
-	fi
-	echo "Starting ${name}."
-	/sbin/kldload %%KMODDIR%%/uwacom.ko
-}
-
-do_stop() {
-	if ! /sbin/kldstat | /usr/bin/grep -q uwacom; then
-		echo "${name} is not running."
-		return 0
-	fi
-	echo "Stopping ${name}."
-	/sbin/kldunload %%KMODDIR%%/uwacom.ko
-}
-
-load_rc_config $name
-
-eval ": \${${name}_enable=\"NO\"}"
-eval ": \${${name}_types=\"stylus eraser cursor pad touch\"}"
-eval ": \${${name}_porttype=\"%%PORTTYPE%%\"}"
-
-run_rc_command "$1"
Index: x11-drivers/xf86-input-wacom/pkg-descr
===================================================================
--- x11-drivers/xf86-input-wacom/pkg-descr	(working copy)
+++ x11-drivers/xf86-input-wacom/pkg-descr	(working copy)
@@ -1,14 +1,4 @@
-This package contains the X.Org linuxwacom driver, a Wacom kernel module
-and a script to configure Xorg.
+An X.Org driver for Wacom tablets. It communicates with a character
+device provided by linux kernel driver in webcamd.
 
-The kernel module is provided by Bartosz Fabianowski <freebsd at chillt.de> and
-supports the following devices:
-	Graphire*, Graphire2*, Graphire3, Graphire4
-	Bamboo, Bamboo One*, Bamboo Fun
-	Intuos3, Cintiq 21UX
-	Volito*, Volito2*
-	PenStation2*, PenPartner2*
-
-* not tested
-
 WWW: http://linuxwacom.sourceforge.net/
Index: x11-drivers/xf86-input-wacom/pkg-plist
===================================================================
--- x11-drivers/xf86-input-wacom/pkg-plist	(working copy)
+++ x11-drivers/xf86-input-wacom/pkg-plist	(working copy)
@@ -1,5 +1,14 @@
 bin/xsetwacom
-%%XINPUTMODDIR%%/wacom_drv.so
- at dirrmtry %%XINPUTMODDIR%%
- at cwd %%KMODDIR%%
-%%UWACOMKLD%%
+etc/X11/xorg.conf.d/wacom.conf.sample
+include/xorg/Xwacom.h
+include/xorg/wacom-properties.h
+include/xorg/wacom-util.h
+lib/xorg/modules/input/wacom_drv.la
+lib/xorg/modules/input/wacom_drv.so
+libdata/pkgconfig/xorg-wacom.pc
+ at dirrmtry lib/xorg/modules/input
+ at dirrmtry lib/xorg/modules
+ at dirrmtry lib/xorg
+ at dirrmtry include/xorg
+ at dirrmtry etc/X11/xorg.conf.d
+ at dirrmtry etc/X11
Index: x11-drivers/xorg-drivers/Makefile
===================================================================
--- x11-drivers/xorg-drivers/Makefile	(revision 311735)
+++ x11-drivers/xorg-drivers/Makefile	(working copy)
@@ -26,7 +26,8 @@ INPUT_DRIVERS=		mouse \
 			penmount \
 			synaptics \
 			vmmouse \
-			void
+			void \
+			wacom
 
 VIDEO_DRIVERS=		ati \
 			mach64 \
--- split.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-x11 mailing list