diff --git a/testing/enjoy/0001-fix-printf-format-specifier.patch b/testing/enjoy/0001-fix-printf-format-specifier.patch new file mode 100644 index 00000000000..01db8593865 --- /dev/null +++ b/testing/enjoy/0001-fix-printf-format-specifier.patch @@ -0,0 +1,28 @@ +From 33a2902f242ad95308a5970a88369d0100a4c66a Mon Sep 17 00:00:00 2001 +From: Marian Buschsieweke +Date: Wed, 23 Mar 2022 17:26:05 +0100 +Subject: [PATCH] fix printf format specifier + +`%ld` is the format specifier for long. The correct format specifier +for `size_t` is `%zu`. Because `%zu` is somewhat obscure, cast the +`size_t` variable to `long` instead and keep `%ld`. +--- + enjoy.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/enjoy.c b/enjoy.c +index a698f17..4f0bf33 100644 +--- a/enjoy.c ++++ b/enjoy.c +@@ -410,7 +410,7 @@ int main(int argc, char *argv[]) + break; + + char axis_as_mouse_key[20]; +- sprintf(axis_as_mouse_key, "axis%ld_as_mouse", axis); ++ sprintf(axis_as_mouse_key, "axis%zu_as_mouse", axis); + /* null to 0. */ + if(!(atoi(cfg_get(cfg, axis_as_mouse_key) ? cfg_get(cfg, axis_as_mouse_key) : "0"))) { + if(axes[axis].x != 0 || axes[axis].y != 0) +-- +2.35.1 + diff --git a/testing/enjoy/0002-fix-setting-timestamp-of-input-event.patch b/testing/enjoy/0002-fix-setting-timestamp-of-input-event.patch new file mode 100644 index 00000000000..1b567840b96 --- /dev/null +++ b/testing/enjoy/0002-fix-setting-timestamp-of-input-event.patch @@ -0,0 +1,37 @@ +From 9c35cf9caf031d6f67ec0211b8125d76f1983f58 Mon Sep 17 00:00:00 2001 +From: Marian Buschsieweke +Date: Wed, 23 Mar 2022 17:45:43 +0100 +Subject: [PATCH] fix setting timestamp of input event + +On (some) 32 bit systems `struct input_event` has no member `time`. +Instead, the macros `input_event_sec` and `input_event_usec` can be +used in a portable fashion to access the timestamp. +--- + uinput.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/uinput.c b/uinput.c +index 41e2cac..fe3a3d5 100644 +--- a/uinput.c ++++ b/uinput.c +@@ -17,12 +17,19 @@ + extern int axis_y_direction; + extern int motion_interval; + ++static void _set_input_time(struct input_event *ie) ++{ ++ struct timeval time; ++ gettimeofday(&time, NULL); ++ ie->input_event_sec = time.tv_sec; ++ ie->input_event_usec = time.tv_usec; ++} + + void emit(int fd, int type, int code, int val) + { + struct input_event ie; + memset(&ie, 0, sizeof(ie)); +- gettimeofday(&ie.time, NULL); ++ _set_input_time(&ie); + + ie.type = type; + ie.code = code; diff --git a/testing/enjoy/APKBUILD b/testing/enjoy/APKBUILD new file mode 100644 index 00000000000..5273ae38b09 --- /dev/null +++ b/testing/enjoy/APKBUILD @@ -0,0 +1,31 @@ +# Maintainer: Marian Buschsieweke +# Contributor: Marian Buschsieweke +pkgname=enjoy +pkgver=0.3 +pkgrel=0 +pkgdesc="daemon to map joystick events to mouse/key events" +url="https://github.com/cjacker/enjoy" +arch="all" +license="MIT" +source=" + $pkgname-$pkgver.tar.gz::https://github.com/cjacker/enjoy/archive/refs/tags/v$pkgver.tar.gz + + 0001-fix-printf-format-specifier.patch + 0002-fix-setting-timestamp-of-input-event.patch + " +makedepends="linux-headers" +options="!check" # no unit tests provided + +build() { + make +} + +package() { + make DESTDIR="$pkgdir" install +} + +sha512sums=" +02dc462f8e2d88e090242ac28612e362baabd9d7071a8e9143f6e1d92f8a23ce747fd470fbb795c57d245908de6d42d5540273e755eecbac6c06c1ef26c7ba5c enjoy-0.3.tar.gz +37e2bc17aadf40e1a3bbbf412f34e51e897bf529121283a025eb7915248f211e5fdeffa4d82e07e816fed666dbcdadd865e59b7980ce5c76e95c7c92b60a08f1 0001-fix-printf-format-specifier.patch +6e89859c5b8752021e1517d2cfdb9a7e9e3bc89098cacbe4845c5ff76aed7b777949efaaeea152ee21a8cdc27112a34b3df2c0015fadc317e756ca626a735791 0002-fix-setting-timestamp-of-input-event.patch +"