View | Details | Raw Unified | Return to bug 175876
Collapse All | Expand All

(-)x11-drivers/Makefile (+1 lines)
Lines 17-22 Link Here
17
    SUBDIR += xf86-input-synaptics
17
    SUBDIR += xf86-input-synaptics
18
    SUBDIR += xf86-input-vmmouse
18
    SUBDIR += xf86-input-vmmouse
19
    SUBDIR += xf86-input-void
19
    SUBDIR += xf86-input-void
20
    SUBDIR += xf86-input-wacom
20
    SUBDIR += xf86-video-apm
21
    SUBDIR += xf86-video-apm
21
    SUBDIR += xf86-video-ark
22
    SUBDIR += xf86-video-ark
22
    SUBDIR += xf86-video-ati
23
    SUBDIR += xf86-video-ati
(-)x11-drivers/input-wacom/Makefile (+6 lines)
Lines 19-24 COMMENT= X.Org Wacom tablet driver and kernel modu Link Here
19
19
20
BUILD_DEPENDS=	v4l_compat>=1.0.20110603:${PORTSDIR}/multimedia/v4l_compat
20
BUILD_DEPENDS=	v4l_compat>=1.0.20110603:${PORTSDIR}/multimedia/v4l_compat
21
21
22
CONFLICTS=	xf86-input-wacom-[0-9]*
23
24
# Expires just after RELEASE_7_EOL is tagged
25
DEPRECATED=	uwacom doesnt work on 8.x while isdv4 since r293181
26
EXPIRATION_DATE=2013-02-28
27
22
MAN4=		wacom.4x
28
MAN4=		wacom.4x
23
MAN1=		xsetwacom.1
29
MAN1=		xsetwacom.1
24
#MANCOMPRESSED=	yes
30
#MANCOMPRESSED=	yes
(-)x11-drivers/xf86-input-wacom/Makefile (-110 / +26 lines)
Lines 1-123 Link Here
1
# New ports collection makefile for:	input-wacom
2
# Date Created:				24 Oct 2008
3
# Whom:					Dominic Fandrey <kamikaze@bsdforen.de>
4
#
5
# $FreeBSD$
1
# $FreeBSD$
6
#
7
2
8
PORTNAME=	input-wacom
3
PORTNAME=	xf86-input-wacom
9
PORTVERSION=	${KLD_VERSION}.${WACOM_VERSION:C/-/./g}
4
PORTVERSION=	0.19.0
10
PORTREVISION=	1
5
CATEGORIES=	x11-drivers
11
CATEGORIES=	x11-drivers kld
6
MASTER_SITES=	SF/linuxwacom/${PORTNAME}
12
MASTER_SITES=	http://www.chillt.de/bsdwacom/:bsdwacom \
13
		SF/linuxwacom/xf86-input-wacom/:linuxwacom
14
DISTFILES=	${BSDWACOM}.tbz:bsdwacom \
15
		${LINUXWACOM}.tar.bz2:linuxwacom
16
7
17
MAINTAINER=	ports@FreeBSD.org
8
MAINTAINER=	jbeich@tormail.org
18
COMMENT=	X.Org Wacom tablet driver and kernel module
9
COMMENT=	X.Org Wacom tablet driver
19
10
20
BUILD_DEPENDS=	v4l_compat>=1.0.20110603:${PORTSDIR}/multimedia/v4l_compat
11
BUILD_DEPENDS=	v4l_compat>=1.0.20110603:${PORTSDIR}/multimedia/v4l_compat
12
RUN_DEPENDS=	webcamd>0:${PORTSDIR}/multimedia/webcamd
21
13
22
MAN4=		wacom.4x
14
CONFLICTS=	input-wacom-[0-9]*
23
MAN1=		xsetwacom.1
24
#MANCOMPRESSED=	yes
25
15
26
USE_GMAKE=	yes
16
USE_BZIP2=	yes
27
USE_RC_SUBR=	wacom
28
29
KMODDIR?=	/boot/modules
30
XINPUTMODDIR=	lib/xorg/modules/input
31
MAN1DIR=	man/man1
32
MAN4DIR=	man/man4
33
WRKSRC=		${WRKDIR}
34
35
PLIST_SUB+=	KMODDIR=${KMODDIR} \
36
		XINPUTMODDIR=${XINPUTMODDIR} \
