View | Details | Raw Unified | Return to bug 222905 | Differences between
and this patch

Collapse All | Expand All

(-)w/x11/libinput/Makefile (-13 / +28 lines)
Lines 1-31 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	libinput
3
PORTNAME=	libinput
4
PORTVERSION=	1.6.0
4
PORTVERSION=	1.12.1
5
PORTREVISION=	1
6
CATEGORIES=	x11
5
CATEGORIES=	x11
7
MASTER_SITES=	http://freedesktop.org/software/${PORTNAME}/
6
MASTER_SITES=	http://freedesktop.org/software/${PORTNAME}/
8
7
9
MAINTAINER=	x11@FreeBSD.org
8
MAINTAINER=	x11@FreeBSD.org
10
COMMENT=	Generic input library
9
COMMENT=	Generic input library
11
10
12
BUILD_DEPENDS=	v4l_compat>=0:multimedia/v4l_compat
11
LICENSE=	MIT
12
LICENSE_FILE=	${WRKSRC}/COPYING
13
14
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}evdev>0:devel/py-evdev@${PY_FLAVOR} \
15
		${PYTHON_PKGNAMEPREFIX}pyudev>0:devel/py-pyudev@${PY_FLAVOR}
13
LIB_DEPENDS=	libevdev.so:devel/libevdev \
16
LIB_DEPENDS=	libevdev.so:devel/libevdev \
14
		libepoll-shim.so:devel/libepoll-shim \
17
		libepoll-shim.so:devel/libepoll-shim \
15
		libwacom.so:x11/libwacom \
16
		libudev.so:devel/libudev-devd \
18
		libudev.so:devel/libudev-devd \
17
		libmtdev.so:devel/libmtdev
19
		libmtdev.so:devel/libmtdev
18
20
19
USES=		autoreconf gmake libtool pathfix pkgconfig tar:xz
21
OPTIONS_DEFINE=	DEBUG_GUI LIBWACOM
20
USE_LDCONFIG=	yes
22
OPTIONS_DEFAULT=LIBWACOM
21
GNU_CONFIGURE=	yes
23
OPTIONS_SUB=	yes
22
24
23
CPPFLAGS+=	-I${LOCALBASE}/include/libepoll-shim
25
DEBUG_GUI_DESC=	Build the GUI event viewer
24
INSTALL_TARGET=	install-strip
26
LIBWACOM_DESC=	Libwacom support
25
27
26
post-patch:
28
DEBUG_GUI_USES=		gnome
27
	${REINPLACE_CMD} -e 's|program_invocation_short_name|getprogname()|' \
29
DEBUG_GUI_USE=		GNOME=gtk30,glib20,cairo
28
	    ${WRKSRC}/tools/libinput-list-devices.c \
30
DEBUG_GUI_MESON_TRUE=	debug-gui
29
	    ${WRKSRC}/tools/ptraccel-debug.c ${WRKSRC}/tools/shared.c
31
LIBWACOM_LIB_DEPENDS=	libwacom.so:x11/libwacom
32
LIBWACOM_MESON_TRUE=	libwacom
33
34
USES=			localbase meson pkgconfig python:3.4+,run shebangfix tar:xz
35
USE_LDCONFIG=		yes
36
37
MESON_ARGS+=	-Ddocumentation=false -Dtests=false
38
39
python_OLD_CMD=	"/usr/bin/env python3"
40
SHEBANG_FILES=	tools/libinput-measure-fuzz.py \
41
		tools/libinput-measure-touch-size.py \
42
		tools/libinput-measure-touchpad-pressure.py \
43
		tools/libinput-measure-touchpad-tap.py \
44
		tools/libinput-replay
30
45
31
.include <bsd.port.mk>
46
.include <bsd.port.mk>
(-)w/x11/libinput/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1486789508
1
TIMESTAMP = 1539515768
2
SHA256 (libinput-1.6.0.tar.xz) = b7534f518d735c643aedca2fb4694683dfddc8d0600cfb628c87a18e65255832
2
SHA256 (libinput-1.12.1.tar.xz) = 570c48cc7b744b9b4da711ed0c5e8c3de132484684b0c4f0309a9a83df5e8692
3
SIZE (libinput-1.6.0.tar.xz) = 927656
3
SIZE (libinput-1.12.1.tar.xz) = 520072
(-)c/x11/libinput/files/patch-Makefile.am (-8 lines)
Removed Link Here
1
--- Makefile.am.orig	2017-02-11 05:10:33 UTC
2
+++ Makefile.am
3
@@ -1,4 +1,4 @@
4
-SUBDIRS = src doc test tools udev
5
+SUBDIRS = src doc tools udev
6
 
