summaryrefslogtreecommitdiffstats
path: root/meta-python
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python')
-rw-r--r--meta-python/recipes-devtools/python/python-evdev.inc6
-rw-r--r--meta-python/recipes-devtools/python/python-evdev/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch83
-rw-r--r--meta-python/recipes-devtools/python/python3-evdev_1.3.0.bb (renamed from meta-python/recipes-devtools/python/python3-evdev_1.2.0.bb)1
3 files changed, 4 insertions, 86 deletions
diff --git a/meta-python/recipes-devtools/python/python-evdev.inc b/meta-python/recipes-devtools/python/python-evdev.inc
index a536815358..5f5426aac7 100644
--- a/meta-python/recipes-devtools/python/python-evdev.inc
+++ b/meta-python/recipes-devtools/python/python-evdev.inc
@@ -5,10 +5,10 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=18debddbb3f52c661a129724a883a8e2"
5 5
6FILESEXTRAPATHS_prepend := "${THISDIR}/python-evdev:" 6FILESEXTRAPATHS_prepend := "${THISDIR}/python-evdev:"
7 7
8SRC_URI += " file://0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch" 8SRC_URI = "${PYPI_SRC_URI}"
9 9
10SRC_URI[md5sum] = "53e440943dfa2514f95b3c448d6a36cb" 10SRC_URI[md5sum] = "05f9e900d6e11e1674475d2dd2668f0d"
11SRC_URI[sha256sum] = "b03f5e1be5b4a5327494a981b831d251a142b09e8778eda1a8b53eba91100166" 11SRC_URI[sha256sum] = "b1c649b4fed7252711011da235782b2c260b32e004058d62473471e5cd30634d"
12 12
13do_compile_prepend() { 13do_compile_prepend() {
14 rm -rf ${S}/evdev/ecodes.c 14 rm -rf ${S}/evdev/ecodes.c
diff --git a/meta-python/recipes-devtools/python/python-evdev/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch b/meta-python/recipes-devtools/python/python-evdev/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch
deleted file mode 100644
index 154172ca88..0000000000
--- a/meta-python/recipes-devtools/python/python-evdev/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch
+++ /dev/null
@@ -1,83 +0,0 @@
1From 435e78aaf6745e4da0fe3d4455473011626c77d1 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 30 Nov 2019 11:21:20 -0800
4Subject: [PATCH] Fix build on 32bit arches with 64bit time_t
5
6time element is deprecated on new input_event structure in kernel's
7input.h [1]
8
9[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f
10
11Upstream-Status: Submitted [https://github.com/gvalkov/python-evdev/pull/112]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 evdev/input.c | 13 +++++++++----
15 evdev/uinput.c | 9 ++++++++-
16 2 files changed, 17 insertions(+), 5 deletions(-)
17
18diff --git a/evdev/input.c b/evdev/input.c
19index 67b9348..432db92 100644
20--- a/evdev/input.c
21+++ b/evdev/input.c
22@@ -24,6 +24,11 @@
23 #include <linux/input.h>
24 #endif
25
26+#ifndef input_event_sec
27+#define input_event_sec time.tv_sec
28+#define input_event_usec time.tv_usec
29+#endif
30+
31 #define MAX_NAME_SIZE 256
32
33 extern char* EV_NAME[EV_CNT];
34@@ -60,8 +65,8 @@ device_read(PyObject *self, PyObject *args)
35 return NULL;
36 }
37
38- PyObject* sec = PyLong_FromLong(event.time.tv_sec);
39- PyObject* usec = PyLong_FromLong(event.time.tv_usec);
40+ PyObject* sec = PyLong_FromLong(event.input_event_sec);
41+ PyObject* usec = PyLong_FromLong(event.input_event_usec);
42 PyObject* val = PyLong_FromLong(event.value);
43 PyObject* py_input_event = NULL;
44
45@@ -102,8 +107,8 @@ device_read_many(PyObject *self, PyObject *args)
46
47 // Construct a list of event tuples, which we'll make sense of in Python
48 for (unsigned i = 0 ; i < nread/event_size ; i++) {
49- sec = PyLong_FromLong(event[i].time.tv_sec);
50- usec = PyLong_FromLong(event[i].time.tv_usec);
51+ sec = PyLong_FromLong(event[i].input_event_sec);
52+ usec = PyLong_FromLong(event[i].input_event_usec);
53 val = PyLong_FromLong(event[i].value);
54
55 py_input_event = Py_BuildValue("OOhhO", sec, usec, event[i].type, event[i].code, val);
56diff --git a/evdev/uinput.c b/evdev/uinput.c
57index 192568d..56fe86c 100644
58--- a/evdev/uinput.c
59+++ b/evdev/uinput.c
60@@ -16,6 +16,10 @@
61 #include <linux/uinput.h>
62 #endif
63
64+#ifndef input_event_sec
65+#define input_event_sec time.tv_sec
66+#define input_event_usec time.tv_usec
67+#endif
68
69 // Workaround for installing on kernels newer than 4.4.
70 #ifndef FF_MAX_EFFECTS
71@@ -232,8 +236,11 @@ uinput_write(PyObject *self, PyObject *args)
72 if (!ret) return NULL;
73
74 struct input_event event;
75+ struct timeval tval;
76 memset(&event, 0, sizeof(event));
77- gettimeofday(&event.time, 0);
78+ gettimeofday(&tval, 0);
79+ event.input_event_usec = tval.tv_usec;
80+ event.input_event_sec = tval.tv_sec;
81 event.type = type;
82 event.code = code;
83 event.value = value;
diff --git a/meta-python/recipes-devtools/python/python3-evdev_1.2.0.bb b/meta-python/recipes-devtools/python/python3-evdev_1.3.0.bb
index 3a92b6ec96..d87bf2fec2 100644
--- a/meta-python/recipes-devtools/python/python3-evdev_1.2.0.bb
+++ b/meta-python/recipes-devtools/python/python3-evdev_1.3.0.bb
@@ -1,2 +1,3 @@
1inherit pypi setuptools3 1inherit pypi setuptools3
2require python-evdev.inc 2require python-evdev.inc
3