pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

libevdev-openbsd,libinput-bsd*: add partial emulations from OpenBSD



Module Name:	pkgsrc-wip
Committed By:	Mark Davies <mark%ecs.vuw.ac.nz@localhost>
Pushed By:	markd
Date:		Sat Jan 3 13:07:48 2026 +1300
Changeset:	a23efd9baf53b5d84a7db80cb099e5ad1267df1f

Modified Files:
	Makefile
Added Files:
	libevdev-openbsd/DESCR
	libevdev-openbsd/Makefile
	libevdev-openbsd/PLIST
	libevdev-openbsd/buildlink3.mk
	libevdev-openbsd/distinfo
	libinput-bsd-headers/DESCR
	libinput-bsd-headers/Makefile
	libinput-bsd-headers/PLIST
	libinput-bsd-headers/buildlink3.mk
	libinput-bsd/DESCR
	libinput-bsd/Makefile
	libinput-bsd/Makefile.common
	libinput-bsd/PLIST
	libinput-bsd/TODO
	libinput-bsd/buildlink3.mk
	libinput-bsd/distinfo
	libinput-bsd/patches/patch-include_linux_input-event-codes.h
	libinput-bsd/patches/patch-include_linux_input.h
	libinput-bsd/patches/patch-meson.build
	libinput-bsd/patches/patch-src_libinput-private.h
	libinput-bsd/patches/patch-src_libinput-util.h
	libinput-bsd/patches/patch-src_util-strings.h
	libinput-bsd/patches/patch-src_wscons.c

Log Message:
libevdev-openbsd,libinput-bsd*: add partial emulations from OpenBSD

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=a23efd9baf53b5d84a7db80cb099e5ad1267df1f

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                           |   3 +
 libevdev-openbsd/DESCR                             |   5 +
 libevdev-openbsd/Makefile                          |  28 ++++++
 libevdev-openbsd/PLIST                             |   7 ++
 libevdev-openbsd/buildlink3.mk                     |  14 +++
 libevdev-openbsd/distinfo                          |   6 ++
 libinput-bsd-headers/DESCR                         |  16 ++++
 libinput-bsd-headers/Makefile                      |  22 +++++
 libinput-bsd-headers/PLIST                         |   7 ++
 libinput-bsd-headers/buildlink3.mk                 |  14 +++
 libinput-bsd/DESCR                                 |  13 +++
 libinput-bsd/Makefile                              |  29 ++++++
 libinput-bsd/Makefile.common                       |  14 +++
 libinput-bsd/PLIST                                 |  77 +++++++++++++++
 libinput-bsd/TODO                                  |   2 +
 libinput-bsd/buildlink3.mk                         |  17 ++++
 libinput-bsd/distinfo                              |  12 +++
 .../patch-include_linux_input-event-codes.h        |  14 +++
 libinput-bsd/patches/patch-include_linux_input.h   |  14 +++
 libinput-bsd/patches/patch-meson.build             | 106 +++++++++++++++++++++
 libinput-bsd/patches/patch-src_libinput-private.h  |  15 +++
 libinput-bsd/patches/patch-src_libinput-util.h     |  15 +++
 libinput-bsd/patches/patch-src_util-strings.h      |  15 +++
 libinput-bsd/patches/patch-src_wscons.c            |  26 +++++
 24 files changed, 491 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 98aa79028b..6f4f9a9fcc 100644
--- a/Makefile
+++ b/Makefile
@@ -2069,6 +2069,7 @@ SUBDIR+=	libepc
 SUBDIR+=	libeps
 SUBDIR+=	libevdev
 SUBDIR+=	libevdev-chunk
+SUBDIR+=	libevdev-openbsd
 SUBDIR+=	libevhtp
 SUBDIR+=	libexact
 SUBDIR+=	libfirm-git
@@ -2117,6 +2118,8 @@ SUBDIR+=	libifstat
 SUBDIR+=	libimobiledevice
 SUBDIR+=	libimobiledevice-glue
 SUBDIR+=	libinput