37
		PORTTYPE=${PORTTYPE}
38
SUB_LIST:=	${PLIST_SUB}
39
SUB_FILES+=	pkg-message-${PORTTYPE}
40
PKGMESSAGE=	${WRKDIR}/pkg-message-${PORTTYPE}
41
42
XORG_CAT=	driver
17
XORG_CAT=	driver
43
USE_XORG=	xi xrandr
18
USE_XORG=	xrandr xinerama
19
CONFIGURE_ARGS=	--without-doxygen
20
MAN1=		xsetwacom.1
21
MAN4=		wacom.4x
22
SUB_FILES=	pkg-message
44
23
45
LINUXWACOM=	xf86-input-wacom-${WACOM_VERSION}
24
post-patch:
46
BSDWACOM=	bsdwacom-${KLD_VERSION}
25
	@${REINPLACE_CMD} -e 's/as_fn_error.*udev/${TRUE} &/' \
47
WACOM_VERSION=	0.15.0
26
		-e 's/dir=.*xorg-server/& \
48
KLD_VERSION=	40
27
			--define-variable prefix="$$prefix"/' \
49
PATCH_WRKSRC=	${WRKDIR}/${LINUXWACOM}
28
		${WRKSRC}/configure
50
CONFIGURE_WRKSRC=	${WRKDIR}/${LINUXWACOM}
29
	@${REINPLACE_CMD} -e '/^SUBDIRS/s/conf//' \
51
USE_AUTOTOOLS=	autoconf
30
		-e '/^pkgconf/s,$$(libdir),$$(prefix)/libdata,' \
52
MAKE_ARGS+=	UDEV_CFLAGS=""
31
		${WRKSRC}/Makefile.in
53
32
54
OPTIONS_DEFINE=	UWACOMKLD
55
UWACOMKLD_DESC=	Install USB kernel module (not supported on 8.x)
56
57
.include <bsd.port.pre.mk>
58
59
.if ${OSVERSION} < 800064
60
OPTIONS_DEFAULT=	UWACOMKLD
61
.endif
62
63
.if ${PORT_OPTIONS:MUWACOMKLD}
64
.if ${OSVERSION} >= 800064
65
BROKEN=		does not build with USB support
66
.endif
67
PLIST_SUB+=	UWACOMKLD="uwacom.ko"
68
PORTTYPE=	usb
69
.else
70
PLIST_SUB+=	UWACOMKLD="@noinst UWACOMKLD uwacom.ko"
71
PORTTYPE=	serial
72
.endif
73
74
do-build:
75
.if ${PORT_OPTIONS:MUWACOMKLD}
76
	@cd ${WRKDIR}/uwacom \
77
		&& ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS}
78
.endif
79
	@cd ${WRKDIR}/${LINUXWACOM} \
80
		&& ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_ARGS}
81
82
do-install:
83
.if ${PORT_OPTIONS:MUWACOMKLD}
84
	@${MKDIR} ${KMODDIR}
85
	@${INSTALL_KLD} ${WRKDIR}/uwacom/uwacom.ko ${KMODDIR}/
86
.endif
87
	@${MKDIR} ${PREFIX}/${XINPUTMODDIR} ${PREFIX}/${MAN4DIR}
88
	@cd ${WRKDIR}/${LINUXWACOM}/tools/ \
89
		&& ${SETENV} ${MAKE_ENV} ${GMAKE} ${INSTALL}
90
	@${INSTALL} ${WRKDIR}/${LINUXWACOM}/src/.libs/wacom_drv.so \
91
		${PREFIX}/${XINPUTMODDIR}/
92
	@${INSTALL_MAN} ${WRKDIR}/${LINUXWACOM}/man/wacom.4x \
93
		${PREFIX}/${MAN4DIR}/
94
	@${INSTALL_MAN} ${WRKDIR}/${LINUXWACOM}/man/xsetwacom.1 \
