diff --git c/x11/libinput/Makefile w/x11/libinput/Makefile index 6bb96d13647a..f601a5c7a644 100644 --- c/x11/libinput/Makefile +++ w/x11/libinput/Makefile @@ -1,30 +1,57 @@ # $FreeBSD$ PORTNAME= libinput -PORTVERSION= 1.6.0 +PORTVERSION= 1.10.4 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 + +BUILD_DEPENDS= ${LOCALBASE}/include/linux/input.h:devel/evdev-proto +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 +DEBUG_GUI_DESC= Build the GUI event viewer +LIBWACOM_DESC= Libwacom support + +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 +EXTRACT_AFTER_ARGS= --exclude include/linux # supplied linux/input.h + +MESON_ARGS+= -Ddocumentation=false -Dtests=false CPPFLAGS+= -I${LOCALBASE}/include/libepoll-shim +LDFLAGS+= -lepoll-shim INSTALL_TARGET= install-strip +python_OLD_CMD= "/usr/bin/env python3" +SHEBANG_FILES= tools/libinput-measure-touch-size \ + tools/libinput-measure-touchpad-pressure \ + tools/libinput-measure-touchpad-tap \ + tools/libinput-measure-trackpoint-range + +post-extract: + # meson script checks existence of bundled evdev headers. Fake them. + ${LN} -sf ${LOCALBASE}/include/linux ${WRKSRC}/include/linux + 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 + ${WRKSRC}/tools/ptraccel-debug.c .include diff --git c/x11/libinput/distinfo w/x11/libinput/distinfo index 6b4217e50efe..b64eeda969db 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 = 1523366709 +SHA256 (libinput-1.10.4.tar.xz) = 2330a82f3e4b617a4f9ff0f2bf9cc217b3c4e69d767e61ca59ca07add61f68ac +SIZE (libinput-1.10.4.tar.xz) = 493152 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-meson.build w/x11/libinput/files/patch-meson.build new file mode 100644 index 000000000000..2f37e2cad11e --- /dev/null +++ w/x11/libinput/files/patch-meson.build @@ -0,0 +1,39 @@ +--- meson.build.orig 2017-11-28 05:13:06 UTC ++++ meson.build +@@ -72,6 +72,8 @@ endif + + ############ udev bits ############ + ++if false ++ + udev_dir = get_option('udev-dir') + if udev_dir == '' + udev_dir = join_paths(get_option('prefix'), 'lib', 'udev') +@@ -127,6 +129,8 @@ litest_model_quirks_file = configure_file(input : 'ude + output : '90-libinput-model-quirks-litest.rules', + install : false, + configuration : litest_udev_rules_config) ++ ++endif + + ############ libinput-util.a ############ + src_libinput_util = [ +--- meson.build.orig 2017-10-30 05:16:22 UTC ++++ meson.build +@@ -44,6 +44,8 @@ pkgconfig = import('pkgconfig') + dep_udev = dependency('libudev') + dep_mtdev = dependency('mtdev', version : '>= 1.1.0') + dep_libevdev = dependency('libevdev', version : '>= 0.4') ++dep_libepoll = declare_dependency(link_args : ['-lepoll-shim'], include_directories : [ ++ include_directories(join_paths(get_option('prefix'), 'include', 'libepoll-shim')) ]) + dep_lm = cc.find_library('m', required : false) + dep_rt = cc.find_library('rt', required : false) + +@@ -184,6 +188,7 @@ deps_libinput = [ + dep_mtdev, + dep_udev, + dep_libevdev, ++ dep_libepoll, + dep_lm, + dep_rt, + dep_libwacom, 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-util.h w/x11/libinput/files/patch-src_libinput-util.h new file mode 100644 index 000000000000..cba5e6bb9164 --- /dev/null +++ w/x11/libinput/files/patch-src_libinput-util.h @@ -0,0 +1,12 @@ +--- src/libinput-util.h.orig 2017-11-28 05:13:06 UTC ++++ src/libinput-util.h +@@ -39,6 +39,9 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif + + #include "libinput.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-descr w/x11/libinput/pkg-descr index c49ab938858f..7b74c6f2a0c0 100644 --- c/x11/libinput/pkg-descr +++ w/x11/libinput/pkg-descr @@ -4,4 +4,4 @@ device handling, input device event processing and abstraction so minimize the amount of custom input code compositors need to provide the common set of functionality that users expect. -WWW: http://www.freedesktop.org/wiki/Software/libinput/ +WWW: https://www.freedesktop.org/wiki/Software/libinput/ diff --git c/x11/libinput/pkg-plist w/x11/libinput/pkg-plist index c1bccf3c871c..d6f98975e8f3 100644 --- c/x11/libinput/pkg-plist +++ w/x11/libinput/pkg-plist @@ -1,14 +1,25 @@ +bin/libinput bin/libinput-debug-events bin/libinput-list-devices 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-touch-size +libexec/libinput/libinput-measure-touchpad-pressure +libexec/libinput/libinput-measure-touchpad-tap +libexec/libinput/libinput-measure-trackpoint-range 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-touch-size.1.gz +man/man1/libinput-measure-touchpad-pressure.1.gz +man/man1/libinput-measure-touchpad-tap.1.gz +man/man1/libinput-measure-trackpoint-range.1.gz +man/man1/libinput-measure.1.gz +man/man1/libinput.1.gz