Date: Mon, 23 Jan 2017 22:32:10 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r432298 - in head/x11-drivers/xf86-input-hyperpen: . files Message-ID: <201701232232.v0NMWAad061236@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Mon Jan 23 22:32:10 2017 New Revision: 432298 URL: https://svnweb.freebsd.org/changeset/ports/432298 Log: Import few patches from upstream to allow building with newer xorg Note that those drivers are barely maintained and might disappear in the futur PR: 216273 Submitted by: matthew@reztek.cz Added: head/x11-drivers/xf86-input-hyperpen/files/ head/x11-drivers/xf86-input-hyperpen/files/patch-git_01_161f414 (contents, props changed) head/x11-drivers/xf86-input-hyperpen/files/patch-git_02_b2ef09f (contents, props changed) head/x11-drivers/xf86-input-hyperpen/files/patch-git_03_02a74cf (contents, props changed) head/x11-drivers/xf86-input-hyperpen/files/patch-git_04_6d660b0 (contents, props changed) head/x11-drivers/xf86-input-hyperpen/files/patch-git_06_2c03719 (contents, props changed) head/x11-drivers/xf86-input-hyperpen/files/patch-src_xf86HyperPen.c (contents, props changed) Modified: head/x11-drivers/xf86-input-hyperpen/Makefile Modified: head/x11-drivers/xf86-input-hyperpen/Makefile ============================================================================== --- head/x11-drivers/xf86-input-hyperpen/Makefile Mon Jan 23 22:27:49 2017 (r432297) +++ head/x11-drivers/xf86-input-hyperpen/Makefile Mon Jan 23 22:32:10 2017 (r432298) @@ -2,7 +2,7 @@ PORTNAME= xf86-input-hyperpen PORTVERSION= 1.4.1 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= x11-drivers MAINTAINER= x11@FreeBSD.org Added: head/x11-drivers/xf86-input-hyperpen/files/patch-git_01_161f414 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-hyperpen/files/patch-git_01_161f414 Mon Jan 23 22:32:10 2017 (r432298) @@ -0,0 +1,27 @@ +From 161f41449bef339ce5bd1a3e87f6beac584c2074 Mon Sep 17 00:00:00 2001 +From: Terry Lambert <tlambert@chromium.org> +Date: Fri, 15 Jul 2011 17:23:21 -0700 +Subject: xf86-input-hyperpen: Return proper default for unknown values in + pInfo->device_control. + +Signed-off-by: Terry Lambert <tlambert@chromium.org> +Reviewed-by: Stephane Marchesin <marcheu@chromium.org> +Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +diff --git a/src/xf86HyperPen.c b/src/xf86HyperPen.c +index 45ddfca..b0e5ac9 100644 +--- src/xf86HyperPen.c ++++ src/xf86HyperPen.c +@@ -729,8 +729,7 @@ xf86HypProc(DeviceIntPtr pHyp, int what) + + default: + ErrorF("unsupported mode=%d\n", what); +- return !Success; +- break; ++ return BadValue; + } + DBG(2, ErrorF("END xf86HypProc Success what=%d dev=%p priv=%p\n", + what, (void *)pHyp, (void *)priv)); +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-hyperpen/files/patch-git_02_b2ef09f ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-hyperpen/files/patch-git_02_b2ef09f Mon Jan 23 22:32:10 2017 (r432298) @@ -0,0 +1,33 @@ +From b2ef09f6c4034dec03898df7f8024fc58794b055 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue, 19 Jul 2011 12:40:19 +1000 +Subject: Don't free anything in PreInit, let UnInit take care of it. + +The server calls UnInit, avoid double free's by letting the server free +everything. + +Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +diff --git a/src/xf86HyperPen.c b/src/xf86HyperPen.c +index b0e5ac9..52a6e4f 100644 +--- src/xf86HyperPen.c ++++ src/xf86HyperPen.c +@@ -973,14 +973,9 @@ xf86HypInit(InputDriverPtr drv, + } + } + +- return rc; +- + SetupProc_fail: +- if (priv) +- free(priv); +- if (pInfo) +- free(pInfo); + return rc; ++ + } + + _X_EXPORT InputDriverRec HYPERPEN = { +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-hyperpen/files/patch-git_03_02a74cf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-hyperpen/files/patch-git_03_02a74cf Mon Jan 23 22:32:10 2017 (r432298) @@ -0,0 +1,25 @@ +From 02a74cfd0ba5ac0190307a63189ac643644b7574 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue, 19 Jul 2011 12:41:24 +1000 +Subject: Use xf86SetStrOption for Option Device + +Let the device be printed in the logs + +Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +diff --git a/src/xf86HyperPen.c b/src/xf86HyperPen.c +index 52a6e4f..320add5 100644 +--- src/xf86HyperPen.c ++++ src/xf86HyperPen.c +@@ -827,7 +827,7 @@ xf86HypInit(InputDriverPtr drv, + } + + /* Serial Device is mandatory */ +- priv->hypDevice = xf86FindOptionValue(pInfo->options, "Device"); ++ priv->hypDevice = xf86SetStrOption(pInfo->options, "Device", NULL); + + if (!priv->hypDevice) { + xf86Msg (X_ERROR, "%s: No Device specified.\n", pInfo->name); +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-hyperpen/files/patch-git_04_6d660b0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-hyperpen/files/patch-git_04_6d660b0 Mon Jan 23 22:32:10 2017 (r432298) @@ -0,0 +1,29 @@ +From 6d660b0439973d2ee0c550e3413d75bd57763243 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer <peter.hutterer@who-t.net> +Date: Tue, 19 Jul 2011 12:42:43 +1000 +Subject: Test device in PreInit, fail if it cannot be opened. + +Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> + +diff --git a/src/xf86HyperPen.c b/src/xf86HyperPen.c +index 320add5..8b9011e 100644 +--- src/xf86HyperPen.c ++++ src/xf86HyperPen.c +@@ -833,6 +833,14 @@ xf86HypInit(InputDriverPtr drv, + xf86Msg (X_ERROR, "%s: No Device specified.\n", pInfo->name); + rc = BadMatch; + goto SetupProc_fail; ++ } else { ++ pInfo->fd = xf86OpenSerial(pInfo->options); ++ if (pInfo->fd == -1) { ++ xf86Msg (X_ERROR, "%s: cannot open device '%s'\n", pInfo->name, priv->hypDevice); ++ return BadValue; ++ } ++ xf86CloseSerial(pInfo->fd); ++ pInfo->fd = -1; + } + + pInfo->private = priv; +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-hyperpen/files/patch-git_06_2c03719 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-hyperpen/files/patch-git_06_2c03719 Mon Jan 23 22:32:10 2017 (r432298) @@ -0,0 +1,21 @@ +From 2c037196bcc50cb299bc768124404b38cb67c087 Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb <matthieu.herrb@laas.fr> +Date: Sun, 20 May 2012 10:59:09 +0200 +Subject: src/Makefile.am: set AM_CFLAGS correctly. + + +diff --git a/src/Makefile.am b/src/Makefile.am +index dbb7ae0..e7fae3f 100644 +--- src/Makefile.am ++++ src/Makefile.am +@@ -24,6 +24,7 @@ + # -avoid-version prevents gratuitous .0.0.0 version numbers on the end + # _ladir passes a dummy rpath to libtool so the thing will actually link + # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. ++AM_CFLAGS = $(XORG_CFLAGS) + @DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la + @DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version + @DRIVER_NAME@_drv_ladir = @inputdir@ +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-hyperpen/files/patch-src_xf86HyperPen.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-hyperpen/files/patch-src_xf86HyperPen.c Mon Jan 23 22:32:10 2017 (r432298) @@ -0,0 +1,85 @@ +# Finish converting use of Error to ErrorF +# Correct a couple strings that should be const +# +--- src/xf86HyperPen.c.orig 2011-07-05 01:34:17 UTC ++++ src/xf86HyperPen.c +@@ -66,7 +66,7 @@ + * read a full packet before returning + */ + +-static char *default_options[] = { ++static const char *default_options[] = { + "BaudRate", "9600", + "DataBits", "8", + "StopBits", "1", +@@ -212,7 +212,7 @@ xf86HypReadInput(InputInfoPtr pInfo) + SYSCALL(len = read(pInfo->fd, buffer, sizeof(buffer))); + + if (len <= 0) { +- Error("error reading HyperPen device"); ++ ErrorF("error reading HyperPen device\n"); + return; + } + +@@ -372,14 +372,14 @@ xf86HypWriteAndRead(int fd, char *data, + + SYSCALL(err = write(fd, data, strlen(data))); + if (err == -1) { +- Error("HyperPen write"); ++ ErrorF("HyperPen write\n"); + return NULL; + } + + while (numread < len) { + err = xf86WaitForInput(fd, 100000); + if (err == -1) { +- Error("HyperPen select"); ++ ErrorF("HyperPen select\n"); + return NULL; + } + if (!err) { +@@ -389,7 +389,7 @@ xf86HypWriteAndRead(int fd, char *data, + + SYSCALL(err = read(fd, buffer + numread++, 1)); + if (err == -1) { +- Error("HyperPen read"); ++ ErrorF("HyperPen read\n"); + return NULL; + } + if (!err) { +@@ -431,7 +431,7 @@ xf86HypOpen(InputInfoPtr pInfo) + + pInfo->fd = xf86OpenSerial(pInfo->options); + if (pInfo->fd == -1) { +- Error(priv->hypDevice); ++ ErrorF("failed to open %s\n", priv->hypDevice); + return !Success; + } + DBG(2, ErrorF("%s opened as fd %d\n", priv->hypDevice, pInfo->fd)); +@@ -449,7 +449,7 @@ xf86HypOpen(InputInfoPtr pInfo) + /* Put it in prompt mode so it doesn't say anything before we're ready */ + SYSCALL(err = write(pInfo->fd, SS_PROMPT_MODE, strlen(SS_PROMPT_MODE))); + if (err == -1) { +- Error("HyperPen write"); ++ ErrorF("HyperPen write\n"); + return !Success; + } + /* Clear any pending input */ +@@ -578,7 +578,7 @@ xf86HypOpen(InputInfoPtr pInfo) + SYSCALL(err = write(pInfo->fd, buffer, idx)); + + if (err == -1) { +- Error("HyperPen write"); ++ ErrorF("HyperPen write\n"); + return !Success; + } + +@@ -819,7 +819,7 @@ xf86HypInit(InputDriverPtr drv, + int flags) + { + HyperPenDevicePtr priv = malloc(sizeof(HyperPenDeviceRec)); +- char *s; ++ const char *s; + int rc = Success; + + if (!priv) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701232232.v0NMWAad061236>