95
		${PREFIX}/${MAN1DIR}/
96
97
plist: clean configure
98
	@${ECHO} "===>  Rebuilding PLIST."
99
	@${TOUCH} ${PLIST}
100
	@${RM} ${PLIST}
101
	@cd ${WRKDIR}/linuxwacom \
102
		&& ${SETENV} ${MAKE_ENV} PREFIX=${WRKDIR}/plist ./run_configure
103
	@${MKDIR} ${WRKDIR}/plist
104
	@cd ${WRKDIR}/linuxwacom/${LINUXWACOM}/src/util \
105
		&& ${SETENV} ${MAKE_ENV} ${GMAKE} ${INSTALL}
106
	@cd ${WRKDIR}/linuxwacom \
107
		&& ${SETENV} ${MAKE_ENV} ./run_configure
108
	@${FIND} ${WRKDIR}/plist/ -not -type d \
109
		| ${SED} "s|${WRKDIR}/plist/||1" \
110
		>> ${PLIST}
111
	@${FIND} -d ${WRKDIR}/plist/ -mindepth 2 -type d \
112
		| ${SED} "s|${WRKDIR}/plist/|@dirrm |1" \
113
		>> ${PLIST}
114
	@${ECHO} "%%XINPUTMODDIR%%/wacom_drv.so" >> ${PLIST}
115
	@${ECHO} "@dirrmtry %%XINPUTMODDIR%%" >> ${PLIST}
116
	@${ECHO} "@cwd %%KMODDIR%%" >> ${PLIST}
117
	@${ECHO} "%%UWACOMKLD%%" >> ${PLIST}
118
119
post-install:
33
post-install:
120
	@${ECHO} "===>  Displaying pkg-message."
34
	${MKDIR} ${PREFIX}/etc/X11/xorg.conf.d
35
	${INSTALL_DATA} ${FILESDIR}/wacom.conf.sample \
36
		${PREFIX}/etc/X11/xorg.conf.d
121
	@${CAT} ${PKGMESSAGE}
37
	@${CAT} ${PKGMESSAGE}
