From 285e2374c011eda3b666d43df8e220bdd234dab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= <pullmoll@t-online.de> Date: Mon, 14 Dec 2020 14:53:46 +0100 Subject: [PATCH] pyhton-evdev: fix build w/ musl-1.2.1 (time64) --- srcpkgs/python-evdev/patches/time64.patch | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 srcpkgs/python-evdev/patches/time64.patch diff --git a/srcpkgs/python-evdev/patches/time64.patch b/srcpkgs/python-evdev/patches/time64.patch new file mode 100644 index 0000000000..d65d6fa896 --- /dev/null +++ b/srcpkgs/python-evdev/patches/time64.patch @@ -0,0 +1,45 @@ +--- evdev/input.c 2019-04-07 17:40:25.000000000 +0200 ++++ evdev/input.c 2020-12-14 14:48:49.568344738 +0100 +@@ -60,8 +60,8 @@ + return NULL; + } + +- PyObject* sec = PyLong_FromLong(event.time.tv_sec); +- PyObject* usec = PyLong_FromLong(event.time.tv_usec); ++ PyObject* sec = PyLong_FromLong(event.input_event_sec); ++ PyObject* usec = PyLong_FromLong(event.input_event_usec); + PyObject* val = PyLong_FromLong(event.value); + PyObject* py_input_event = NULL; + +@@ -102,8 +102,8 @@ + + // Construct a list of event tuples, which we'll make sense of in Python + for (unsigned i = 0 ; i < nread/event_size ; i++) { +- sec = PyLong_FromLong(event[i].time.tv_sec); +- usec = PyLong_FromLong(event[i].time.tv_usec); ++ sec = PyLong_FromLong(event[i].input_event_sec); ++ usec = PyLong_FromLong(event[i].input_event_usec); + val = PyLong_FromLong(event[i].value); + + py_input_event = Py_BuildValue("OOhhO", sec, usec, event[i].type, event[i].code, val); +--- evdev/uinput.c 2019-04-07 17:40:25.000000000 +0200 ++++ evdev/uinput.c 2020-12-14 14:51:58.809761744 +0100 +@@ -226,6 +226,7 @@ + static PyObject * + uinput_write(PyObject *self, PyObject *args) + { ++ struct timeval tv; + int fd, type, code, value; + + int ret = PyArg_ParseTuple(args, "iiii", &fd, &type, &code, &value); +@@ -233,7 +234,9 @@ + + struct input_event event; + memset(&event, 0, sizeof(event)); +- gettimeofday(&event.time, 0); ++ gettimeofday(&tv, 0); ++ event.input_event_sec = tv.tv_sec; ++ event.input_event_usec = tv.tv_usec; + event.type = type; + event.code = code; + event.value = value;