pkgsrc-WIP-changes archive

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

Import libopeninput



Module Name:	pkgsrc-wip
Committed By:	kikadf <kikadf.01%gmail.com@localhost>
Pushed By:	kikadf
Date:		Tue Sep 9 16:54:57 2025 +0200
Changeset:	451303bc2996e7198f3fa5c105bb9078c8f2af5b

Modified Files:
	Makefile
Added Files:
	libopeninput/DESCR
	libopeninput/Makefile
	libopeninput/PLIST
	libopeninput/buildlink3.mk
	libopeninput/distinfo
	libopeninput/patches/patch-include_linux_input-event-codes.h
	libopeninput/patches/patch-include_linux_input.h
	libopeninput/patches/patch-meson.build
	libopeninput/patches/patch-src_libinput-private.h
	libopeninput/patches/patch-src_libinput-util.h
	libopeninput/patches/patch-src_util-strings.h
	libopeninput/patches/patch-src_wscons.c

Log Message:
Import libopeninput

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

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

diffstat:
 Makefile                                           |  3 +
 libopeninput/DESCR                                 |  4 +
 libopeninput/Makefile                              | 27 ++++++
 libopeninput/PLIST                                 | 77 +++++++++++++++++
 libopeninput/buildlink3.mk                         | 14 ++++
 libopeninput/distinfo                              | 12 +++
 .../patch-include_linux_input-event-codes.h        | 15 ++++
 libopeninput/patches/patch-include_linux_input.h   | 15 ++++
 libopeninput/patches/patch-meson.build             | 96 ++++++++++++++++++++++
 libopeninput/patches/patch-src_libinput-private.h  | 15 ++++
 libopeninput/patches/patch-src_libinput-util.h     | 15 ++++
 libopeninput/patches/patch-src_util-strings.h      | 15 ++++
 libopeninput/patches/patch-src_wscons.c            | 24 ++++++
 13 files changed, 332 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 320f826d22..82f02c8f06 100644
--- a/Makefile
+++ b/Makefile
@@ -1743,6 +1743,7 @@ SUBDIR+=	infraarcana
 SUBDIR+=	inicpp
 SUBDIR+=	initware-git
 SUBDIR+=	innernet
+SUBDIR+=	input-headers
 SUBDIR+=	input-leap
 SUBDIR+=	input-ttf
 SUBDIR+=	intel-gpu-tools
@@ -2039,6 +2040,7 @@ SUBDIR+=	libeio-cvs
 SUBDIR+=	libepc
 SUBDIR+=	libeps
 SUBDIR+=	libevdev
+SUBDIR+=	libevdev-chunk
 SUBDIR+=	libevhtp
 SUBDIR+=	libexact
 SUBDIR+=	libfirm-git
@@ -2118,6 +2120,7 @@ SUBDIR+=	libnsl
 SUBDIR+=	libntfs
 SUBDIR+=	libode
 SUBDIR+=	liboglappth
+SUBDIR+=	libopeninput
 SUBDIR+=	libopenmodeller
 SUBDIR+=	libopenshot
 SUBDIR+=	libopenshot-audio