122
38
123
.include <bsd.port.post.mk>
39
.include <bsd.port.mk>
(-)x11-drivers/xf86-input-wacom/distinfo (-4 / +2 lines)
Lines 1-4 Link Here
1
SHA256 (xorg/driver/bsdwacom-40.tbz) = 42c37d321768ff29fef10eb088a87a83c94753a1b4ae5f92fd453781039a5df9
1
SHA256 (xorg/driver/xf86-input-wacom-0.19.0.tar.bz2) = a3d8f3ee2e8f896a577e67cb4fb36c384b1405c33c4b528268a06b2f73847bd2
2
SIZE (xorg/driver/bsdwacom-40.tbz) = 19305
2
SIZE (xorg/driver/xf86-input-wacom-0.19.0.tar.bz2) = 528615
3
SHA256 (xorg/driver/xf86-input-wacom-0.15.0.tar.bz2) = 2e9b64c30fb223c46407bd0e105a54a1e83f378eb33ac68bd8a73fdbface000f
4
SIZE (xorg/driver/xf86-input-wacom-0.15.0.tar.bz2) = 528528
(-)x11-drivers/xf86-input-wacom/files/patch-configure.ac (-11 lines)
Lines 1-11 Link Here
1
--- configure.ac.orig
2
+++ configure.ac
3
@@ -56,7 +56,7 @@ PKG_CHECK_MODULES(XORG, [xorg-server >= 
4
 PKG_CHECK_MODULES(X11, x11 xi xrandr)
5
 
6
 # Obtain compiler/linker options for libudev used by ISDV4 code
7
-PKG_CHECK_MODULES(UDEV, libudev)
8
+#PKG_CHECK_MODULES(UDEV, libudev)
9
 
10
 # X Server SDK location is required to install wacom header files
11
 # This location is also relayed in the xorg-wacom.pc file
(-)x11-drivers/xf86-input-wacom/files/patch-include-Makefile.in (+11 lines)
Line 0 Link Here
1
--- include/Makefile.in.orig
2
+++ include/Makefile.in
3
@@ -260,7 +260,7 @@ target_alias = @target_alias@
4
 top_build_prefix = @top_build_prefix@
5
 top_builddir = @top_builddir@
6
 top_srcdir = @top_srcdir@
7
-sdk_HEADERS = Xwacom.h wacom-properties.h isdv4.h wacom-util.h
8
+sdk_HEADERS = Xwacom.h wacom-properties.h wacom-util.h
9
 all: all-am
10
 
11
 .SUFFIXES:
(-)x11-drivers/xf86-input-wacom/files/pkg-message-serial.in (-12 lines)
Lines 1-12 Link Here
1
To setup the wacom driver for X run the following commands as the root user:
2
# %%PREFIX%%/etc/rc.d/wacom onesetup
3
4
Now open your xorg.conf file and check weather the correct serial device
5
was chosen. If you are using a USB to serial converter you might have
6
to change it to cuaUX.
7
8
You can clean up the Xorg configuration by running the following command
9
before deinstalling:
10
# %%PREFIX%%/etc/rc.d/wacom onecleanup
11
12
Now (re)plug in your tablet and restart X.
(-)x11-drivers/xf86-input-wacom/files/pkg-message-usb.in (-16 lines)
Lines 1-16 Link Here
1
To setup the wacom driver for X and start the kernel module upon boot
2
run the following commands as the root user:
3
4
# echo 'wacom_enable="YES"' >> /etc/rc.conf
5
# %%PREFIX%%/etc/rc.d/wacom setup
6
7
You can unload the driver and clean up the Xorg configuration by
8
running the following lines before deinstalling:
9
# %%PREFIX%%/etc/rc.d/wacom cleanup
10
# %%PREFIX%%/etc/rc.d/wacom stop
11
12
To activate the driver without rebooting run:
13
14
# %%PREFIX%%/etc/rc.d/wacom start
15
16
Now (re)plug in your tablet and restart X.
(-)x11-drivers/xf86-input-wacom/files/pkg-message.in (+13 lines)
Line 0 Link Here
1
To configure the driver with HAL just reattach the tablet for Xserver
2
to pick it up. Otherwise, use/edit the sample configuration file:
3
4
  $ cd %%PREFIX%%/etc/X11/xorg.conf.d/
5
  $ cp wacom.conf.sample wacom.conf
6
7
On xorg-server-1.7 and earlier you may need to also merge wacom.conf
8
into xorg.conf and add the following lines to ServerLayout section
9
10
	InputDevice	"wacom stylus"
11
	InputDevice	"wacom eraser"
12
	InputDevice	"wacom touch"
13
	InputDevice	"wacom pad"
(-)x11-drivers/xf86-input-wacom/files/wacom.conf.sample (+33 lines)
Line 0 Link Here
1
# A static configuration example for Bamboo P&T for use without HAL.
2
3
Section "InputDevice"
4
	Identifier	"wacom stylus"
5
	Driver		"wacom"
6
	Option		"Type"			"stylus"
7
	Option		"Device"		"/dev/input/event0"
8
	Option          "AutoServerLayout"	"true"
9
EndSection
10
11
Section "InputDevice"
12
	Identifier	"wacom eraser"
13
	Driver		"wacom"
14
	Option		"Type"			"eraser"
15
	Option		"Device"		"/dev/input/event0"
16
	Option          "AutoServerLayout"	"true"
17
EndSection
18
19
Section "InputDevice"
20
	Identifier	"wacom touch"
21
	Driver		"wacom"
22
	Option		"Type"			"touch"
23
	Option		"Device"		"/dev/input/event1"
24
	Option          "AutoServerLayout"	"true"
25
EndSection
26
27
Section "InputDevice"
28
	Identifier	"wacom pad"
29
	Driver		"wacom"
30
	Option		"Type"			"pad"
31
	Option		"Device"		"/dev/input/event1"
32
	Option          "AutoServerLayout"	"true"
33
EndSection
(-)x11-drivers/xf86-input-wacom/files/wacom.in (-433 lines)
Lines 1-433 Link Here
1
#!/bin/sh 
2
3
# PROVIDE: wacom
4
# REQUIRE: FILESYSTEMS
5
#
6
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
7
# to enable this service:
8
#
9
# wacom_enable (bool):		Set to NO by default.
10
#				Set it to YES to enable wacom.
11
# wacom_types (list):		Set to "stylus eraser cursor pad touch" by
12
#				default. A list of wacom profiles to set up.
13
# wacom_porttype (enum):	Set to "%%PORTTYPE%%" by default.
14
#				Set this to usb or serial.
15
#
16
# This script additionally offers setup and cleanup to configure Xorg
17
# for use of the driver or remove the configuration settings.
18
# The input devices are only added to the first ServerLayout section
19
# and also only removed once.
20
# In USB mode the file /boot/loader.conf is also adjusted.
21
#
22
23
. /etc/rc.subr
24
25
name="wacom"
26
rcvar=wacom_enable
27
28
extra_commands="setup cleanup"
29
setup_cmd=do_setup
30
start_cmd=do_start
31
stop_cmd=do_stop
32
cleanup_cmd=do_cleanup
33
34
#
35
# Outputs the location of the Xorg configuration file.
36
# Returns 1 if no file could be found.
37
#
38
get_xorg_conf() {
39
	local config_locations config
40
41
	# Possible Xorg configuration file locations, taken from the
42
	# xorg.conf(5) manual page.
43
	config_locations="
44
/etc/X11/$XORGCONFIG
45
%%PREFIX%%/etc/X11/$XORGCONFIG
46
/etc/X11/xorg.conf-4
47
/etc/X11/xorg.conf
48
/etc/xorg.conf
49
%%PREFIX%%/etc/X11/xorg.conf.$HOST
50
%%PREFIX%%/etc/X11/xorg.conf-4
51
%%PREFIX%%/etc/X11/xorg.conf
52
%%PREFIX%%/lib/X11/xorg.conf.$HOST
53
%%PREFIX%%/lib/X11/xorg.conf-4
54
%%PREFIX%%/lib/X11/xorg.conf
55
NONE
56
"
57
58
	# Find the first matching config file.
59
	for config in $config_locations; {
60
		test -f "$config" && break
61
	}
62
63
	if [ "$config" = "NONE" ]; then
64
		echo "No Xorg configuration has been found." 1>&2
65
		return 1
66
	fi
67
68
	echo "$config"
69
	return 0
70
}
71
72
#
73
# Returns the line number of the first line matching the extended regular
74
# expression $2 in the file $1.
75
#
76
# @param $1
77
#	The file to get the line number from.
78
# @param $2
79
#	An extend regular expression.
80
# @stdout
81
#	The line number of the first line matching $2.
82
#
83
get_first() {
84
	local result IFS
85
	IFS='
86
'
87
	result="$(/usr/bin/grep -Ein "$2" "$1")"
88
	result="${result%%:*}"
89
90
	# No match.
91
	if [ -z "$result" ]; then
92
		return 1
93
	fi
94
95
	echo "$result"
96
	return 0
97
}
98
99
#
100
# Returns the line numbers of lines matching the extended regular
101
# expression $2 in the file $1.
102
#
103
# @param $1
104
#	The file to get the line numbers from.
105
# @param $2
106
#	An extend regular expression.
107
# @stdout
108
#	The line numbers of lines matching $2.
109
#
110
get_all() {
111
	local entry result IFS
112
	IFS='
113
'
114
115
	result="$(/usr/bin/grep -Ein "$2" "$1")"
116
117
	# No match.
118
	if [ -z "$result" ]; then
119
		return 1
120
	fi
121
122
	for entry in $result; {
123
		echo "${entry%%:*}"
124
	}
125
}
126
127
#
128
# Returns the line number of the line before line number $2 that matches the
129
# extended regular expression $3 in the file $1.
130
#
131
# @param $1
132
#	The file to get the line number from.
133
# @param $2
134
#	The line before which the expression should match.
135
# @param $3
136
#	An extend regular expression.
137
# @stdout
138
#	The line number of the first line before line $2 matching $3.
139
#
140
get_before() {
141
	local result IFS line length
142
	IFS='
143
'
144
145
	# The length is necessary to make sure the check is run once
146
	# again for the last match.
147
	length="$(/usr/bin/wc -l "$1")"
148
	length=${length% *}
149
150
	result=-1
151
	for line in $(/usr/bin/grep -Ein "$3" "$1") $(($length + 1)); {
152
		line="${line%%:*}"
153
154
		# We have passed the line to look for.
155
		if [ $line -ge $2 ]; then
156
157
			# No match before this line.
158
			if [ $result -lt 0 ]; then
159
				return 1
160
			fi
161
162
			echo "$result"
163
			return 0
164
		fi
165
166
		result=$line
167
	}
168
169
	# No result.
170
	return 1
171
}
172
173
#
174
# Returns the line number of the line behind line number $2 that matches the
175
# extended regular expression $3 in the file $1.
176
#
177
# @param $1
178
#	The file to get the line number from.
179
# @param $2
180
#	The line behind which the expression should match.
181
# @param $3
182
#	An extend regular expression.
183
# @stdout
184
#	The line number of the first line behind line $2 matching $3.
185
#
186
get_behind() {
187
	local IFS line
188
	IFS='
189
'
190
191
	for line in $(/usr/bin/grep -Ein "$3" "$1"); {
192
		line="${line%%:*}"
193
194
		# We have passed the line to look for.
195
		if [ $line -gt $2 ]; then
196
			echo "$line"
197
			return 0
198
		fi
199
	}
200
201
	# No result.
202
	return 1
203
}
204
205
#
206
# Inserts a line at the end of a section of an Xorg configuration file.
207
# The insertion is done on all matching sections!
208
#
209
section_insert_line() {
210
	local file section insert sections begin end length
211
	file="$1"
212
	section="$2"
213
	insert="$3"
214
215
	# Find the beginning of the section.
216
	# Start with the last section to avoid moving sections around
217
	# before something is inserted into them.
218
	sections="$(get_all "$file" \
219
		"^[[:space:]]*Section[[:space:]]+\"$section\"" \
220
		| /usr/bin/sort -nr
221
	)"
222
223
	if [ -z "$sections" ]; then
224
		echo "Identifying section $section has failed." 1>&2
225
		return 1
226
	fi
227
228
	for begin in $sections; {
229
230
		# Find the end of the section.
231
		end="$(get_behind "$file" "$begin" "^[[:space:]]*EndSection")"
232
233
		if [ -z "$end" ]; then
234
			echo "The section $section($begin) is not closed." 1>&2
235
			return 2
236
		fi
237
238
		# Determine the length of the configuration file.
239
		length="$(/usr/bin/wc -l "$file")"
240
		length=${length% *}
241
242
		# Insert the line.
243
		/bin/cp "$file" "$file.$$"
244
245
		/usr/bin/head -n$(($end - 1)) "$file.$$" > "$file"
246
		echo "$insert" >> "$file"
247
		/usr/bin/tail -n$(($length - $end + 1)) "$file.$$" >> "$file"
248
	
249
		/bin/rm "$file.$$"
250
	}
251
}
252
253
#
254
# Adds the necessary lines to the Xorg configuration.
255
#
256
do_setup() {
257
	local config ident status
258
259
	# Get the Xorg configuration file.
260
	config="$(get_xorg_conf)"
261
	status=$?
262
	test $status -ne 0 && return $status
263
264
	echo "Setting up configuration in $config."
265
266
	# Add all the necessary sections.
267
	for ident in $(eval "echo \${${name}_types}"); {
268
		if /usr/bin/grep -Eqi "^[[:space:]]*Identifier[[:space:]]+\"$ident\"" "$config"; then
269
			echo "Skipping $ident, because it already exists in $config."
270
			continue
271
		fi
272
273
		echo "Inserting $ident."
274
275
		echo "Section \"InputDevice\"
276
	Driver		\"wacom\"
277
	Identifier	\"$ident\"
278
	Option		\"Type\"	\"$ident\"" >> "$config"
279
280
	if [ "$(eval "echo \${${name}_porttype}")" = "usb" ]; then
281
		echo "	Option		\"Device\"	\"/dev/event0\"
282
	Option		\"USB\"		\"on\"" >> "$config"
283
	else
284
		echo "	Option		\"Device\"	\"/dev/ttyd0\"
285
	Option		\"ForceDevice\"	\"ISDV4\"" >> "$config"
286
	fi
287
288
	echo "EndSection
289
" >> "$config"
290
291
		section_insert_line "$config" "ServerLayout" "	InputDevice	\"$ident\"	\"SendCoreEvents\""
292
	}
293
294
	if [ "$(eval "echo \${${name}_porttype}")" = "usb" ]; then
295
		if ! /usr/bin/grep -qx 'uwacom_load="YES"' \
296
			/boot/loader.conf; then
297
			echo "Setting up /boot/loader.conf"
298
			/bin/cp /boot/loader.conf /boot/loader.conf.orig
299
			echo 'uwacom_load="YES"' >> /boot/loader.conf
300
		fi
301
	fi
302
}
303
304
#
305
# Removes all wacom stuff from the Xorg configuration file. Beware,
306
# this also affects handwritten content.
307
#
308
do_cleanup() {
309
	local config status driver i begin last_begin end length ident IFS
310
311
	# Get the Xorg configuration file.
312
	config="$(get_xorg_conf)"
313
	status=$?
314
	test $status -ne 0 && return $status
315
316
	echo "Removing wacom entries from $config."
317
318
	IFS='
319
'
320
	while true; do
321
		# Find a wacom section.
322
		driver="$(get_first "$config" \
323
			"^[[:space:]]*Driver[[:space:]]+\"wacom\"" \
324
		)"
325
326
		# Not a numeric, no more wacom sections left.
327
		test -z "$driver" && break
328
329
		# Find the beginning of the section.
330
		begin="$(get_before "$config" "$driver" \
331
			"^[[:space:]]*Section[[:space:]]+\"InputDevice\"" \
332
		)"
