Date: Sun, 03 May 2026 14:02:45 +0000 From: Gleb Popov <arrowd@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: bf9be3f57568 - main - x11/libinput: Partially enable testing Message-ID: <69f75585.42353.5c6fdac1@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=bf9be3f57568e6aa4b4821cbd59aecf966228373 commit bf9be3f57568e6aa4b4821cbd59aecf966228373 Author: Gleb Popov <arrowd@FreeBSD.org> AuthorDate: 2026-05-03 13:47:49 +0000 Commit: Gleb Popov <arrowd@FreeBSD.org> CommitDate: 2026-05-03 14:02:34 +0000 x11/libinput: Partially enable testing --- x11/libinput/Makefile | 27 +++++++++++++--- x11/libinput/files/patch-meson.build | 20 ------------ x11/libinput/files/patch-src_evdev.c | 6 ++-- x11/libinput/files/patch-test_litest-runner.c | 10 ++++++ x11/libinput/files/patch-test_litest-runner.h | 11 +++++++ x11/libinput/files/patch-test_litest.c | 46 +++++++++++++++++++++++++++ x11/libinput/pkg-plist | 1 + 7 files changed, 94 insertions(+), 27 deletions(-) diff --git a/x11/libinput/Makefile b/x11/libinput/Makefile index 9b512e7f25d3..910bd21b2f69 100644 --- a/x11/libinput/Makefile +++ b/x11/libinput/Makefile @@ -15,8 +15,10 @@ LIB_DEPENDS= libevdev.so:devel/libevdev \ libepoll-shim.so:devel/libepoll-shim \ libudev.so:devel/libudev-devd \ libmtdev.so:devel/libmtdev +TEST_DEPENDS= bash:shells/bash \ + ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} -USES= cpe localbase meson pkgconfig python:run shebangfix +USES= cpe localbase meson pkgconfig python:run,test shebangfix USE_LDCONFIG= yes USE_GITLAB= yes @@ -24,11 +26,14 @@ GL_SITE= https://gitlab.freedesktop.org CPE_VENDOR= freedesktop -MESON_ARGS= -Ddocumentation=false -Dtests=false +MESON_ARGS= -Ddocumentation=false -SHEBANG_FILES= tools/*.py +SHEBANG_FILES= tools/*.py \ + test/*.py \ + test/*.sh \ + test/symbols-leak-test -OPTIONS_DEFINE= DEBUG_GUI LIBWACOM +OPTIONS_DEFINE= DEBUG_GUI LIBWACOM TEST OPTIONS_DEFAULT=LIBWACOM OPTIONS_SUB= yes @@ -41,5 +46,19 @@ DEBUG_GUI_LIB_DEPENDS= libwayland-client.so:graphics/wayland DEBUG_GUI_MESON_TRUE= debug-gui LIBWACOM_LIB_DEPENDS= libwacom.so:x11/libwacom LIBWACOM_MESON_TRUE= libwacom +# If built with WITH_DEBUG=yes running tests require /dev/input/* devices +# In case of poudriere jail run following commands on host: +# devfs -m /usr/local/poudriere/data/.m/<jail>-<ports>/ref/dev rule apply path 'input' unhide +# devfs -m /usr/local/poudriere/data/.m/<jail>-<ports>/ref/dev rule apply path 'input/*' unhide +TEST_LIB_DEPENDS= libcheck.so:devel/check +TEST_MESON_TRUE= tests + +TESTING_UNSAFE= Some tests fail until https://github.com/wulf7/libudev-devd/pull/13 + +post-patch: + ${REINPLACE_CMD} -e 's|sed|sed -E|g' ${WRKSRC}/test/symbols-leak-test + +post-install: + ${RM} -r ${STAGEDIR}${PREFIX}/lib/udev .include <bsd.port.mk> diff --git a/x11/libinput/files/patch-meson.build b/x11/libinput/files/patch-meson.build deleted file mode 100644 index 71925a531a3e..000000000000 --- a/x11/libinput/files/patch-meson.build +++ /dev/null @@ -1,20 +0,0 @@ ---- meson.build.orig 2020-02-03 05:25:43 UTC -+++ meson.build -@@ -152,6 +152,8 @@ endif - - ############ udev bits ############ - -+if false -+ - executable('libinput-device-group', - 'udev/libinput-device-group.c', - dependencies : [dep_udev, dep_libwacom], -@@ -192,6 +194,8 @@ litest_groups_rules_file = configure_file(input : 'ude - litest_fuzz_override_file = configure_file(input : 'udev/90-libinput-fuzz-override.rules.in', - output : '90-libinput-fuzz-override-litest.rules', - configuration : litest_udev_rules_config) -+ -+endif - - ############ Check for leftover udev rules ######## - diff --git a/x11/libinput/files/patch-src_evdev.c b/x11/libinput/files/patch-src_evdev.c index df8fe4fd434a..e27b64542a36 100644 --- a/x11/libinput/files/patch-src_evdev.c +++ b/x11/libinput/files/patch-src_evdev.c @@ -6,9 +6,9 @@ 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 2020-07-15 01:54:15 UTC +--- src/evdev.c.orig 2025-04-01 02:46:07 UTC +++ src/evdev.c -@@ -1015,7 +1015,7 @@ evdev_sync_device(struct evdev_device *device) +@@ -1104,7 +1104,7 @@ evdev_sync_device(struct evdev_device *device) evdev_device_dispatch_one(device, &ev); } while (rc == LIBEVDEV_READ_STATUS_SYNC); @@ -17,7 +17,7 @@ so we just use them instead of the original (enumerated) ones. } static inline void -@@ -1083,6 +1083,17 @@ evdev_device_dispatch(void *data) +@@ -1177,6 +1177,17 @@ evdev_device_dispatch(void *data) if (rc != -EAGAIN && rc != -EINTR) { libinput_remove_source(libinput, device->source); diff --git a/x11/libinput/files/patch-test_litest-runner.c b/x11/libinput/files/patch-test_litest-runner.c new file mode 100644 index 000000000000..9bcc44c072ba --- /dev/null +++ b/x11/libinput/files/patch-test_litest-runner.c @@ -0,0 +1,10 @@ +--- test/litest-runner.c.orig 2025-04-01 02:46:07 UTC ++++ test/litest-runner.c +@@ -26,7 +26,6 @@ + #include <errno.h> + #include <sys/epoll.h> + #include <sys/timerfd.h> +-#include <sys/sysinfo.h> + #include <sys/wait.h> + #ifdef HAVE_PIDFD_OPEN + #include <sys/syscall.h> diff --git a/x11/libinput/files/patch-test_litest-runner.h b/x11/libinput/files/patch-test_litest-runner.h new file mode 100644 index 000000000000..fcd70b576d44 --- /dev/null +++ b/x11/libinput/files/patch-test_litest-runner.h @@ -0,0 +1,11 @@ +--- test/litest-runner.h.orig 2025-04-01 02:46:07 UTC ++++ test/litest-runner.h +@@ -180,3 +180,8 @@ void litest_runner_abort(void); + */ + __attribute__((noreturn)) + void litest_runner_abort(void); ++ ++static int get_nprocs(void) ++{ ++ return sysconf (_SC_NPROCESSORS_ONLN); ++} diff --git a/x11/libinput/files/patch-test_litest.c b/x11/libinput/files/patch-test_litest.c new file mode 100644 index 000000000000..81964c72efde --- /dev/null +++ b/x11/libinput/files/patch-test_litest.c @@ -0,0 +1,46 @@ +--- test/litest.c.orig 2025-04-01 02:46:07 UTC ++++ test/litest.c +@@ -44,13 +44,13 @@ + #include <sys/wait.h> + #include <sys/stat.h> + #include <sys/types.h> +-#include <sys/sysinfo.h> + #include <libudev.h> + #if HAVE_LIBSYSTEMD + #include <systemd/sd-bus.h> + #endif + #ifdef __FreeBSD__ + #include <termios.h> ++#include <sys/kbio.h> + #endif + + #include <valgrind/valgrind.h> +@@ -66,8 +66,6 @@ + #include "util-backtrace.h" + #include "util-libinput.h" + +-#include <linux/kd.h> +- + #define evbit(t, c) ((t) << 16U | (c & 0xffff)) + + #define UDEV_RULES_D "/run/udev/rules.d" +@@ -5322,8 +5320,8 @@ check_device_access(void) + return 77; + } + +- if (access("/dev/uinput", F_OK) == -1 && +- access("/dev/input/uinput", F_OK) == -1) { ++ if (access("/dev/uinput_skip_our_libudev_isnt_ready", F_OK) == -1 && ++ access("/dev/input/uinput_skip_our_libudev_isnt_ready", F_OK) == -1) { + fprintf(stderr, + "uinput device is missing, skipping tests.\n"); + return 77; +@@ -5365,7 +5363,7 @@ main(int argc, char **argv) + if (getenv("NO_COLOR")) + use_colors = false; + +- in_debugger = is_debugger_attached(); ++ in_debugger = false; + if (in_debugger) { + jobs = 0; + } else if ((meson_testthreads = getenv("MESON_TESTTHREADS")) == NULL || diff --git a/x11/libinput/pkg-plist b/x11/libinput/pkg-plist index 9bdb7e420024..f97aca9d7d01 100644 --- a/x11/libinput/pkg-plist +++ b/x11/libinput/pkg-plist @@ -96,6 +96,7 @@ share/man/man1/libinput-quirks.1.gz share/man/man1/libinput-record.1.gz share/man/man1/libinput-replay.1.gz share/man/man1/libinput-test.1.gz +%%TEST%%share/man/man1/libinput-test-suite.1.gz share/man/man1/libinput.1.gz share/zsh/site-functions/_libinput @dir %%ETCDIR%%home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f75585.42353.5c6fdac1>
