diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-05-28 15:53:30 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-05-29 06:39:14 -0700 |
commit | 0021b0d85b5ecfab713ed14e1ae874f0160455ef (patch) | |
tree | 0a6e73c8d96b8757badbbf90c591685e31d22c1f /meta-python/recipes-devtools | |
parent | 4770284e6dbb1428c40d46d3e0efc15d7eb822ba (diff) | |
download | meta-openembedded-0021b0d85b5ecfab713ed14e1ae874f0160455ef.tar.gz |
python3-uinput: Fix build on 32bit arches using 64bit times_t
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Diffstat (limited to 'meta-python/recipes-devtools')
-rw-r--r-- | meta-python/recipes-devtools/python/python3-uinput/0001-Deal-with-64bit-time_t-default-on-32bit-architecture.patch | 43 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-uinput_0.11.2.bb | 4 |
2 files changed, 46 insertions, 1 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..4095fc9095 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-uinput/0001-Deal-with-64bit-time_t-default-on-32bit-architecture.patch @@ -0,0 +1,43 @@ +From 69adf9e32f5b11e15c0cbe17f9331c77fed65bf8 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 28 May 2022 15:50:50 -0700 +Subject: [PATCH] Deal with 64bit time_t default on 32bit architectures + +Deal with Y2K38 concerns related to Linux input events on more recent +kernels and libcs on 32-bit systems + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + libsuinput/src/suinput.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/libsuinput/src/suinput.c b/libsuinput/src/suinput.c +index 8d5fb71..13ff16a 100644 +--- a/libsuinput/src/suinput.c ++++ b/libsuinput/src/suinput.c +@@ -45,11 +45,20 @@ int suinput_emit(int uinput_fd, uint16_t ev_type, uint16_t ev_code, + struct input_event event; + + memset(&event, 0, sizeof(event)); +- gettimeofday(&event.time, 0); + event.type = ev_type; + event.code = ev_code; + event.value = ev_value; + ++/* attempt to deal with 64-bit time keeping on recent 32-bit systems */ ++#if (__BITS_PER_LONG != 32 || !defined(__USE_TIME_BITS64)) ++ gettimeofday(&event.time, 0); ++#else ++ struct timeval now; ++ memset(&now, 0, sizeof(now)); ++ gettimeofday(&now, 0); ++ event.input_event_sec = now.tv_sec; ++ event.input_event_usec = now.tv_usec; ++#endif + return suinput_write_event(uinput_fd, &event); + } + +-- +2.36.1 + diff --git a/meta-python/recipes-devtools/python/python3-uinput_0.11.2.bb b/meta-python/recipes-devtools/python/python3-uinput_0.11.2.bb index 737bbfe2c8..ef466539bd 100644 --- a/meta-python/recipes-devtools/python/python3-uinput_0.11.2.bb +++ b/meta-python/recipes-devtools/python/python3-uinput_0.11.2.bb @@ -3,8 +3,10 @@ HOMEPAGE = "https://pypi.org/project/python-uinput/" LICENSE = "GPL-3.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949" +SRC_URI += "file://0001-setup-use-setuptools-instead-of-distutils.patch \ + file://0001-Deal-with-64bit-time_t-default-on-32bit-architecture.patch \ +" SRC_URI[sha256sum] = "99392b676c77b5795b86b7d75274db33fe754fd1e06fb3d58b167c797dc47f0c" -SRC_URI += "file://0001-setup-use-setuptools-instead-of-distutils.patch" PYPI_PACKAGE = "python-uinput" |