333
334
		if [ -z "$begin" ]; then
335
			echo "Beginning of wacom driver section" \
336
				"could not be found!" 1>&2
337
			return 1
338
		fi
339
340
		# Find the end of the section.
341
		end="$(get_behind "$config" "$driver" \
342
			"^[[:space:]]*EndSection" \
343
		)"
344
345
		if [ -z "$end" ]; then
346
			echo "The Wacom driver section is" \
347
				"not closed properly." 1>&2
348
			return 2
349
		fi
350
351
		# Determine the length of the configuration file.
352
		length="$(/usr/bin/wc -l "$config")"
353
		length=${length% *}
354
355
		# Adjust the end by trailing newlines.
356
		while [ $end -lt $length -a \
357
			-z "$(/usr/bin/tail -n$(($length - $end)) "$config" \
358
			| /usr/bin/head -n1)" ]; do
359
			end=$(($end + 1))
360
		done
361
362
		# Remove the section.
363
		/bin/cp "$config" "$config.$$"
364
365
		/usr/bin/head -n$(($begin - 1)) "$config.$$" > "$config"
366
		/usr/bin/tail -n$(($length - $end)) "$config.$$" >> "$config"
367
	
368
		/bin/rm "$config.$$"
369
	done
370
	IFS='	 
371
'
372
373
	echo "Cleaning up ServerLayout section."
