sway-no-seat: remove libevdev dependency

This commit is contained in:
Dylan Araps 2021-07-09 12:39:57 +03:00
parent 7e2f255022
commit 5bb12f47ab
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C
5 changed files with 122 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#!/bin/sh -e
patch -p1 < sway-static.patch
patch -p1 < no-evdev.patch
# Remove conflict between static libseat and wlroots.
sed 's/\(const long NSEC\)/static \1/' \

View File

@ -2,3 +2,4 @@ b411c21e7e87956b78fd91e64383086228d16e391116088a839ee005e563b376
af512d4abce21e200381f0d40e1e745c03a2f33f62c8453c50a9580851a6b228
45de0d0b7135d4c11cd9a2e8ddf8c0f179ecfb45987d205e35711e1a0a432a99
0c0777dc70569be07bf602b55628c474a5ceb256650e4bcccaefd4038ae4a655
4cd41a212fd9ab7c6e4743efaa325ca5333d13304b32cb3025ba73abf1d183b2

View File

@ -1,7 +1,6 @@
cairo
flex make
json-c
libevdev
libinput
libxkbcommon
linux-headers make

View File

@ -0,0 +1,119 @@
diff --git a/meson.build b/meson.build
index 6461ff1..fa1de0b 100644
--- a/meson.build
+++ b/meson.build
@@ -49,7 +49,6 @@ pangocairo = dependency('pangocairo')
gdk_pixbuf = dependency('gdk-pixbuf-2.0', required: get_option('gdk-pixbuf'))
pixman = dependency('pixman-1')
glesv2 = dependency('glesv2')
-libevdev = dependency('libevdev')
libinput = dependency('libinput', version: '>=1.6.0')
xcb = dependency('xcb', required: get_option('xwayland'))
drm_full = dependency('libdrm') # only needed for drm_fourcc.h
diff --git a/sway/commands/bar/bind.c b/sway/commands/bar/bind.c
index b4b5bc4..2770312 100644
--- a/sway/commands/bar/bind.c
+++ b/sway/commands/bar/bind.c
@@ -1,4 +1,4 @@
-#include <libevdev/libevdev.h>
+#include <linux/input-event-codes.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 4c67b3c..e9c0eab 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -1,5 +1,4 @@
#define _POSIX_C_SOURCE 200809L
-#include <libevdev/libevdev.h>
#include <linux/input-event-codes.h>
#include <string.h>
#include <strings.h>
diff --git a/sway/commands/input/scroll_button.c b/sway/commands/input/scroll_button.c
index 6b33141..039f533 100644
--- a/sway/commands/input/scroll_button.c
+++ b/sway/commands/input/scroll_button.c
@@ -1,4 +1,4 @@
-#include <libevdev/libevdev.h>
+#include <linux/input-event-codes.h>
#include "sway/config.h"
#include "sway/commands.h"
#include "sway/input/cursor.h"
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 95edf7b..99df15f 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -1,7 +1,7 @@
#define _POSIX_C_SOURCE 200809L
#include <assert.h>
#include <math.h>
-#include <libevdev/libevdev.h>
+#include <libinput.h>
#include <linux/input-event-codes.h>
#include <errno.h>
#include <time.h>
@@ -1202,7 +1202,7 @@ uint32_t get_mouse_bindsym(const char *name, char **error) {
return buttons[number - 1];
} else if (strncmp(name, "BTN_", strlen("BTN_")) == 0) {
// Get event code from name
- int code = libevdev_event_code_from_name(EV_KEY, name);
+ int code = libinput_event_code_from_name(EV_KEY, name);
if (code == -1) {
size_t len = snprintf(NULL, 0, "Unknown event %s", name) + 1;
*error = malloc(len);
@@ -1228,7 +1228,7 @@ uint32_t get_mouse_bindcode(const char *name, char **error) {
*error = strdup("Button event code out of range.");
return 0;
}
- const char *event = libevdev_event_code_get_name(EV_KEY, code);
+ const char *event = libinput_event_code_get_name(EV_KEY, code);
if (!event || strncmp(event, "BTN_", strlen("BTN_")) != 0) {
size_t len = snprintf(NULL, 0, "Event code %d (%s) is not a button",
code, event ? event : "(null)") + 1;
@@ -1251,7 +1251,7 @@ uint32_t get_mouse_button(const char *name, char **error) {
}
const char *get_mouse_button_name(uint32_t button) {
- const char *name = libevdev_event_code_get_name(EV_KEY, button);
+ const char *name = libinput_event_code_get_name(EV_KEY, button);
if (!name) {
if (button == SWAY_SCROLL_UP) {
name = "SWAY_SCROLL_UP";
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c
index f9eb8c8..681ca26 100644
--- a/sway/input/seatop_default.c
+++ b/sway/input/seatop_default.c
@@ -1,6 +1,6 @@
#define _POSIX_C_SOURCE 200809L
#include <float.h>
-#include <libevdev/libevdev.h>
+#include <linux/input-event-codes.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_tablet_v2.h>
#include <wlr/types/wlr_xcursor_manager.h>
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 1b64f86..13fa7d4 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -1,7 +1,7 @@
#include <ctype.h>
#include <float.h>
#include <json.h>
-#include <libevdev/libevdev.h>
+#include <linux/input-event-codes.h>
#include <stdio.h>
#include <wlr/backend/libinput.h>
#include <wlr/types/wlr_output.h>
diff --git a/sway/meson.build b/sway/meson.build
index 1402db1..53ed355 100644
--- a/sway/meson.build
+++ b/sway/meson.build
@@ -207,7 +207,6 @@ sway_deps = [
cairo,
drm,
jsonc,
- libevdev,
libinput,
libudev,
math,

View File

@ -2,3 +2,4 @@ https://github.com/swaywm/sway/archive/4832fc937fae5a5e2af8828a7092c9026bd300e0.
https://github.com/swaywm/wlroots/archive/a48e569d3860e91428c74e876a5d886314767c7b.tar.gz subprojects/wlroots
https://github.com/DCVIII/seatd/archive/23ee555f432f9971a15522fc0b3f980d78ffa6cc.tar.gz subprojects/seatd
patches/sway-static.patch
patches/no-evdev.patch