libinput: unbundle mtdev, libevdev

This commit is contained in:
git-bruh 2022-09-30 14:30:55 +05:30
parent ff82189547
commit bccd03fd1d
No known key found for this signature in database
14 changed files with 23 additions and 139 deletions

7
wayland/libevdev/build Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh -e
./configure \
--prefix=/usr
make
make DESTDIR="$1" install

View File

@ -0,0 +1 @@
9edf2006cc86a5055279647c38ec923d11a821ee4dc2c3033e8d20e8ee237cd9

1
wayland/libevdev/sources Normal file
View File

@ -0,0 +1 @@
https://freedesktop.org/software/libevdev/libevdev-VERSION.tar.xz

1
wayland/libevdev/version Normal file
View File

@ -0,0 +1 @@
1.13.0 1

View File

@ -1,30 +1,12 @@
#!/bin/sh -e #!/bin/sh -e
patch -p1 < evdev-wrap.patch
export CFLAGS="$CFLAGS -fPIC" export CFLAGS="$CFLAGS -fPIC"
for pkg in mtdev evdev; do (
cd "$pkg"
./configure \
--prefix=/usr \
--disable-shared \
--disable-gcov
make
make DESTDIR="$OLDPWD" install
) done
# Build fails with clang due to -Werror (forced on) and # Build fails with clang due to -Werror (forced on) and
# -Wunused-command-line-argument which is triggered by. # -Wunused-command-line-argument which is triggered by.
# the below CFLAGS. # the below CFLAGS.
export CFLAGS="-Wno-unused-command-line-argument $CFLAGS" export CFLAGS="-Wno-unused-command-line-argument $CFLAGS"
export PKG_CONFIG_PATH="$PWD/usr/lib/pkgconfig"
export CFLAGS="$CFLAGS -I$PWD/usr/include -L$PWD/usr/lib"
export CFLAGS="$CFLAGS -I$PWD/usr/include/libevdev-1.0"
meson \ meson \
--prefix=/usr \ --prefix=/usr \
--sysconfdir=/etc \ --sysconfdir=/etc \

View File

@ -1,4 +1 @@
1b23c180f5b297303ed36f5a549910f5d320b0eb21052eac67a966d4eaa4e01d 1b23c180f5b297303ed36f5a549910f5d320b0eb21052eac67a966d4eaa4e01d
15d7b28da8ac71d8bc8c9287c2045fd174267bc740bec10cfda332dc1204e0e0
9edf2006cc86a5055279647c38ec923d11a821ee4dc2c3033e8d20e8ee237cd9
9667e17dada5e8f7383b547a165a4df9d335fa5540787f53e4f46b45750652b6

View File

@ -1,4 +1,6 @@
libevdev
libudev-zero libudev-zero
linux-headers make linux-headers make
meson make meson make
mtdev
pkgconf make pkgconf make

View File

@ -1,114 +0,0 @@
diff --git a/src/evdev.c b/src/evdev.c
index 0f892b8..12fdaf2 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -133,6 +133,17 @@ evdev_update_key_down_count(struct evdev_device *device,
return key_count;
}
+int
+evdev_event_code_from_name(unsigned int type, const char *name)
+{
+ return libevdev_event_code_from_name(type, name);
+}
+
+const char *
+evdev_event_code_get_name (unsigned int type, unsigned int code) {
+ return libevdev_event_code_get_name(type, code);
+}
+
enum libinput_switch_state
evdev_device_switch_get_state(struct evdev_device *device,
enum libinput_switch sw)
diff --git a/src/evdev.h b/src/evdev.h
index 0a4798f..352c22b 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -401,6 +401,12 @@ evdev_device_has_model_quirk(struct evdev_device *device,
return result;
}
+int
+evdev_event_code_from_name(unsigned int type, const char *name);
+
+const char *
+evdev_event_code_get_name (unsigned int type, unsigned int code);
+
void
evdev_transform_absolute(struct evdev_device *device,
struct device_coords *point);
diff --git a/src/libinput.c b/src/libinput.c
index b4164e2..b2ff1f3 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -310,6 +310,17 @@ log_msg_ratelimit(struct libinput *libinput,
us2ms(ratelimit->interval));
}
+LIBINPUT_EXPORT int
+libinput_event_code_from_name(unsigned int type, const char *name)
+{
+ return evdev_event_code_from_name(type, name);
+}
+
+LIBINPUT_EXPORT const char *
+libinput_event_code_get_name (unsigned int type, unsigned int code) {
+ return evdev_event_code_get_name(type, code);
+}
+
LIBINPUT_EXPORT void
libinput_log_set_priority(struct libinput *libinput,
enum libinput_log_priority priority)
diff --git a/src/libinput.h b/src/libinput.h
index a15d627..edb8849 100644
--- a/src/libinput.h
+++ b/src/libinput.h
@@ -416,6 +416,35 @@ enum libinput_tablet_tool_tip_state {
*/
struct libinput_tablet_pad_mode_group;
+
+/**
+ * @ingroup base
+ *
+ * A wrapper around libevdev_event_code_from_name for use in sway.
+ * For use in KISS Linux.
+ *
+ * @param type The event type (EV_* constant) where to look for the name.
+ * @param name A non-NULL string describing an input-event code, zero-terminated.
+ *
+ * @return The given code constant for the passed name or -1 if not found.
+ */
+int
+libinput_event_code_from_name(unsigned int type, const char *name);
+
+/**
+ * @ingroup base
+ *
+ * A wrapper around libevdev_event_code_get_name for use in sway.
+ * For use in KISS Linux.
+ *
+ * @param type The event type for the code to query (EV_SYN, EV_REL, etc.)
+ * @param code The event code to return the name for (e.g. ABS_X)
+ *
+ * @return The name of the given event code or NULL for an invalid type or code.
+ */
+const char *
+libinput_event_code_get_name(unsigned int type, unsigned int code);
+
/**
* @ingroup tablet_pad_modes
*
diff --git a/src/libinput.sym b/src/libinput.sym
index b45838e..ce88063 100644
--- a/src/libinput.sym
+++ b/src/libinput.sym
@@ -61,6 +61,8 @@ global:
libinput_device_set_user_data;
libinput_device_unref;
libinput_dispatch;
+ libinput_event_code_from_name;
+ libinput_event_code_get_name;
libinput_event_destroy;
libinput_event_device_notify_get_base_event;
libinput_event_get_context;

View File

@ -1,4 +1 @@
https://gitlab.freedesktop.org/libinput/libinput/-/archive/VERSION/libinput-VERSION.tar.gz https://gitlab.freedesktop.org/libinput/libinput/-/archive/VERSION/libinput-VERSION.tar.gz
https://bitmath.org/code/mtdev/mtdev-1.1.6.tar.bz2 mtdev
https://freedesktop.org/software/libevdev/libevdev-1.13.0.tar.xz evdev
patches/evdev-wrap.patch

View File

@ -1 +1 @@
1.21.0 2 1.21.0 3

7
wayland/mtdev/build Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh -e
./configure \
--prefix=/usr
make
make DESTDIR="$1" install

1
wayland/mtdev/checksums Normal file
View File

@ -0,0 +1 @@
15d7b28da8ac71d8bc8c9287c2045fd174267bc740bec10cfda332dc1204e0e0

1
wayland/mtdev/sources Normal file
View File

@ -0,0 +1 @@
https://bitmath.org/code/mtdev/mtdev-VERSION.tar.bz2

1
wayland/mtdev/version Normal file
View File

@ -0,0 +1 @@
1.1.6 1