374
375
	for ident in $(eval "echo \${${name}_types}"); {
376
		while true; do
377
		driver="$(get_first "$config" \
378
			"[[:space:]]*InputDevice[[:space:]]+\"$ident\"" \
379
		)"
380
381
		# There is no line matching this driver.
382
		test -z "$driver" && break 
383
384
		# Determine the length of the configuration file.
385
		length="$(/usr/bin/wc -l "$config")"
386
		length=${length% *}
387
388
		# Remove the section.
389
		/bin/cp "$config" "$config.$$"
390
391
		/usr/bin/head -n$(($driver - 1)) "$config.$$" > "$config"
392
		/usr/bin/tail -n$(($length - $driver)) "$config.$$" >> "$config"
393
	
394
		/bin/rm "$config.$$"
395
		done
396
	}
397
398
	if [ "$(eval "echo \${${name}_porttype}")" = "usb" ]; then
399
		if /usr/bin/grep -qx 'uwacom_load="YES"' \
400
			/boot/loader.conf; then
401
			echo "Cleaning up /boot/loader.conf"
402
			/bin/cp /boot/loader.conf /boot/loader.conf.orig
403
			/usr/bin/grep -xv 'uwacom_load="YES"' \
404
				/boot/loader.conf.orig > /boot/loader.conf
