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