aboutsummaryrefslogtreecommitdiff
path: root/x11-drivers/xf86-input-wacom
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2014-06-11 06:44:41 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2014-06-11 06:44:41 +0000
commitb7ac854ab42e52d83a983a513f3a736aba2dd017 (patch)
treedb18e9d7d666786371e04dfc334fdaab047db100 /x11-drivers/xf86-input-wacom
parent1920884475f735cb39bda160a8a6b3590d39bc4e (diff)
downloadports-b7ac854ab42e52d83a983a513f3a736aba2dd017.tar.gz
ports-b7ac854ab42e52d83a983a513f3a736aba2dd017.zip
Notes
Diffstat (limited to 'x11-drivers/xf86-input-wacom')
-rw-r--r--x11-drivers/xf86-input-wacom/Makefile38
-rw-r--r--x11-drivers/xf86-input-wacom/distinfo2
-rw-r--r--x11-drivers/xf86-input-wacom/files/patch-src-wcmConfig.c19
-rw-r--r--x11-drivers/xf86-input-wacom/files/patch-src-wcmISDV4.c83
-rw-r--r--x11-drivers/xf86-input-wacom/files/patch-src-wcmUSB.c20
-rw-r--r--x11-drivers/xf86-input-wacom/files/patch-src-xf86WacomDefs.h12
-rw-r--r--x11-drivers/xf86-input-wacom/files/patch-tools-isdv4-serial-debugger.c10
-rw-r--r--x11-drivers/xf86-input-wacom/files/patch-tools-isdv4-serial-inputattach.c71
-rw-r--r--x11-drivers/xf86-input-wacom/files/patch-tools-tools-shared.c34
-rw-r--r--x11-drivers/xf86-input-wacom/files/pkg-message.in13
-rw-r--r--x11-drivers/xf86-input-wacom/files/wacom.conf.sample33
-rw-r--r--x11-drivers/xf86-input-wacom/pkg-descr4
-rw-r--r--x11-drivers/xf86-input-wacom/pkg-plist19
13 files changed, 358 insertions, 0 deletions
diff --git a/x11-drivers/xf86-input-wacom/Makefile b/x11-drivers/xf86-input-wacom/Makefile
new file mode 100644
index 000000000000..21ce54118e8a
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/Makefile
@@ -0,0 +1,38 @@
+# $FreeBSD$
+
+PORTNAME= xf86-input-wacom
+PORTVERSION= 0.24.99.1
+CATEGORIES= x11-drivers
+MASTER_SITES= SF/linuxwacom/${PORTNAME}
+
+MAINTAINER= jbeich@vfemail.net
+COMMENT= X.Org Wacom tablet driver
+
+BUILD_DEPENDS= v4l_compat>=1.0.20110603:${PORTSDIR}/multimedia/v4l_compat
+RUN_DEPENDS= webcamd>0:${PORTSDIR}/multimedia/webcamd
+
+USES= tar:bzip2 pathfix pkgconfig libtool
+USE_XORG= xrandr xinerama
+XORG_CAT= driver
+SUB_FILES= pkg-message
+CONFIGURE_ARGS= --without-systemd-unit-dir \
+ --without-udev-rules-dir \
+ --without-doxygen
+
+post-patch:
+ @${REINPLACE_CMD} -e 's/as_fn_error.*udev/${TRUE} &/' \
+ -e 's/dir=.*xorg-server/& \
+ --define-variable prefix="$$prefix"/' \
+ ${WRKSRC}/configure
+
+# XXX adjust MatchProduct to whatever Xorg/devd reports
+ @${REINPLACE_CMD} -e '/^SUBDIRS/s/ conf//' \
+ ${WRKSRC}/Makefile.in
+
+post-install:
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/xorg/modules/input/wacom_drv.so
+ ${MKDIR} ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d
+ ${INSTALL_DATA} ${FILESDIR}/wacom.conf.sample \
+ ${STAGEDIR}${PREFIX}/etc/X11/xorg.conf.d
+
+.include <bsd.port.mk>
diff --git a/x11-drivers/xf86-input-wacom/distinfo b/x11-drivers/xf86-input-wacom/distinfo
new file mode 100644
index 000000000000..008040a4629d
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/distinfo
@@ -0,0 +1,2 @@
+SHA256 (xorg/driver/xf86-input-wacom-0.24.99.1.tar.bz2) = 4b68b1570bd6ce085010980fa1842825e5d676cd2962ec6ad2d7d5bc52149983
+SIZE (xorg/driver/xf86-input-wacom-0.24.99.1.tar.bz2) = 586002
diff --git a/x11-drivers/xf86-input-wacom/files/patch-src-wcmConfig.c b/x11-drivers/xf86-input-wacom/files/patch-src-wcmConfig.c
new file mode 100644
index 000000000000..76f05c9506c1
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/files/patch-src-wcmConfig.c
@@ -0,0 +1,19 @@
+--- src/wcmConfig.c~
++++ src/wcmConfig.c
+@@ -307,7 +307,7 @@ out:
+ */
+ static void wcmSplitName(char* devicename, char *basename, char *subdevice, char *tool, size_t len)
+ {
+- char *name = strdupa(devicename);
++ char *name = strdup(devicename);
+ char *a, *b;
+
+ *basename = *subdevice = *tool = '\0';
+@@ -325,6 +325,7 @@ static void wcmSplitName(char* devicenam
+ strncat(tool, a+1, len-1);
+ }
+ strncat(basename, name, len-1);
++ free(name);
+ }
+
+ /**
diff --git a/x11-drivers/xf86-input-wacom/files/patch-src-wcmISDV4.c b/x11-drivers/xf86-input-wacom/files/patch-src-wcmISDV4.c
new file mode 100644
index 000000000000..85c3dd206146
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/files/patch-src-wcmISDV4.c
@@ -0,0 +1,83 @@
+--- src/wcmISDV4.c~
++++ src/wcmISDV4.c
+@@ -24,11 +24,16 @@
+ #include "xf86Wacom.h"
+ #include <xf86_OSproc.h>
+ #include "wcmFilter.h"
+-#include <linux/serial.h>
+ #include "isdv4.h"
+ #include <unistd.h>
+ #include <fcntl.h>
++
++#ifdef __linux__
++#include <linux/serial.h>
+ #include <libudev.h>
++#else
++#include <termios.h>
++#endif
+
+ #define RESET_RELATIVE(ds) do { (ds).relwheel = 0; } while (0)
+
+@@ -192,10 +197,15 @@ static int wcmSerialValidate(InputInfoPt
+
+ static Bool isdv4Detect(InputInfoPtr pInfo)
+ {
+- struct serial_struct ser;
+ int rc;
+
++#ifdef __linux__
++ struct serial_struct ser;
+ rc = ioctl(pInfo->fd, TIOCGSERIAL, &ser);
++#else
++ struct termios termAttr;
++ rc = tcgetattr(pInfo->fd, &termAttr);
++#endif
+ if (rc == -1)
+ return FALSE;
+
+@@ -959,6 +969,7 @@ static Bool get_keys_vendor_tablet_id(ch
+ return TRUE;
+ }
+
++#ifdef __linux__
+ /**
+ * Return the content of id file from sysfs: /sys/.../device/id
+ *
+@@ -1004,6 +1015,7 @@ out:
+
+ return ret;
+ }
++#endif
+
+ /**
+ * Query the device's fd for the key bits and the tablet ID. Returns the ID
+@@ -1018,11 +1030,16 @@ out:
+ */
+ static int isdv4ProbeKeys(InputInfoPtr pInfo)
+ {
+- struct serial_struct tmp;
+ WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
+ WacomCommonPtr common = priv->common;
+
++#ifdef __linux__
++ struct serial_struct tmp;
+ if (ioctl(pInfo->fd, TIOCGSERIAL, &tmp) < 0)
++#else
++ struct termios tmp;
++ if (tcgetattr(pInfo->fd, &tmp) < 0)
++#endif
+ return 0;
+
+ common->tablet_id = 0x90;
+@@ -1037,9 +1054,11 @@ static int isdv4ProbeKeys(InputInfoPtr p
+ common->wcmProtocolLevel = WCM_PROTOCOL_GENERIC;
+
+ if (!get_keys_vendor_tablet_id(pInfo->name, common)) {
++#ifdef __linux__
+ char buf[15] = {0};
+ if (get_sysfs_id(pInfo, buf, sizeof(buf)))
+ get_keys_vendor_tablet_id(buf, common);
++#endif
+ }
+
+ return common->tablet_id;
diff --git a/x11-drivers/xf86-input-wacom/files/patch-src-wcmUSB.c b/x11-drivers/xf86-input-wacom/files/patch-src-wcmUSB.c
new file mode 100644
index 000000000000..562764977260
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/files/patch-src-wcmUSB.c
@@ -0,0 +1,20 @@
+--- src/wcmUSB.c~
++++ src/wcmUSB.c
+@@ -23,10 +23,17 @@
+
+ #include "xf86Wacom.h"
+
++#ifdef __linux__
+ #include <asm/types.h>
++#endif
+ #include <linux/input.h>
+ #include <sys/utsname.h>
++#ifdef __linux__
+ #include <linux/version.h>
++#else
++#define LINUX_VERSION_CODE 1
++#define KERNEL_VERSION(a,b,c) 0
++#endif
+
+ #define MAX_USB_EVENTS 32
+
diff --git a/x11-drivers/xf86-input-wacom/files/patch-src-xf86WacomDefs.h b/x11-drivers/xf86-input-wacom/files/patch-src-xf86WacomDefs.h
new file mode 100644
index 000000000000..ddef2cf9ca88
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/files/patch-src-xf86WacomDefs.h
@@ -0,0 +1,12 @@
+--- src/xf86WacomDefs.h~
++++ src/xf86WacomDefs.h
+@@ -24,7 +24,9 @@
+ * General Defines
+ ****************************************************************************/
+ #include <wacom-util.h>
++#ifdef __linux__
+ #include <asm/types.h>
++#endif
+ #include <linux/input.h>
+ #define MAX_USB_EVENTS 32
+
diff --git a/x11-drivers/xf86-input-wacom/files/patch-tools-isdv4-serial-debugger.c b/x11-drivers/xf86-input-wacom/files/patch-tools-isdv4-serial-debugger.c
new file mode 100644
index 000000000000..67924d646360
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/files/patch-tools-isdv4-serial-debugger.c
@@ -0,0 +1,10 @@
+--- tools/isdv4-serial-debugger.c~
++++ tools/isdv4-serial-debugger.c
+@@ -25,7 +25,6 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
+-#include <linux/serial.h>
+ #include <getopt.h>
+ #include <poll.h>
+ #include <stdio.h>
diff --git a/x11-drivers/xf86-input-wacom/files/patch-tools-isdv4-serial-inputattach.c b/x11-drivers/xf86-input-wacom/files/patch-tools-isdv4-serial-inputattach.c
new file mode 100644
index 000000000000..4e0deaefe6c3
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/files/patch-tools-isdv4-serial-inputattach.c
@@ -0,0 +1,71 @@
+--- tools/isdv4-serial-inputattach.c~
++++ tools/isdv4-serial-inputattach.c
+@@ -23,8 +23,10 @@
+ #include "config.h"
+ #endif
+
++#ifdef __linux__
+ #include <linux/serio.h>
+ #include <libudev.h>
++#endif
+
+ #include <getopt.h>
+ #include <stdio.h>
+@@ -49,7 +52,11 @@ static void usage(void)
+ "--verbose - verbose output\n"
+ "--version - version info\n"
+ "--baudrate <19200|38400> - set baudrate\n",
++#ifdef __GLIBC__
+ program_invocation_short_name
++#else
++ getprogname()
++#endif
+ );
+ }
+
+@@ -64,6 +71,7 @@ static int set_line_discipline(int fd, i
+ return rc;
+ }
+
++#ifdef __linux
+ static int bind_kernel_driver(int fd)
+ {
+ unsigned long devt;
+@@ -77,9 +85,11 @@ static int bind_kernel_driver(int fd)
+
+ return 0;
+ }
++#endif
+
+ int get_baud_rate(int fd)
+ {
++#ifdef __linux__
+ struct stat st;
+ int baudrate = 19200;
+ int id;
+@@ -112,6 +122,9 @@ int get_baud_rate(int fd)
+ udev_unref(udev);
+
+ return baudrate;
++#else
++ return 19200;
++#endif
+ }
+
+ void sighandler(int signum)
+@@ -194,6 +207,7 @@ int main(int argc, char **argv)
+ return 1;
+ }
+
++#ifdef __linux__
+ /* some of the 19200 tablets can't set the line discipline */
+ set_line_discipline(fd, N_MOUSE);
+
+@@ -201,6 +215,7 @@ int main(int argc, char **argv)
+ fprintf(stderr, "Failed to bind the kernel driver.\n");
+ goto out;
+ }
++#endif
+
+ signal(SIGINT, sighandler);
+ signal(SIGHUP, sighandler);
diff --git a/x11-drivers/xf86-input-wacom/files/patch-tools-tools-shared.c b/x11-drivers/xf86-input-wacom/files/patch-tools-tools-shared.c
new file mode 100644
index 000000000000..0be5b371c9a5
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/files/patch-tools-tools-shared.c
@@ -0,0 +1,34 @@
+--- tools/tools-shared.c~
++++ tools/tools-shared.c
+@@ -23,7 +23,9 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
++#ifdef __linux__
+ #include <linux/serial.h>
++#endif
+ #include <getopt.h>
+ #include <poll.h>
+ #include <stdio.h>
+@@ -51,7 +53,6 @@ void version(void)
+ int open_device(const char *path)
+ {
+ int fd;
+- struct serial_struct ser;
+
+ TRACE("Opening device '%s'.\n", path);
+ fd = open(path, O_RDWR | O_NOCTTY);
+@@ -59,7 +60,13 @@ int open_device(const char *path)
+ if (fd < 1)
+ perror("Failed to open device file");
+
++#ifdef __linux__
++ struct serial_struct ser;
+ if (ioctl(fd, TIOCGSERIAL, &ser) == -1)
++#else
++ struct termios termAttr;
++ if (tcgetattr(fd, &termAttr) == -1)
++#endif
+ {
+ perror("Not a serial device?");
+ close(fd);
diff --git a/x11-drivers/xf86-input-wacom/files/pkg-message.in b/x11-drivers/xf86-input-wacom/files/pkg-message.in
new file mode 100644
index 000000000000..248e28d8ef17
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/files/pkg-message.in
@@ -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"
diff --git a/x11-drivers/xf86-input-wacom/files/wacom.conf.sample b/x11-drivers/xf86-input-wacom/files/wacom.conf.sample
new file mode 100644
index 000000000000..fa247118d492
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/files/wacom.conf.sample
@@ -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
diff --git a/x11-drivers/xf86-input-wacom/pkg-descr b/x11-drivers/xf86-input-wacom/pkg-descr
new file mode 100644
index 000000000000..b5ba31fda32c
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/pkg-descr
@@ -0,0 +1,4 @@
+An X.Org driver for Wacom tablets. It communicates with a character
+device provided by linux kernel driver in webcamd.
+
+WWW: http://linuxwacom.sourceforge.net/
diff --git a/x11-drivers/xf86-input-wacom/pkg-plist b/x11-drivers/xf86-input-wacom/pkg-plist
new file mode 100644
index 000000000000..2d527bea30f9
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/pkg-plist
@@ -0,0 +1,19 @@
+bin/isdv4-serial-debugger
+bin/isdv4-serial-inputattach
+bin/xsetwacom
+@comment not marked @sample due to conflict with HAL
+etc/X11/xorg.conf.d/wacom.conf.sample
+include/xorg/Xwacom.h
+include/xorg/isdv4.h
+include/xorg/wacom-properties.h
+include/xorg/wacom-util.h
+lib/xorg/modules/input/wacom_drv.so
+libdata/pkgconfig/xorg-wacom.pc
+man/man1/xsetwacom.1.gz
+man/man4/wacom.4x.gz
+@dirrmtry lib/xorg/modules/input
+@dirrmtry lib/xorg/modules
+@dirrmtry lib/xorg
+@dirrmtry include/xorg
+@dirrmtry etc/X11/xorg.conf.d
+@dirrmtry etc/X11