405
		fi
406
	fi
407
408
}
409
410
do_start() {
411
	if /sbin/kldstat | /usr/bin/grep -q uwacom; then
412
		return 0
413
	fi
414
	echo "Starting ${name}."
415
	/sbin/kldload %%KMODDIR%%/uwacom.ko
416
}
417
418
do_stop() {
419
	if ! /sbin/kldstat | /usr/bin/grep -q uwacom; then
420
		echo "${name} is not running."
421
		return 0
422
	fi
423
	echo "Stopping ${name}."
424
	/sbin/kldunload %%KMODDIR%%/uwacom.ko
425
}
426
427
load_rc_config $name
428
429
eval ": \${${name}_enable=\"NO\"}"
430
eval ": \${${name}_types=\"stylus eraser cursor pad touch\"}"
431
eval ": \${${name}_porttype=\"%%PORTTYPE%%\"}"
432
433
run_rc_command "$1"
(-)x11-drivers/xf86-input-wacom/pkg-descr (-12 / +2 lines)
Lines 1-14 Link Here
1
This package contains the X.Org linuxwacom driver, a Wacom kernel module
1
An X.Org driver for Wacom tablets. It communicates with a character
2
and a script to configure Xorg.
2
device provided by linux kernel driver in webcamd.
3
3
4
The kernel module is provided by Bartosz Fabianowski <freebsd@chillt.de> and
5
supports the following devices:
6
	Graphire*, Graphire2*, Graphire3, Graphire4