diff --git a/libopeninput/DESCR b/libopeninput/DESCR
new file mode 100644
index 0000000000..d5da285300
--- /dev/null
+++ b/libopeninput/DESCR
@@ -0,0 +1,4 @@
+The libinput is an input device management and event
+handling library to linux.
+The libopeninput is a wscons(4) and kqueue(2) based
+reimplementation of libinput, originally to OpenBSD.
diff --git a/libopeninput/Makefile b/libopeninput/Makefile
new file mode 100644
index 0000000000..d8bd1aa294
--- /dev/null
+++ b/libopeninput/Makefile
@@ -0,0 +1,27 @@
+# $NetBSD$
+
+DISTNAME=	libopeninput-1.26.2
+CATEGORIES=	devel
+MASTER_SITES=	${MASTER_SITE_GITHUB:=sizeofvoid/}
+GITHUB_TAG=	cf9699e76e41bf1b824c3820d06d36a2b0fbb8c1
+
+MAINTAINER=	kikadf.01%gmail.com@localhost
+HOMEPAGE=	https://github.com/sizeofvoid/libopeninput/tree/build-on-openbsd/
+COMMENT=	Wscons(4) and kqueue(2) based port of libinput
+LICENSE=	mit
+
+USE_TOOLS+=	pkg-config
+
+MESON_ARGS+=	-Dlibwacom=false
+MESON_ARGS+=	-Ddocumentation=false
+MESON_ARGS+=	-Dtests=false
+
+CFLAGS+=	-O0 -g
+LDFLAGS+=	-levdev
+
+.include "../../devel/meson/build.mk"
+.include "../../devel/libepoll-shim/buildlink3.mk"
+.include "../../wip/input-headers/buildlink3.mk"
+.include "../../wip/libevdev-chunk/buildlink3.mk"
+.include "../../wip/libudev-bsd/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/libopeninput/PLIST b/libopeninput/PLIST
new file mode 100644
index 0000000000..a25f513fc9
--- /dev/null
+++ b/libopeninput/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/libopeninput/buildlink3.mk b/libopeninput/buildlink3.mk
new file mode 100644
index 0000000000..3c489ec19a
--- /dev/null
+++ b/libopeninput/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	libopeninput
+
+.if !defined(LIBOPENINPUT_BUILDLINK3_MK)
+LIBOPENINPUT_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libopeninput+=	libopeninput>=1.26.2
+BUILDLINK_ABI_DEPENDS.libopeninput+=	libopeninput>=1.26.2
+BUILDLINK_PKGSRCDIR.libopeninput?=	../../wip/libopeninput
+
+.endif # LIBOPENINPUT_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libopeninput
diff --git a/libopeninput/distinfo b/libopeninput/distinfo
new file mode 100644
index 0000000000..9607114f06
--- /dev/null
+++ b/libopeninput/distinfo
@@ -0,0 +1,12 @@
+$NetBSD$
+
+BLAKE2s (libopeninput-1.26.2-cf9699e76e41bf1b824c3820d06d36a2b0fbb8c1.tar.gz) = 1f6036108dd3f9d1179b7db3332d31221c37be2d38dd311ca1ba0478c4f2f29d
+SHA512 (libopeninput-1.26.2-cf9699e76e41bf1b824c3820d06d36a2b0fbb8c1.tar.gz) = 197402a36b9536823fd8c47ce328187503cfc45a6a850b823aedb28e0fae57d1f85952c35c5c6de59c7084c28f2a6a601385b55c1192c52b859736b54a331ed3
+Size (libopeninput-1.26.2-cf9699e76e41bf1b824c3820d06d36a2b0fbb8c1.tar.gz) = 1057791 bytes
+SHA1 (patch-include_linux_input-event-codes.h) = 57a4efc3892638eeb7d15a7a03c686d4e602f938
+SHA1 (patch-include_linux_input.h) = 70b682671da5947e10411ebf5a0ffcd9b638e15a
+SHA1 (patch-meson.build) = d02d88b9e001070eaf561390ed717db36c37faf0
+SHA1 (patch-src_libinput-private.h) = 5cd7e90b189d8e774e4d468261a0d1fdd3c6a831
+SHA1 (patch-src_libinput-util.h) = 26270e454c77a7299dafc441a5ffefee7aa6e57c
+SHA1 (patch-src_util-strings.h) = 569b41c73aa0ed03167c863bbe6c24889476bc6a
+SHA1 (patch-src_wscons.c) = 450658edab97988699169573f5c74afa00894166
diff --git a/libopeninput/patches/patch-include_linux_input-event-codes.h b/libopeninput/patches/patch-include_linux_input-event-codes.h
new file mode 100644
index 0000000000..944399fc89
--- /dev/null
+++ b/libopeninput/patches/patch-include_linux_input-event-codes.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Add NetBSD support
+
+--- include/linux/input-event-codes.h.orig	2025-08-17 15:49:37.000000000 +0000
++++ include/linux/input-event-codes.h
+@@ -1,7 +1,5 @@
+ #ifdef __linux__
+ #include "linux/input-event-codes.h"
+-#elif __OpenBSD__
+-#include "freebsd/input-event-codes.h"
+-#elif __FreeBSD__
++#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
+ #include "freebsd/input-event-codes.h"
+ #endif
diff --git a/libopeninput/patches/patch-include_linux_input.h b/libopeninput/patches/patch-include_linux_input.h
new file mode 100644
index 0000000000..d47be18096
--- /dev/null
+++ b/libopeninput/patches/patch-include_linux_input.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Add NetBSD support
+
+--- include/linux/input.h.orig	2025-08-17 15:49:37.000000000 +0000
++++ include/linux/input.h
+@@ -1,7 +1,5 @@
+ #ifdef __linux__
+ #include "linux/input.h"
+-#elif __OpenBSD__
+-#include "freebsd/input.h"
+-#elif __FreeBSD__
++#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
+ #include "freebsd/input.h"
+ #endif
diff --git a/libopeninput/patches/patch-meson.build b/libopeninput/patches/patch-meson.build
new file mode 100644
index 0000000000..b206c9d07a
--- /dev/null
+++ b/libopeninput/patches/patch-meson.build
@@ -0,0 +1,96 @@
+$NetBSD$
+
+* Add NetBSD support
+
+--- meson.build.orig	2025-08-17 15:49:37.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',
+@@ -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/libopeninput/patches/patch-src_libinput-private.h b/libopeninput/patches/patch-src_libinput-private.h
new file mode 100644
index 0000000000..dfc0d6fd17
--- /dev/null
+++ b/libopeninput/patches/patch-src_libinput-private.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Add NetBSD support
+
+--- src/libinput-private.h.orig	2025-08-17 15:49:37.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/libopeninput/patches/patch-src_libinput-util.h b/libopeninput/patches/patch-src_libinput-util.h
new file mode 100644
index 0000000000..9c62441ce1
--- /dev/null
+++ b/libopeninput/patches/patch-src_libinput-util.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Add NetBSD support
+
+--- src/libinput-util.h.orig	2025-08-17 15:49:37.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/libopeninput/patches/patch-src_util-strings.h b/libopeninput/patches/patch-src_util-strings.h
new file mode 100644
index 0000000000..f3500285c8
--- /dev/null
+++ b/libopeninput/patches/patch-src_util-strings.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Add NetBSD support
+
+--- src/util-strings.h.orig	2025-08-17 15:49:37.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/libopeninput/patches/patch-src_wscons.c b/libopeninput/patches/patch-src_wscons.c
new file mode 100644
index 0000000000..1e4d587ea4
--- /dev/null
+++ b/libopeninput/patches/patch-src_wscons.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* Hide unsupported events on NetBSD
+
+--- src/wscons.c.orig	2025-09-09 13:28:44.467395163 +0000
++++ src/wscons.c
+@@ -209,13 +209,17 @@ wscons_process(struct libinput_device *d
+ 		axis_notify_event(device, time, &accel, &raw);
+ 		break;
+ 
++#ifndef __NetBSD__
+ 	case WSCONS_EVENT_SYNC:
+ 		break;
++#endif
+ 
+ 	case WSCONS_EVENT_MOUSE_ABSOLUTE_Z:
+ 	case WSCONS_EVENT_MOUSE_ABSOLUTE_W:
++#ifndef __NetBSD__
+ 	case WSCONS_EVENT_TOUCH_WIDTH:
+ 	case WSCONS_EVENT_TOUCH_RESET:
++#endif
+ 		/* ignore those */
+ 		break;
+ 	default:


Home | Main Index | Thread Index | Old Index