7
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
8
 
(-)c/x11/libinput/files/patch-include_linux_input.h (-38 lines)
Removed Link Here
1
--- include/linux/input.h.orig	2016-12-05 05:15:21 UTC
2
+++ include/linux/input.h
3
@@ -11,7 +11,17 @@
4
 #include <sys/time.h>
5
 #include <sys/ioctl.h>
6
 #include <sys/types.h>
7
+#ifdef __FreeBSD__
8
+#define __u8 uint8_t
9
+#define __u16 uint16_t
10
+#define __u32 uint32_t
11
+#define __s16 int16_t
12
+#define __s32 int32_t
13
+#define _IOC_READ IOC_OUT
14
+#define _IOC_WRITE IOC_IN
15
+#else
16
 #include <linux/types.h>
17
+#endif
18
 
19
 /*
20
  * The event structure itself
21
@@ -132,7 +142,7 @@ struct input_keymap_entry {
22
  *
23
  * If the request code is not an ABS_MT value, -EINVAL is returned.
24
  */
25
-#define EVIOCGMTSLOTS(len)	_IOC(_IOC_READ, 'E', 0x0a, len)
26
+#define EVIOCGMTSLOTS(len)	_IOC(IOC_INOUT, 'E', 0x0a, len)
27
 
28
 #define EVIOCGKEY(len)		_IOC(_IOC_READ, 'E', 0x18, len)		/* get global key state */
29
 #define EVIOCGLED(len)		_IOC(_IOC_READ, 'E', 0x19, len)		/* get all LEDs */
30
@@ -147,7 +157,7 @@ struct input_keymap_entry {
31
 #define EVIOCRMFF		_IOW('E', 0x81, int)			/* Erase a force effect */
32
 #define EVIOCGEFFECTS		_IOR('E', 0x84, int)			/* Report number of effects playable at the same time */
33
 
34
-#define EVIOCGRAB		_IOW('E', 0x90, int)			/* Grab/Release device */
35
+#define EVIOCGRAB		_IO('E', 0x90)				/* Grab/Release device */
36
 #define EVIOCREVOKE		_IOW('E', 0x91, int)			/* Revoke device access */
37
 
38
 #define EVIOCSCLOCKID		_IOW('E', 0xa0, int)			/* Set clockid to be used for timestamps */
(-)c/x11/libinput/files/patch-src_Makefile.am (-21 lines)
Removed Link Here
1
--- src/Makefile.am.orig	2017-02-11 05:10:33 UTC
2
+++ src/Makefile.am
3
@@ -38,6 +38,7 @@ libinput_la_LIBADD = $(MTDEV_LIBS) \
4
 		     $(LIBUDEV_LIBS) \
5
 		     $(LIBEVDEV_LIBS) \
6
 		     $(LIBWACOM_LIBS) \
7
+		     -lepoll-shim \
8
 		     libinput-util.la
9
 
10
 libinput_la_CFLAGS = -I$(top_srcdir)/include \
11
@@ -61,8 +62,8 @@ libfilter_la_SOURCES = \
12
 	filter.c \
13
 	filter.h \
14
 	filter-private.h
15
-libfilter_la_LIBADD =
16
-libfilter_la_CFLAGS =
17
+libfilter_la_LIBADD = $(LIBUDEV_LIBS)
18
+libfilter_la_CFLAGS = -I$(top_srcdir)/include $(LIBUDEV_CFLAGS)
19
 
20
 libinput_la_LDFLAGS = -version-info $(LIBINPUT_LT_VERSION) -shared \
21
 		      -Wl,--version-script=$(srcdir)/libinput.sym
(-)w/x11/libinput/files/patch-src_evdev.c (-9 / +18 lines)
Lines 1-11 Link Here
1
--- src/evdev.c.orig	2017-01-19 21:36:55 UTC
1
--- src/evdev.c.orig	2017-11-28 05:13:06 UTC
2
+++ src/evdev.c
2
+++ src/evdev.c
3
@@ -25,6 +25,8 @@
3
@@ -900,6 +900,17 @@ evdev_device_dispatch(void *data)
4
 
4
 
5
 #include "config.h"
5
 	if (rc != -EAGAIN && rc != -EINTR) {
6
 
6
 		libinput_remove_source(libinput, device->source);
7
+#include <sys/stat.h>
7
+		/*
8
+
8
+		 * Dirty hack to allow cuse-based evdev backends to release
9
 #include <errno.h>
9
+		 * character device file when device has been detached
10
 #include <stdbool.h>
10
+		 * but still have it descriptor opened.
11
 #include <stdlib.h>
11
+		 * Issuing evdev_device_suspend() here leads to SIGSEGV
12
+		 */
13
+		int dummy_fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
14
+		if (dummy_fd >= 0) {
15
+			dup2(dummy_fd, device->fd);
16
+			close(dummy_fd);
17
+		}
18
 		device->source = NULL;
19
 	}
20
 }