7
	Bamboo, Bamboo One*, Bamboo Fun
8
	Intuos3, Cintiq 21UX
9
	Volito*, Volito2*
10
	PenStation2*, PenPartner2*
11
12
* not tested
13
14
WWW: http://linuxwacom.sourceforge.net/
4
WWW: http://linuxwacom.sourceforge.net/
(-)x11-drivers/xf86-input-wacom/pkg-plist (-4 / +13 lines)
Lines 1-5 Link Here
1
bin/xsetwacom
1
bin/xsetwacom
2
%%XINPUTMODDIR%%/wacom_drv.so
2
etc/X11/xorg.conf.d/wacom.conf.sample
3
@dirrmtry %%XINPUTMODDIR%%
3
include/xorg/Xwacom.h
4
@cwd %%KMODDIR%%
4
include/xorg/wacom-properties.h
5
%%UWACOMKLD%%
5
include/xorg/wacom-util.h
6
lib/xorg/modules/input/wacom_drv.la
7
lib/xorg/modules/input/wacom_drv.so
8
libdata/pkgconfig/xorg-wacom.pc
9
@dirrmtry lib/xorg/modules/input
10
@dirrmtry lib/xorg/modules
11
@dirrmtry lib/xorg
12
@dirrmtry include/xorg
13
@dirrmtry etc/X11/xorg.conf.d
14
@dirrmtry etc/X11
(-)x11-drivers/xorg-drivers/Makefile (-1 / +2 lines)
Lines 26-32 INPUT_DRIVERS= mouse \ Link Here
26
			penmount \
26
			penmount \
27
			synaptics \
27
			synaptics \
28
			vmmouse \
28
			vmmouse \
29
			void
29
			void \
30
			wacom
30
31
31
VIDEO_DRIVERS=		ati \
32
VIDEO_DRIVERS=		ati \
32
			mach64 \
33
			mach64 \

Return to bug 175876