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

Collapse All | Expand All

(-)w/x11/libinput/Makefile (-8 / +35 lines)
Lines 1-30 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTNAME=	libinput
3
PORTNAME=	libinput
4
PORTVERSION=	1.6.0
4
PORTVERSION=	1.10.4
5
CATEGORIES=	x11
5
CATEGORIES=	x11
6
MASTER_SITES=	http://freedesktop.org/software/${PORTNAME}/
6
MASTER_SITES=	http://freedesktop.org/software/${PORTNAME}/
7
7
8
MAINTAINER=	x11@FreeBSD.org
8
MAINTAINER=	x11@FreeBSD.org
9
COMMENT=	Generic input library
9
COMMENT=	Generic input library
10
10
11
BUILD_DEPENDS=	v4l_compat>=0:multimedia/v4l_compat
11
LICENSE=	MIT
12
LICENSE_FILE=	${WRKSRC}/COPYING
13
14
BUILD_DEPENDS=	${LOCALBASE}/include/linux/input.h:devel/evdev-proto
15
RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}evdev>0:devel/py-evdev@${PY_FLAVOR} \
16
		${PYTHON_PKGNAMEPREFIX}pyudev>0:devel/py-pyudev@${PY_FLAVOR}
12
LIB_DEPENDS=	libevdev.so:devel/libevdev \
17
LIB_DEPENDS=	libevdev.so:devel/libevdev \
13
		libepoll-shim.so:devel/libepoll-shim \
18
		libepoll-shim.so:devel/libepoll-shim \
14
		libwacom.so:x11/libwacom \
15
		libudev.so:devel/libudev-devd \
19
		libudev.so:devel/libudev-devd \
16
		libmtdev.so:devel/libmtdev
20
		libmtdev.so:devel/libmtdev
17
21
18
USES=		autoreconf gmake libtool pathfix pkgconfig tar:xz
22
OPTIONS_DEFINE=	DEBUG_GUI LIBWACOM
19
USE_LDCONFIG=	yes
23
OPTIONS_DEFAULT=LIBWACOM
20
GNU_CONFIGURE=	yes
24
OPTIONS_SUB=	yes
21
25
26
DEBUG_GUI_DESC=	Build the GUI event viewer
27
LIBWACOM_DESC=	Libwacom support
28
29
DEBUG_GUI_USE=		GNOME=gtk30,glib20,cairo
30
DEBUG_GUI_MESON_TRUE=	debug-gui
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
EXTRACT_AFTER_ARGS=	--exclude include/linux # supplied linux/input.h
37
38
MESON_ARGS+=	-Ddocumentation=false -Dtests=false
22
CPPFLAGS+=	-I${LOCALBASE}/include/libepoll-shim
39
CPPFLAGS+=	-I${LOCALBASE}/include/libepoll-shim
40
LDFLAGS+=	-lepoll-shim
23
INSTALL_TARGET=	install-strip
41
INSTALL_TARGET=	install-strip
24
42
43
python_OLD_CMD=	"/usr/bin/env python3"
44
SHEBANG_FILES=	tools/libinput-measure-touch-size \
45
		tools/libinput-measure-touchpad-pressure \
46
		tools/libinput-measure-touchpad-tap \
47
		tools/libinput-measure-trackpoint-range
48
49
post-extract:
50
	# meson script checks existence of bundled evdev headers. Fake them.
51
	${LN} -sf ${LOCALBASE}/include/linux ${WRKSRC}/include/linux
52
25
post-patch:
53
post-patch:
26
	${REINPLACE_CMD} -e 's|program_invocation_short_name|getprogname()|' \
54
	${REINPLACE_CMD} -e 's|program_invocation_short_name|getprogname()|' \
27
	    ${WRKSRC}/tools/libinput-list-devices.c \
55
	    ${WRKSRC}/tools/ptraccel-debug.c
28
	    ${WRKSRC}/tools/ptraccel-debug.c ${WRKSRC}/tools/shared.c
29
56
30
.include <bsd.port.mk>
57
.include <bsd.port.mk>
(-)w/x11/libinput/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1486789508
1
TIMESTAMP = 1523366709
2
SHA256 (libinput-1.6.0.tar.xz) = b7534f518d735c643aedca2fb4694683dfddc8d0600cfb628c87a18e65255832
2
SHA256 (libinput-1.10.4.tar.xz) = 2330a82f3e4b617a4f9ff0f2bf9cc217b3c4e69d767e61ca59ca07add61f68ac
3
SIZE (libinput-1.6.0.tar.xz) = 927656
3
SIZE (libinput-1.10.4.tar.xz) = 493152
(-)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 */
(-)w/x11/libinput/files/patch-meson.build (+39 lines)
Added Link Here
1
--- meson.build.orig	2017-11-28 05:13:06 UTC
2
+++ meson.build
3
@@ -72,6 +72,8 @@ endif
4
 