(-)w/x11/libinput/files/patch-src_evdev.c.fixdrop (+11 lines)
Added Link Here
1
--- src/evdev.c.orig	2018-01-09 14:24:49.267512000 +0100
2
+++ src/evdev.c	2018-01-09 15:30:29.793735000 +0100
3
@@ -1856,7 +1856,7 @@
4
 		evdev_device_dispatch_one(device, &ev);
5
 	} while (rc == LIBEVDEV_READ_STATUS_SYNC);
6
 
7
-	return rc == -EAGAIN ? 0 : rc;
8
+	return (rc == -EAGAIN || rc == -EINVAL)? 0 : rc;
9
 }
10
 
11
 static void
(-)w/x11/libinput/files/patch-src_evdev.c.reopen (+60 lines)
Added Link Here
1
When a process without full /dev/input access enumerates devices via libudev-devd,
2
the udev_device structs do not get udev properties that mark them as inputs, keyboards, etc,
3
and get rejected as not being input devices.
4
5
libinput reopens devices just to check path equality.
6
The udev_devices from reopening do have the right properties,
7
so we just use them instead of the original (enumerated) ones.
8
9
--- src/evdev.c.orig	2018-01-22 17:01:09.674204000 +0300
10
+++ src/evdev.c	2018-01-22 17:01:13.622330000 +0300
11
@@ -1723,9 +1723,9 @@
12
 }
13
 
14
 static bool
15
-evdev_device_have_same_syspath(struct udev_device *udev_device, int fd)
16
+evdev_device_have_same_syspath(struct udev_device **udev_device, int fd, bool reopen)
17
 {
18
-	struct udev *udev = udev_device_get_udev(udev_device);
19
+	struct udev *udev = udev_device_get_udev(*udev_device);
20
 	struct udev_device *udev_device_new = NULL;
21
 	struct stat st;
22
 	bool rc = false;
23
@@ -1738,10 +1738,16 @@
24
 		goto out;
25
 
26
 	rc = streq(udev_device_get_syspath(udev_device_new),
27
-		   udev_device_get_syspath(udev_device));
28
+		   udev_device_get_syspath(*udev_device));
29
 out:
30
-	if (udev_device_new)
31
-		udev_device_unref(udev_device_new);
32
+	if (udev_device_new) {
33
+		if (reopen) {
34
+			udev_device_unref(*udev_device);
35
+			*udev_device = udev_device_new;
36
+		} else {
37
+			udev_device_unref(udev_device_new);
38
+		}
39
+	}
40
 	return rc;
41
 }
42
 
43
@@ -1920,7 +1926,7 @@
44
 		return NULL;
45
 	}
46
 
47
-	if (!evdev_device_have_same_syspath(udev_device, fd))
48
+	if (!evdev_device_have_same_syspath(&udev_device, fd, true))
49
 		goto err;
50
 
51
 	device = zalloc(sizeof *device);
52
@@ -2424,7 +2430,7 @@
53
 	if (fd < 0)
54
 		return -errno;
55
 