+SUBDIR+=	libinput-bsd
+SUBDIR+=	libinput-bsd-headers
 SUBDIR+=	libinstpatch
 SUBDIR+=	libircclient
 SUBDIR+=	libitl
diff --git a/libevdev-openbsd/DESCR b/libevdev-openbsd/DESCR
new file mode 100644
index 0000000000..b8fc35e5b2
--- /dev/null
+++ b/libevdev-openbsd/DESCR
@@ -0,0 +1,5 @@
+On Linux libevdev is a wrapper library for evdev devices.
+
+OpenBSD/NetBSD doesn't use evdev directly, but a layer emulating
+libinput. Some applications bypass libinput and use some libevdev
+functions directly. This shim library provides the needed functions.
diff --git a/libevdev-openbsd/Makefile b/libevdev-openbsd/Makefile
new file mode 100644
index 0000000000..27987b4fc2
--- /dev/null
+++ b/libevdev-openbsd/Makefile
@@ -0,0 +1,28 @@
+# $NetBSD$
+
+DISTNAME=	libevdev-openbsd-20231111
+CATEGORIES=	devel
+MASTER_SITES=	https://code.tetaneutral.net/mherrb/libevdev-openbsd/archive/
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://code.tetaneutral.net/mherrb/libevdev-openbsd/
+COMMENT=	Minimal set of libevdev functions for Wayland on OpenBSD/NetBSD
+LICENSE=	mit
+
+#NO_CONFIGURE=	yes
+
+WRKSRC=		${WRKDIR}/libevdev-openbsd
+
+PKGCONFIG_OVERRIDE+=		libevdev.pc.in
+#PKGCONFIG_OVERRIDE_STAGE=	pre-install
+
+INSTALL_TARGET=		install  install-includes
+INSTALLATION_DIRS+=	lib/pkgconfig
+MAKE_ENV+=		INSTALL_DATA=${INSTALL_DATA:Q}
+
+# nothing to configure but PKGCONFIG_OVERRIDE to apply
+do-configure:
+	@${DO_NADA}
+
+.include "../../wip/libinput-bsd-headers/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/libevdev-openbsd/PLIST b/libevdev-openbsd/PLIST
new file mode 100644
index 0000000000..b433837455
--- /dev/null
+++ b/libevdev-openbsd/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD$
+include/libevdev/libevdev.h
+lib/libevdev.a
+lib/libevdev.so
+lib/libevdev.so.0
+lib/libevdev.so.0.0
+lib/pkgconfig/libevdev.pc
diff --git a/libevdev-openbsd/buildlink3.mk b/libevdev-openbsd/buildlink3.mk
new file mode 100644
index 0000000000..4d49e9640f
--- /dev/null
+++ b/libevdev-openbsd/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	libevdev-openbsd
+
+.if !defined(LIBEVDEV_OPENBSD_BUILDLINK3_MK)
+LIBEVDEV_OPENBSD_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libevdev-openbsd+=	libevdev-openbsd>=20231111
+BUILDLINK_PKGSRCDIR.libevdev-openbsd?=		../../wip/libevdev-openbsd
+
+.include "../../wip/libinput-bsd-headers/buildlink3.mk"
+.endif	# LIBEVDEV_OPENBSD_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libevdev-openbsd
diff --git a/libevdev-openbsd/distinfo b/libevdev-openbsd/distinfo
new file mode 100644
index 0000000000..f403a30546
--- /dev/null
+++ b/libevdev-openbsd/distinfo
@@ -0,0 +1,6 @@
+$NetBSD$
+
+BLAKE2s (libevdev-openbsd-20231111.tar.gz) = 1289c09f72ec62cee42f4b81c4f276068dd4cfc5be8abd7f3388c7ba6a6d201d
+SHA512 (libevdev-openbsd-20231111.tar.gz) = 2aec90ba4314d7fb9db3158c2e6381a61e9e07c6ec9a4378614d119f7fcbd4403cffd541c00989ad6205d3ea796e0d3a5b635aa5ce7773d99a8b8b1cc5d9cdf1
+Size (libevdev-openbsd-20231111.tar.gz) = 15012 bytes
+SHA1 (patch-Makefile) = e856e6fb2e1185cb8fd9cb2f0a16abbbfdf646f3
diff --git a/libinput-bsd-headers/DESCR b/libinput-bsd-headers/DESCR
new file mode 100644
index 0000000000..56382ffb6a
--- /dev/null
+++ b/libinput-bsd-headers/DESCR
@@ -0,0 +1,16 @@
+libinput is a library that provides a full input stack for display servers
+and other applications that need to handle input devices provided by the
+kernel.
+
+libinput provides device detection, event handling and abstraction to
+minimize the amount of custom input code the user of libinput needs to
+provide the common set of functionality that users expect. Input event
+processing includes scaling touch coordinates, generating
+relative pointer events from touchpads, pointer acceleration, etc.
+
+This repository fork from https://gitlab.freedesktop.org/libinput/libinput.
+It is an attempt to extend libinput so that it works with wscons(4) and
+kqueue(2) and thus on OpenBSD and NetBSD.
+
+This package separately installs the header files to remove s cyclic
+dependency with libevdev-openbsd.
diff --git a/libinput-bsd-headers/Makefile b/libinput-bsd-headers/Makefile
new file mode 100644
index 0000000000..cd7742213a
--- /dev/null
+++ b/libinput-bsd-headers/Makefile
@@ -0,0 +1,22 @@
+# $NetBSD$
+
+.include "../../wip/libinput-bsd/Makefile.common"
+PKGNAME=	${DISTNAME:S/bsd/bsd-headers/}
+
+COMMENT=	headers for wscons(4) and kqueue(2) based port of libinput
+
+NO_CONFIGURE=	yes
+NO_BUILD=	yes
+
+INSTALLATION_DIRS=	include/linux/freebsd include/linux/linux
+HDRSRC=			${WRKSRC}/include/linux
+
+do-install:
+	${INSTALL_DATA} ${HDRSRC}/freebsd/input-event-codes.h ${DESTDIR}${PREFIX}/include/linux/freebsd
+	${INSTALL_DATA} ${HDRSRC}/freebsd/input.h ${DESTDIR}${PREFIX}/include/linux/freebsd
+	${INSTALL_DATA} ${HDRSRC}/linux/input-event-codes.h ${DESTDIR}${PREFIX}/include/linux/linux
+	${INSTALL_DATA} ${HDRSRC}/linux/input.h ${DESTDIR}${PREFIX}/include/linux/linux
+	${INSTALL_DATA} ${HDRSRC}/input-event-codes.h ${DESTDIR}${PREFIX}/include/linux/
+	${INSTALL_DATA} ${HDRSRC}/input.h ${DESTDIR}${PREFIX}/include/linux
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/libinput-bsd-headers/PLIST b/libinput-bsd-headers/PLIST
new file mode 100644
index 0000000000..c66349715c
--- /dev/null
+++ b/libinput-bsd-headers/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD$
+include/linux/freebsd/input-event-codes.h
+include/linux/freebsd/input.h
+include/linux/input-event-codes.h
+include/linux/input.h
+include/linux/linux/input-event-codes.h
+include/linux/linux/input.h
diff --git a/libinput-bsd-headers/buildlink3.mk b/libinput-bsd-headers/buildlink3.mk
new file mode 100644
index 0000000000..e18ffa4153
--- /dev/null
+++ b/libinput-bsd-headers/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	libinput-bsd-headers
+
+.if !defined(LIBINPUT_BSD_HEADERS_BUILDLINK3_MK)
+LIBINPUT_BSD_HEADERS_BUILDLINK3_MK:=
+
+BUILDLINK_DEPMETHOD.libinput-bsd-headers?=	build
+
+BUILDLINK_API_DEPENDS.libinput-bsd-headers+=	libinput-bsd-headers>=1.26.2
+BUILDLINK_PKGSRCDIR.libinput-bsd-headers?=	../../wip/libinput-bsd-headers
+.endif	# LIBINPUT_BSD_HEADERS_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libinput-bsd-headers
diff --git a/libinput-bsd/DESCR b/libinput-bsd/DESCR
new file mode 100644
index 0000000000..35e78c174c
--- /dev/null
+++ b/libinput-bsd/DESCR
@@ -0,0 +1,13 @@
+libinput is a library that provides a full input stack for display servers
+and other applications that need to handle input devices provided by the
+kernel.
+
+libinput provides device detection, event handling and abstraction to
+minimize the amount of custom input code the user of libinput needs to
+provide the common set of functionality that users expect. Input event
+processing includes scaling touch coordinates, generating
+relative pointer events from touchpads, pointer acceleration, etc.
+
+This repository fork from https://gitlab.freedesktop.org/libinput/libinput.
+It is an attempt to extend libinput so that it works with wscons(4) and
+kqueue(2) and thus on OpenBSD and NetBSD.
diff --git a/libinput-bsd/Makefile b/libinput-bsd/Makefile
new file mode 100644
index 0000000000..69df9e0344
--- /dev/null
+++ b/libinput-bsd/Makefile
@@ -0,0 +1,29 @@
+# $NetBSD$
+
+.include "Makefile.common"
+
+COMMENT=	wscons(4) and kqueue(2) based port of libinput
+
+USE_TOOLS+=	pkg-config
+
+# undefined reference to libevdev_event_type_from_name and
+# libevdev_property_from_name
+LDFLAGS+=	-Wl,--warn-unresolved-symbols
+
+.include "../../mk/bsd.prefs.mk"
+
+.if !defined(OPSYS_HAS_KQUEUE)
+PKG_SKIP_REASON+=	"Requires a kqueue implementation"
+.endif
+
+PKGCONFIG_OVERRIDE+=	src/libinput.pc.in
+
+MESON_ARGS+=	-Dlibwacom=false -Ddocumentation=false
+LDFLAGS+=	-levdev
+
+.include "../../devel/meson/build.mk"
+.include "../../devel/libepoll-shim/buildlink3.mk"
+.include "../../wip/libevdev-openbsd/buildlink3.mk"
+.include "../../devel/libudev-bsd/buildlink3.mk"
+.include "../../wip/libinput-bsd-headers/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/libinput-bsd/Makefile.common b/libinput-bsd/Makefile.common
new file mode 100644
index 0000000000..b6b8ffaab0
--- /dev/null
+++ b/libinput-bsd/Makefile.common
@@ -0,0 +1,14 @@
+# $NetBSD$
+
+DISTNAME=	libinput-bsd-1.26.2
+CATEGORIES=	x11
+MASTER_SITES=	${MASTER_SITE_GITHUB:=sizeofvoid/}
+GITHUB_PROJECT=	libopeninput
+GITHUB_TAG=	65eb6c2b9635d4fac97aba7a30606d95e1bb51bc
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/sizeofvoid/libopeninput/
+LICENSE=	mit
+
+PATCHDIR=	${.CURDIR}/../../wip/libinput-bsd/patches
+DISTINFO_FILE=	${.CURDIR}/../../wip/libinput-bsd/distinfo
diff --git a/libinput-bsd/PLIST b/libinput-bsd/PLIST
new file mode 100644
index 0000000000..a25f513fc9
--- /dev/null
+++ b/libinput-bsd/PLIST
@@ -0,0 +1,77 @@
+@comment $NetBSD$
+include/libinput.h
+lib/libinput.so
+lib/libinput.so.10
+lib/libinput.so.10.13.0
+lib/pkgconfig/libinput.pc
+man/man1/libinput-analyze-buttons.1
+man/man1/libinput-analyze-per-slot-delta.1
+man/man1/libinput-analyze-recording.1
+man/man1/libinput-analyze-touch-down-state.1
+man/man1/libinput-analyze.1
+man/man1/libinput-debug-events.1
+man/man1/libinput-debug-tablet.1
+man/man1/libinput-list-devices.1
+man/man1/libinput-list-kernel-devices.1
+man/man1/libinput-measure-fuzz.1
+man/man1/libinput-measure-touch-size.1
+man/man1/libinput-measure-touchpad-pressure.1
+man/man1/libinput-measure-touchpad-size.1
+man/man1/libinput-measure-touchpad-tap.1
+man/man1/libinput-measure.1
+man/man1/libinput-quirks-list.1
+man/man1/libinput-quirks-validate.1
+man/man1/libinput-quirks.1
+man/man1/libinput-record.1
+man/man1/libinput-replay.1
+man/man1/libinput-test.1
+man/man1/libinput.1
+share/libinput/10-generic-keyboard.quirks
+share/libinput/10-generic-mouse.quirks
+share/libinput/10-generic-trackball.quirks
+share/libinput/30-vendor-a4tech.quirks
+share/libinput/30-vendor-aiptek.quirks
+share/libinput/30-vendor-alps.quirks
+share/libinput/30-vendor-contour.quirks
+share/libinput/30-vendor-cypress.quirks
+share/libinput/30-vendor-elantech.quirks
+share/libinput/30-vendor-glorious.quirks
+share/libinput/30-vendor-huion.quirks
+share/libinput/30-vendor-ibm.quirks
+share/libinput/30-vendor-ite.quirks
+share/libinput/30-vendor-kensington.quirks
+share/libinput/30-vendor-logitech.quirks
+share/libinput/30-vendor-madcatz.quirks
+share/libinput/30-vendor-microsoft.quirks
+share/libinput/30-vendor-oracle.quirks
+share/libinput/30-vendor-qemu.quirks
+share/libinput/30-vendor-razer.quirks
+share/libinput/30-vendor-synaptics.quirks
+share/libinput/30-vendor-trust.quirks
+share/libinput/30-vendor-uniwill.quirks
+share/libinput/30-vendor-vmware.quirks
+share/libinput/30-vendor-wacom.quirks
+share/libinput/50-system-acer.quirks
+share/libinput/50-system-apple.quirks
+share/libinput/50-system-asus.quirks
+share/libinput/50-system-chicony.quirks
+share/libinput/50-system-chuwi.quirks
+share/libinput/50-system-cyborg.quirks
+share/libinput/50-system-dell.quirks
+share/libinput/50-system-framework.quirks
+share/libinput/50-system-gigabyte.quirks
+share/libinput/50-system-google.quirks
+share/libinput/50-system-gpd.quirks
+share/libinput/50-system-graviton.quirks
+share/libinput/50-system-hp.quirks
+share/libinput/50-system-huawei.quirks
+share/libinput/50-system-lenovo.quirks
+share/libinput/50-system-lg.quirks
+share/libinput/50-system-minisforum.quirks
+share/libinput/50-system-pine64.quirks
+share/libinput/50-system-sony.quirks
+share/libinput/50-system-starlabs.quirks
+share/libinput/50-system-system76.quirks
+share/libinput/50-system-toshiba.quirks
+share/libinput/50-system-vaio.quirks
+share/zsh/site-functions/_libinput
diff --git a/libinput-bsd/TODO b/libinput-bsd/TODO
new file mode 100644
index 0000000000..4c04c574d5
--- /dev/null
+++ b/libinput-bsd/TODO
@@ -0,0 +1,2 @@
+Currently has undefined reference to libevdev_event_type_from_name() and
+libevdev_property_from_name()
diff --git a/libinput-bsd/buildlink3.mk b/libinput-bsd/buildlink3.mk
new file mode 100644
index 0000000000..f7b2ebe166
--- /dev/null
+++ b/libinput-bsd/buildlink3.mk
@@ -0,0 +1,17 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	libinput-bsd
+
+.if !defined(LIBINPUT_BSD_BUILDLINK3_MK)
+LIBINPUT_BSD_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libinput-bsd+=	libinput-bsd>=1.26.2
+BUILDLINK_PKGSRCDIR.libinput-bsd?=	../../wip/libinput-bsd
+
+.include "../../devel/libepoll-shim/buildlink3.mk"
+.include "../../wip/libevdev-openbsd/buildlink3.mk"
+.include "../../devel/libudev-bsd/buildlink3.mk"
+.include "../../wip/libinput-bsd-headers/buildlink3.mk"
+.endif	# LIBINPUT_BSD_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libinput-bsd
diff --git a/libinput-bsd/distinfo b/libinput-bsd/distinfo
new file mode 100644
index 0000000000..7494470ee6
--- /dev/null
+++ b/libinput-bsd/distinfo
@@ -0,0 +1,12 @@
+$NetBSD$
+
+BLAKE2s (libinput-bsd-1.26.2-65eb6c2b9635d4fac97aba7a30606d95e1bb51bc.tar.gz) = 465175d1aae3c18749bad321c58e99b7ea6ef98e7cf196a5c9c0adb2c1500303
+SHA512 (libinput-bsd-1.26.2-65eb6c2b9635d4fac97aba7a30606d95e1bb51bc.tar.gz) = 35aa789ff6752b342f825d95f1aa014d775da46db23b6880d7dd8ec7e5fa1bf374e2e6b18c699fb9ac68f5017be7d371e1b555376f48443c7e35634ae6292d4c
+Size (libinput-bsd-1.26.2-65eb6c2b9635d4fac97aba7a30606d95e1bb51bc.tar.gz) = 1058455 bytes
+SHA1 (patch-include_linux_input-event-codes.h) = f9796e9f22527c5cda561629ade8e3eb88e29a07
+SHA1 (patch-include_linux_input.h) = 0758df6032865ce6d2a7d1a1f3d7c124db8d1897
+SHA1 (patch-meson.build) = ad2b69a395fab12cb8388f8b50a6366a12af1c19
+SHA1 (patch-src_libinput-private.h) = e095ce89f1d0c1ff72ff25672f9d4bdc8972d835
+SHA1 (patch-src_libinput-util.h) = ef31b2f6455f62407c8b2ede36528e0f360b3df9
+SHA1 (patch-src_util-strings.h) = 6785e7072f66ab5384f9cb6cd12169d0e879ea70
+SHA1 (patch-src_wscons.c) = 1fa38fb7d0405676ef95ee39dcc5779503c3d5e2
diff --git a/libinput-bsd/patches/patch-include_linux_input-event-codes.h b/libinput-bsd/patches/patch-include_linux_input-event-codes.h
new file mode 100644
index 0000000000..0a11b7d06c
--- /dev/null
+++ b/libinput-bsd/patches/patch-include_linux_input-event-codes.h
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Treat NetBSD line OpenBSD
+
+--- include/linux/input-event-codes.h.orig	2025-08-02 09:40:32.000000000 +0000
++++ include/linux/input-event-codes.h
+@@ -1,5 +1,7 @@
+ #ifdef __linux__
+ #include "linux/input-event-codes.h"
++#elif __NetBSD__
++#include "freebsd/input-event-codes.h"
+ #elif __OpenBSD__
+ #include "freebsd/input-event-codes.h"
+ #elif __FreeBSD__
diff --git a/libinput-bsd/patches/patch-include_linux_input.h b/libinput-bsd/patches/patch-include_linux_input.h
new file mode 100644
index 0000000000..002ed3e64b
--- /dev/null
+++ b/libinput-bsd/patches/patch-include_linux_input.h
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Treat NetBSD like OpenBSD
+
+--- include/linux/input.h.orig	2025-08-02 09:40:32.000000000 +0000
++++ include/linux/input.h
+@@ -1,5 +1,7 @@
+ #ifdef __linux__
+ #include "linux/input.h"
++#elif __NetBSD__
++#include "freebsd/input.h"
+ #elif __OpenBSD__
+ #include "freebsd/input.h"
+ #elif __FreeBSD__
diff --git a/libinput-bsd/patches/patch-meson.build b/libinput-bsd/patches/patch-meson.build
new file mode 100644
index 0000000000..7260e179c1
--- /dev/null
+++ b/libinput-bsd/patches/patch-meson.build
@@ -0,0 +1,106 @@
+$NetBSD$
+
+Treat NetBSD like OpenBSD.
+Don't install header files - split into separate package.
+
+--- meson.build.orig	2025-08-02 09:40:32.000000000 +0000
++++ meson.build
+@@ -143,7 +143,7 @@ config_h.set10('HAVE_INSTALLED_TESTS', g
+ 
+ # Dependencies
+ pkgconfig = import('pkgconfig')
+-if host_machine.system() == 'openbsd'
++if host_machine.system() == 'openbsd' or host_machine.system() == 'netbsd'
+ 	dep_udev = dependency('libudev')
+ 	dep_mtdev = []
+ 	dep_libevdev = []
+@@ -164,7 +164,7 @@ includes_src = include_directories('src'
+ 
+ ############ libwacom configuration ############
+ 
+-if host_machine.system() == 'openbsd'
++if host_machine.system() == 'openbsd' or host_machine.system() == 'netbsd'
+ have_libwacom = false
+ else
+ have_libwacom = get_option('libwacom')
+@@ -177,7 +177,7 @@ else
+ endif
+ 
+ ############ udev bits ############
+-if host_machine.system() != 'openbsd'
++if host_machine.system() != 'openbsd' and host_machine.system() != 'netbsd'
+ executable('libinput-device-group',
+ 	   'udev/libinput-device-group.c',
+ 	   dependencies : [dep_udev, dep_libwacom],
+@@ -314,7 +314,7 @@ src_libfilter = [
+ 		'src/filter-trackpoint.c',
+ 		'src/filter-trackpoint-flat.c',
+ ]
+-if host_machine.system() == 'openbsd'
++if host_machine.system() == 'openbsd' or host_machine.system() == 'netbsd'
+ 	dep_libfilter = []
+ else
+ libfilter = static_library('filter', src_libfilter,
+@@ -345,7 +345,7 @@ libquirks = static_library('quirks', src
+ dep_libquirks = declare_dependency(link_with : libquirks)
+ 
+ # Create /etc/libinput
+-if host_machine.system() != 'openbsd'
++if host_machine.system() != 'openbsd' and host_machine.system() != 'netbsd'
+ if meson.version().version_compare('>= 0.60')
+ 	install_emptydir(dir_etc / 'libinput')
+ else
+@@ -355,7 +355,7 @@ endif
+ 
+ ############ libinput.so ############
+ install_headers('src/libinput.h')
+-if host_machine.system() == 'openbsd'
++if host_machine.system() == 'openbsd' or host_machine.system() == 'netbsd'
+ src_libinput = src_libfilter + [
+ 	'src/libinput_openbsd.c',
+ 	'src/libinput-private-config.c',
+@@ -426,7 +426,7 @@ lib_libinput = shared_library('input',
+ 		link_depends : mapfile,
+ 		install : true
+ 		)
+-if host_machine.system() == 'openbsd'
++if false
+ install_headers('include/linux/freebsd/input-event-codes.h', subdir: 'linux/freebsd')
+ install_headers('include/linux/freebsd/input.h', subdir: 'linux/freebsd')
+ 
+@@ -470,7 +470,7 @@ endif
+ subdir('completion/zsh')
+ 
+ ############ tools ############
+-if host_machine.system() != 'openbsd'
++if host_machine.system() != 'openbsd' and host_machine.system() != 'netbsd'
+ 
+ libinput_tool_path = dir_libexec
+ config_h.set_quoted('LIBINPUT_TOOL_PATH', libinput_tool_path)
+@@ -717,7 +717,7 @@ test('tools-builddir-lookup-installed',
+ 
+ endif
+ ############ tests ############
+-if host_machine.system() != 'openbsd'
++if host_machine.system() != 'openbsd' and host_machine.system() != 'netbsd'
+ 
+ test('symbols-leak-test',
+      find_program('test/symbols-leak-test'),
+@@ -771,7 +771,7 @@ if get_option('tests')
+ 	config_h.set10('HAVE_GSTACK', gstack.found())
+ 
+ 	# for inhibit support during test run
+-if host_machine.system() != 'openbsd'
++if host_machine.system() != 'openbsd' and host_machine.system() != 'netbsd'
+ 	dep_libsystemd = dependency('libsystemd', version : '>= 221', required : false)
+ 	config_h.set10('HAVE_LIBSYSTEMD', dep_libsystemd.found())
+ endif
+@@ -883,7 +883,7 @@ endif
+ 		'test/litest.c',
+ 	]
+ 
+-if host_machine.system() != 'openbsd'
++if host_machine.system() != 'openbsd' and host_machine.system() != 'netbsd'
+ 	dep_dl = cc.find_library('dl')
+ 	deps_litest = [
+ 		dep_libinput,
diff --git a/libinput-bsd/patches/patch-src_libinput-private.h b/libinput-bsd/patches/patch-src_libinput-private.h
new file mode 100644
index 0000000000..04492aa8a0
--- /dev/null
+++ b/libinput-bsd/patches/patch-src_libinput-private.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Treat NetBSD like OpenBSD
+
+--- src/libinput-private.h.orig	2025-08-02 09:40:32.000000000 +0000
++++ src/libinput-private.h
+@@ -1015,7 +1015,7 @@ static inline void libinput_libwacom_unr
+ #endif
+ 
+ 
+-#ifdef __OpenBSD__
++#if defined(__OpenBSD__) ||  defined(__NetBSD__)
+ void
+ axis_notify_event(struct libinput_device *device,
+     uint64_t time,
diff --git a/libinput-bsd/patches/patch-src_libinput-util.h b/libinput-bsd/patches/patch-src_libinput-util.h
new file mode 100644
index 0000000000..3770948e91
--- /dev/null
+++ b/libinput-bsd/patches/patch-src_libinput-util.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Treat NetBSD like OpenBSD
+
+--- src/libinput-util.h.orig	2025-08-02 09:40:32.000000000 +0000
++++ src/libinput-util.h
+@@ -66,7 +66,7 @@
+ #define LIBINPUT_EXPORT __attribute__ ((visibility("default")))
+ #define LIBINPUT_UNUSED __attribute__ ((unused))
+ 
+-#ifdef __OpenBSD__
++#if defined(__OpenBSD__) || defined(__NetBSD__)
+ #define bit(x_) (1UL << (x_))
+ #define NBITS(b) (b * 8)
+ #endif
diff --git a/libinput-bsd/patches/patch-src_util-strings.h b/libinput-bsd/patches/patch-src_util-strings.h
new file mode 100644
index 0000000000..fc2faeaf43
--- /dev/null
+++ b/libinput-bsd/patches/patch-src_util-strings.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Treat NetBSD like OpenBSD
+
+--- src/util-strings.h.orig	2025-08-02 09:40:32.000000000 +0000
++++ src/util-strings.h
+@@ -242,7 +242,7 @@ safe_atod(const char *str, double *val)
+ 		return false;
+ 
+ 	errno = 0;
+-#ifndef __OpenBSD__
++#if !(defined(__OpenBSD__) || defined(__NetBSD__))
+ 	v = strtod_l(str, &endptr, c_locale);
+ #else
+ 	v = strtod(str, &endptr);
diff --git a/libinput-bsd/patches/patch-src_wscons.c b/libinput-bsd/patches/patch-src_wscons.c
new file mode 100644
index 0000000000..da38e63b4a
--- /dev/null
+++ b/libinput-bsd/patches/patch-src_wscons.c
@@ -0,0 +1,26 @@
+$NetBSD$
+
+Allow of NetBSD/OpenBSD wscons differences
+
+--- src/wscons.c.orig	2025-08-02 09:40:32.000000000 +0000
++++ src/wscons.c
+@@ -209,13 +209,19 @@ wscons_process(struct libinput_device *d
+ 		axis_notify_event(device, time, &accel, &raw);
+ 		break;
+ 
++#ifdef WSCONS_EVENT_SYNC
+ 	case WSCONS_EVENT_SYNC:
+ 		break;
++#endif
+ 
+ 	case WSCONS_EVENT_MOUSE_ABSOLUTE_Z:
+ 	case WSCONS_EVENT_MOUSE_ABSOLUTE_W:
++#ifdef WSCONS_EVENT_TOUCH_WIDTH
+ 	case WSCONS_EVENT_TOUCH_WIDTH:
++#endif
++#ifdef WSCONS_EVENT_TOUCH_RESET
+ 	case WSCONS_EVENT_TOUCH_RESET:
++#endif
+ 		/* ignore those */
+ 		break;
+ 	default:


Home | Main Index | Thread Index | Old Index