summaryrefslogtreecommitdiffstats
path: root/meta-python
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python')
-rw-r--r--meta-python/recipes-devtools/python/python3-uinput/0001-Deal-with-64bit-time_t-default-on-32bit-architecture.patch48
-rw-r--r--meta-python/recipes-devtools/python/python3-uinput_1.0.1.bb18
2 files changed, 66 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-uinput/0001-Deal-with-64bit-time_t-default-on-32bit-architecture.patch b/meta-python/recipes-devtools/python/python3-uinput/0001-Deal-with-64bit-time_t-default-on-32bit-architecture.patch
new file mode 100644
index 0000000000..8658c83f82
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-uinput/0001-Deal-with-64bit-time_t-default-on-32bit-architecture.patch
@@ -0,0 +1,48 @@
1From 84d40417fcf58ed123cd0040e5e5678ec12e68b2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 28 May 2022 15:50:50 -0700
4Subject: [PATCH] Deal with 64bit time_t default on 32bit architectures
5
6Deal with Y2K38 concerns related to Linux input events on more recent
7kernels and libcs on 32-bit systems
8
9Original-Author: Khem Raj <raj.khem@gmail.com>
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
13
14Upstream-Status: Submitted [https://github.com/pyinput/python-uinput/pull/2]
15
16---
17 libsuinput/src/suinput.c | 11 ++++++++++-
18 1 file changed, 10 insertions(+), 1 deletion(-)
19
20diff --git a/libsuinput/src/suinput.c b/libsuinput/src/suinput.c
21index 8d5fb71..13ff16a 100644
22--- a/libsuinput/src/suinput.c
23+++ b/libsuinput/src/suinput.c
24@@ -45,11 +45,20 @@ int suinput_emit(int uinput_fd, uint16_t ev_type, uint16_t ev_code,
25 struct input_event event;
26
27 memset(&event, 0, sizeof(event));
28- gettimeofday(&event.time, 0);
29 event.type = ev_type;
30 event.code = ev_code;
31 event.value = ev_value;
32
33+/* attempt to deal with 64-bit time keeping on recent 32-bit systems */
34+#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64))
35+ gettimeofday(&event.time, 0);
36+#else
37+ struct timeval now;
38+ memset(&now, 0, sizeof(now));
39+ gettimeofday(&now, 0);
40+ event.input_event_sec = now.tv_sec;
41+ event.input_event_usec = now.tv_usec;
42+#endif
43 return suinput_write_event(uinput_fd, &event);
44 }
45
46--
472.34.1
48
diff --git a/meta-python/recipes-devtools/python/python3-uinput_1.0.1.bb b/meta-python/recipes-devtools/python/python3-uinput_1.0.1.bb
new file mode 100644
index 0000000000..7c1eb85264
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-uinput_1.0.1.bb
@@ -0,0 +1,18 @@
1SUMMARY = "Python interface to Linux uinput kernel module."
2HOMEPAGE = "https://pypi.org/project/python-uinput/"
3LICENSE = "GPL-3.0-only"
4LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
5
6SRC_URI += "file://0001-Deal-with-64bit-time_t-default-on-32bit-architecture.patch"
7SRC_URI[sha256sum] = "853697344b64df5537d4ae32ba6fbcf0515d51a9010910f5d5019959038b6eba"
8
9PYPI_PACKAGE = "python-uinput"
10
11inherit pypi setuptools3
12
13DEPENDS += "udev"
14RDEPENDS:${PN} += " \
15 python3-ctypes \
16 python3-setuptools \
17"
18RRECOMMENDS:${PN} += "kernel-module-uinput"