56
-	if (!evdev_device_have_same_syspath(device->udev_device, fd)) {
57
+	if (!evdev_device_have_same_syspath(&device->udev_device, fd, false)) {
58
 		close_restricted(libinput, fd);
59
 		return -ENODEV;
60
 	}
(-)c/x11/libinput/files/patch-src_libinput-private.h (-10 lines)
Removed Link Here
1
--- src/libinput-private.h.orig	2017-01-18 04:32:06 UTC
2
+++ src/libinput-private.h
3
@@ -29,6 +29,7 @@
4
 
5
 #include <errno.h>
6
 #include <math.h>
7
+#include <stdarg.h>
8
 
9
 #include "linux/input.h"
10
 
(-)c/x11/libinput/files/patch-src_libinput-util.c (-12 lines)
Removed Link Here
1
--- src/libinput-util.c.orig	2017-01-17 04:53:51 UTC
2
+++ src/libinput-util.c
3
@@ -36,6 +36,9 @@
4
 #include <stdbool.h>
5
 #include <stdio.h>
6
 #include <stdlib.h>
7
+#ifdef __FreeBSD__
8
+#include <xlocale.h>
9
+#endif
10
 
11
 #include "libinput-util.h"
12
 #include "libinput-private.h"
(-)c/x11/libinput/files/patch-src_libinput.h (-10 lines)
Removed Link Here
1
--- src/libinput.h.orig	2017-01-19 05:27:32 UTC
2
+++ src/libinput.h
3
@@ -29,6 +29,7 @@
4
 extern "C" {
5
 #endif
6
 
7
+#include <stdarg.h>
8
 #include <stdlib.h>
9
 #include <stdint.h>
10
 #include <libudev.h>
(-)c/x11/libinput/files/patch-src_path-seat.c (-15 lines)
Removed Link Here
1
--- src/path-seat.c.orig	2017-01-19 05:27:32 UTC
2
+++ src/path-seat.c
3
@@ -23,10 +23,11 @@
4
 
5
 #include "config.h"
6
 
7
+#include <sys/stat.h>
8
+
9
 #include <errno.h>
10
 #include <fcntl.h>
11
 #include <string.h>
12
-#include <sys/stat.h>
13
 #include <libudev.h>
14
 
15
 #include "path-seat.h"
(-)c/x11/libinput/files/patch-tools_Makefile.am (-24 lines)
Removed Link Here
1
--- tools/Makefile.am.orig	2017-02-11 05:10:33 UTC
2
+++ tools/Makefile.am
3
@@ -11,8 +11,8 @@ AM_CXXFLAGS = $(GCC_CXXFLAGS)
4
 libshared_la_SOURCES = \
5
 		       shared.c \
6
 		       shared.h
7
-libshared_la_CFLAGS = $(AM_CFLAGS) $(LIBEVDEV_CFLAGS)
8
-libshared_la_LIBADD = $(LIBEVDEV_LIBS)
9
+libshared_la_CFLAGS = $(AM_CFLAGS) $(LIBEVDEV_CFLAGS) $(LIBUDEV_CFLAGS)
10
+libshared_la_LIBADD = $(LIBEVDEV_LIBS) $(LIBUDEV_LIBS)
11
 
12
 event_debug_SOURCES = event-debug.c
13
 event_debug_LDADD = ../src/libinput.la libshared.la $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
14
@@ -20,8 +20,9 @@ event_debug_LDFLAGS = -no-install
15
 event_debug_CFLAGS = $(AM_CFLAGS) $(LIBUDEV_CFLAGS) $(LIBEVDEV_CFLAGS)
16
 
17
 ptraccel_debug_SOURCES = ptraccel-debug.c
18
-ptraccel_debug_LDADD = ../src/libfilter.la ../src/libinput.la
19
+ptraccel_debug_LDADD = ../src/libfilter.la ../src/libinput.la $(LIBUDEV_LIBS)
20
 ptraccel_debug_LDFLAGS = -no-install
21
+ptraccel_debug_CFLAGS = $(LIBUDEV_CFLAGS)
22
 
23
 libinput_list_devices_SOURCES = libinput-list-devices.c
24
 libinput_list_devices_LDADD = ../src/libinput.la libshared.la $(LIBUDEV_LIBS)
(-)c/x11/libinput/files/patch-udev_Makefile.am (-10 lines)
Removed Link Here
1
--- udev/Makefile.am.orig	2017-02-11 05:10:33 UTC
2
+++ udev/Makefile.am
3
@@ -19,6 +19,7 @@ endif
4
 
5
 libinput_model_quirks_SOURCES = libinput-model-quirks.c
6
 libinput_model_quirks_CFLAGS = \
7
+			       -I$(top_srcdir)/include \
8
 			       -I$(top_srcdir)/src \
9
 			       $(LIBUDEV_CFLAGS) \
10
 			       $(GCC_CFLAGS)
(-)w/x11/libinput/pkg-plist (-8 / +50 lines)
Lines 1-14 Link Here
1
bin/libinput-debug-events
1
bin/libinput
2
bin/libinput-list-devices
3
include/libinput.h
2
include/libinput.h
4
lib/libinput.so
3
lib/libinput.so
5
lib/libinput.so.10
4
lib/libinput.so.10
6
lib/libinput.so.10.11.2
5
lib/libinput.so.10.13.0
7
lib/udev/hwdb.d/90-libinput-model-quirks.hwdb
8
lib/udev/libinput-device-group
9
lib/udev/libinput-model-quirks
10
lib/udev/rules.d/80-libinput-device-groups.rules
11
lib/udev/rules.d/90-libinput-model-quirks.rules
12
libdata/pkgconfig/libinput.pc
6
libdata/pkgconfig/libinput.pc
7
libexec/libinput/libinput-debug-events
8
%%DEBUG_GUI%%libexec/libinput/libinput-debug-gui
9
libexec/libinput/libinput-list-devices
10
libexec/libinput/libinput-measure
11
libexec/libinput/libinput-measure-fuzz
12
libexec/libinput/libinput-measure-touch-size
13
libexec/libinput/libinput-measure-touchpad-pressure
14
libexec/libinput/libinput-measure-touchpad-tap
15
libexec/libinput/libinput-quirks
16
libexec/libinput/libinput-record
17
libexec/libinput/libinput-replay
13
man/man1/libinput-debug-events.1.gz
18
man/man1/libinput-debug-events.1.gz
19
%%DEBUG_GUI%%man/man1/libinput-debug-gui.1.gz
14
man/man1/libinput-list-devices.1.gz
20
man/man1/libinput-list-devices.1.gz
21
man/man1/libinput-measure-fuzz.1.gz
22
man/man1/libinput-measure-touch-size.1.gz
23
man/man1/libinput-measure-touchpad-pressure.1.gz
24
man/man1/libinput-measure-touchpad-tap.1.gz
25
man/man1/libinput-measure.1.gz
26
man/man1/libinput-quirks-list.1.gz
27
man/man1/libinput-quirks-validate.1.gz
28
man/man1/libinput-quirks.1.gz
29
man/man1/libinput-record.1.gz
30
man/man1/libinput-replay.1.gz
31
man/man1/libinput.1.gz
32
%%DATADIR%%/10-generic-keyboard.quirks
33
%%DATADIR%%/10-generic-lid.quirks
34
%%DATADIR%%/10-generic-trackball.quirks
35
%%DATADIR%%/30-vendor-aiptek.quirks
36
%%DATADIR%%/30-vendor-alps.quirks
37
%%DATADIR%%/30-vendor-cyapa.quirks
38
%%DATADIR%%/30-vendor-elantech.quirks
39
%%DATADIR%%/30-vendor-huion.quirks
40
%%DATADIR%%/30-vendor-ibm.quirks
41
%%DATADIR%%/30-vendor-kensington.quirks
42
%%DATADIR%%/30-vendor-logitech.quirks
43
%%DATADIR%%/30-vendor-microsoft.quirks
44
%%DATADIR%%/30-vendor-razer.quirks
45
%%DATADIR%%/30-vendor-synaptics.quirks
46
%%DATADIR%%/30-vendor-wacom.quirks
47
%%DATADIR%%/50-system-acer.quirks
48
%%DATADIR%%/50-system-apple.quirks
49
%%DATADIR%%/50-system-asus.quirks
50
%%DATADIR%%/50-system-chicony.quirks
51
%%DATADIR%%/50-system-cyborg.quirks
52
%%DATADIR%%/50-system-dell.quirks
53
%%DATADIR%%/50-system-google.quirks
54
%%DATADIR%%/50-system-hp.quirks
55
%%DATADIR%%/50-system-lenovo.quirks
56
%%DATADIR%%/50-system-system76.quirks

Return to bug 222905