Index | Thread | Search

From:
SASANO Takayoshi <uaa@mx5.nisiq.net>
Subject:
[UPDATE] wayland/livevdev-20231111p1
To:
ports@cvs.openbsd.org
Date:
Sun, 23 Nov 2025 23:15:27 +0900

Download raw body.

Thread
Hello,

I am trying to build aquamarine library
(https://github.com/hyprwm/aquamarine) for Hyprland window manager.

And I found libinput-openbsd calls following funcions of libevdev
but they are not implemented.

	libevdev_event_type_from_name
	libevdev_property_from_name

Here is the patch to add them, ok?

Index: Makefile
===================================================================
RCS file: /cvs/ports/wayland/libevdev-openbsd/Makefile,v
diff -u -p -r1.6 Makefile
--- Makefile	2 Jun 2025 19:03:24 -0000	1.6
+++ Makefile	23 Nov 2025 14:07:41 -0000
@@ -8,7 +8,7 @@
 COMMENT		= minimal set of libevedev functions for Wayland on OpenBSD
 
 V		= 20231111
-REVISION	= 0
+REVISION	= 1
 DISTNAME	= libevdev-openbsd-$V
 CATEGORIES	= wayland
 
Index: patches/patch-libevdev_c
===================================================================
RCS file: patches/patch-libevdev_c
diff -N patches/patch-libevdev_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-libevdev_c	23 Nov 2025 14:07:41 -0000
@@ -0,0 +1,36 @@
+--- libevdev.c.orig	Sat Nov 11 23:32:38 2023
++++ libevdev.c	Sun Nov 23 21:38:14 2025
+@@ -140,3 +140,33 @@ libevdev_event_code_from_name(unsigned int type, const
+ 
+ 	return entry ? (int)entry->value : -1;
+ }
++
++int
++libevdev_event_type_from_name(const char *name)
++{
++	struct name_lookup lookup;
++	const struct name_entry *entry;
++	size_t len = strlen(name);
++
++	lookup.name = name;
++	lookup.len = len;
++
++	entry = lookup_name(ev_names, ARRAY_LENGTH(ev_names), &lookup);
++
++	return entry ? (int)entry->value : -1;
++}
++
++int
++libevdev_property_from_name(const char *name)
++{
++	struct name_lookup lookup;
++	const struct name_entry *entry;
++	size_t len = strlen(name);
++
++	lookup.name = name;
++	lookup.len = len;
++
++	entry = lookup_name(prop_names, ARRAY_LENGTH(prop_names), &lookup);
++
++	return entry ? (int)entry->value : -1;
++}
Index: patches/patch-libevdev_libevdev_h
===================================================================
RCS file: patches/patch-libevdev_libevdev_h
diff -N patches/patch-libevdev_libevdev_h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-libevdev_libevdev_h	23 Nov 2025 14:07:41 -0000
@@ -0,0 +1,11 @@
+--- libevdev/libevdev.h.orig	Sat Nov 11 23:32:38 2023
++++ libevdev/libevdev.h	Sun Nov 23 21:38:14 2025
+@@ -31,6 +31,8 @@ extern "C" {
+ #endif
+ extern int libevdev_event_code_from_name(unsigned int type, const char *name);
+ extern const char * libevdev_event_code_get_name(unsigned int type, unsigned int code);
++extern int libevdev_event_type_from_name(const char *name);
++extern int libevdev_property_from_name(const char *name);
+ #ifdef __cplusplus
+ }
+ #endif


-- 
SASANO Takayoshi (JG1UAA) <uaa@mx5.nisiq.net>