5
 ############ udev bits ############
6
 
7
+if false
8
+
9
 udev_dir = get_option('udev-dir')
10
 if udev_dir == ''
11
 	udev_dir = join_paths(get_option('prefix'), 'lib', 'udev')
12
@@ -127,6 +129,8 @@ litest_model_quirks_file = configure_file(input : 'ude
13
 	       output : '90-libinput-model-quirks-litest.rules',
14
 	       install : false,
15
 	       configuration : litest_udev_rules_config)
16
+
17
+endif
18
 
19
 ############ libinput-util.a ############
20
 src_libinput_util = [
21
--- meson.build.orig	2017-10-30 05:16:22 UTC
22
+++ meson.build
23
@@ -44,6 +44,8 @@ pkgconfig = import('pkgconfig')
24
 dep_udev = dependency('libudev')
25
 dep_mtdev = dependency('mtdev', version : '>= 1.1.0')
26
 dep_libevdev = dependency('libevdev', version : '>= 0.4')
27
+dep_libepoll = declare_dependency(link_args : ['-lepoll-shim'], include_directories : [
28
+     include_directories(join_paths(get_option('prefix'), 'include', 'libepoll-shim')) ])
29
 dep_lm = cc.find_library('m', required : false)
30
 dep_rt = cc.find_library('rt', required : false)
31
 
32
@@ -184,6 +188,7 @@ deps_libinput = [
33
 	dep_mtdev,
34
 	dep_udev,
35
 	dep_libevdev,
36
+	dep_libepoll,
37
 	dep_lm,
38
 	dep_rt,
39
 	dep_libwacom,
(-)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"
(-)w/x11/libinput/files/patch-src_libinput-util.h (+12 lines)
Added Link Here
1
--- src/libinput-util.h.orig	2017-11-28 05:13:06 UTC
2
+++ src/libinput-util.h
3
@@ -39,6 +39,9 @@
4
 #include <string.h>
5
 #include <time.h>
6
 #include <unistd.h>
7
+#ifdef __FreeBSD__
8
+#include <xlocale.h>
9
+#endif
10
 
11
 #include "libinput.h"
12
 
(-)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-descr (-1 / +1 lines)
Lines 4-7 device handling, input device event processing and abstraction so Link Here
4
minimize the amount of custom input code compositors need to provide
4
minimize the amount of custom input code compositors need to provide
5
the common set of functionality that users expect.
5
the common set of functionality that users expect.
6
6
7
WWW: http://www.freedesktop.org/wiki/Software/libinput/
7
WWW: https://www.freedesktop.org/wiki/Software/libinput/
(-)w/x11/libinput/pkg-plist (-6 / +17 lines)
Lines 1-14 Link Here
1
bin/libinput
1
bin/libinput-debug-events
2
bin/libinput-debug-events
2
bin/libinput-list-devices
3
bin/libinput-list-devices
3
include/libinput.h
4
include/libinput.h
4
lib/libinput.so
5
lib/libinput.so
5
lib/libinput.so.10
6
lib/libinput.so.10
6
lib/libinput.so.10.11.2
7
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
8
libdata/pkgconfig/libinput.pc
9
libexec/libinput/libinput-debug-events
10
%%DEBUG_GUI%%libexec/libinput/libinput-debug-gui
11
libexec/libinput/libinput-list-devices
12
libexec/libinput/libinput-measure
13
libexec/libinput/libinput-measure-touch-size
14
libexec/libinput/libinput-measure-touchpad-pressure
15
libexec/libinput/libinput-measure-touchpad-tap
16
libexec/libinput/libinput-measure-trackpoint-range
13
man/man1/libinput-debug-events.1.gz
17
man/man1/libinput-debug-events.1.gz
18
%%DEBUG_GUI%%man/man1/libinput-debug-gui.1.gz
14
man/man1/libinput-list-devices.1.gz
19
man/man1/libinput-list-devices.1.gz
20
man/man1/libinput-measure-touch-size.1.gz
21
man/man1/libinput-measure-touchpad-pressure.1.gz
22
man/man1/libinput-measure-touchpad-tap.1.gz
23
man/man1/libinput-measure-trackpoint-range.1.gz
24
man/man1/libinput-measure.1.gz
25
man/man1/libinput.1.gz

Return to bug 222905