From 91f8512c8e97068876f9a4053775c7881e8b32d4 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 30 Nov 2019 20:26:53 -0800 Subject: utouch-evemu,utouch-frame: Fix build for 32bit arches with 64bit time_t Move patches from files/ directory into PN folders to avoid conflicts Signed-off-by: Khem Raj --- ...sys-stat.h-for-fixing-build-issue-on-musl.patch | 29 --------- .../utouch/files/remove-man-page-creation.patch | 16 ----- ...x-build-on-32bit-arches-with-64bit-time_t.patch | 76 ++++++++++++++++++++++ meta-oe/recipes-support/utouch/utouch-evemu_git.bb | 4 +- ...x-build-on-32bit-arches-with-64bit-time_t.patch | 41 ++++++++++++ ...sys-stat.h-for-fixing-build-issue-on-musl.patch | 29 +++++++++ .../utouch-frame/remove-man-page-creation.patch | 16 +++++ meta-oe/recipes-support/utouch/utouch-frame_git.bb | 1 + 8 files changed, 166 insertions(+), 46 deletions(-) delete mode 100644 meta-oe/recipes-support/utouch/files/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch delete mode 100644 meta-oe/recipes-support/utouch/files/remove-man-page-creation.patch create mode 100644 meta-oe/recipes-support/utouch/utouch-evemu/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch create mode 100644 meta-oe/recipes-support/utouch/utouch-frame/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch create mode 100644 meta-oe/recipes-support/utouch/utouch-frame/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch create mode 100644 meta-oe/recipes-support/utouch/utouch-frame/remove-man-page-creation.patch diff --git a/meta-oe/recipes-support/utouch/files/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch b/meta-oe/recipes-support/utouch/files/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch deleted file mode 100644 index f3c8eeb418..0000000000 --- a/meta-oe/recipes-support/utouch/files/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 08b17ec505e09e8f5a4d73ffc3aa61561ec2e0da Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 30 Mar 2017 00:27:54 -0700 -Subject: [PATCH] include sys/stat.h for fixing build issue on musl - -error: field has incomplete - type 'struct stat' - struct stat fs; - -Signed-off-by: Khem Raj ---- - tools/utouch-frame-test-mtdev.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tools/utouch-frame-test-mtdev.c b/tools/utouch-frame-test-mtdev.c -index 5253320..2032af4 100644 ---- a/tools/utouch-frame-test-mtdev.c -+++ b/tools/utouch-frame-test-mtdev.c -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - #include "common-defs.h" - - struct frame_test { --- -2.12.1 - diff --git a/meta-oe/recipes-support/utouch/files/remove-man-page-creation.patch b/meta-oe/recipes-support/utouch/files/remove-man-page-creation.patch deleted file mode 100644 index 8706d91234..0000000000 --- a/meta-oe/recipes-support/utouch/files/remove-man-page-creation.patch +++ /dev/null @@ -1,16 +0,0 @@ -configure.ac: never generate the docs even if a2x is found as xmllint will fail finding custom dtd files - -Upstream-Status: Inappropriate [embedded specific] - -Signed-off-by: Derek Straka ---- git/configure.ac.orig 2016-08-15 09:53:46.787003658 -0400 -+++ git/configure.ac 2016-08-15 09:53:51.698972432 -0400 -@@ -37,7 +37,7 @@ - ]) - - AC_CHECK_PROG([ASCIIDOC], [a2x], [a2x]) --AM_CONDITIONAL([HAVE_DOCTOOLS], [test "x$ASCIIDOC" != "x"]) -+AM_CONDITIONAL([HAVE_DOCTOOLS], [false]) - AS_IF([test "x$ASCIIDOC" = "x"], - [AC_MSG_WARN([asciidoc not installed, man pages will not be created])]) - diff --git a/meta-oe/recipes-support/utouch/utouch-evemu/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch b/meta-oe/recipes-support/utouch/utouch-evemu/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch new file mode 100644 index 0000000000..71bf572699 --- /dev/null +++ b/meta-oe/recipes-support/utouch/utouch-evemu/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch @@ -0,0 +1,76 @@ +From 60987a1df8eb8c9196222375574dcd7bc0ad2daa Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 30 Nov 2019 20:23:27 -0800 +Subject: [PATCH] Fix build on 32bit arches with 64bit time_t + +time element is deprecated on new input_event structure in kernel's +input.h [1] + +[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + src/evemu-impl.h | 5 +++++ + src/evemu.c | 16 +++++++++------- + 2 files changed, 14 insertions(+), 7 deletions(-) + +diff --git a/src/evemu-impl.h b/src/evemu-impl.h +index acf2976..c08d861 100644 +--- a/src/evemu-impl.h ++++ b/src/evemu-impl.h +@@ -21,6 +21,11 @@ + #include + #include + ++#ifndef input_event_sec ++#define input_event_sec time.tv_sec ++#define input_event_usec time.tv_usec ++#endif ++ + #define EVPLAY_NBITS KEY_CNT + #define EVPLAY_NBYTES ((EVPLAY_NBITS + 7) / 8) + +diff --git a/src/evemu.c b/src/evemu.c +index 21187af..160c915 100644 +--- a/src/evemu.c ++++ b/src/evemu.c +@@ -363,7 +363,7 @@ int evemu_read(struct evemu_device *dev, FILE *fp) + int evemu_write_event(FILE *fp, const struct input_event *ev) + { + return fprintf(fp, "E: %lu.%06u %04x %04x %d\n", +- ev->time.tv_sec, (unsigned)ev->time.tv_usec, ++ ev->input_event_sec, (unsigned)ev->input_event_usec, + ev->type, ev->code, ev->value); + } + +@@ -391,8 +391,8 @@ int evemu_read_event(FILE *fp, struct input_event *ev) + int value; + int ret = fscanf(fp, "E: %lu.%06u %04x %04x %d\n", + &sec, &usec, &type, &code, &value); +- ev->time.tv_sec = sec; +- ev->time.tv_usec = usec; ++ ev->input_event_sec = sec; ++ ev->input_event_usec = usec; + ev->type = type; + ev->code = code; + ev->value = value; +@@ -411,12 +411,14 @@ int evemu_read_event_realtime(FILE *fp, struct input_event *ev, + + if (evtime) { + if (!evtime->tv_sec) +- *evtime = ev->time; +- usec = 1000000L * (ev->time.tv_sec - evtime->tv_sec); +- usec += ev->time.tv_usec - evtime->tv_usec; ++ evtime->tv_sec = ev->input_event_sec; ++ evtime->tv_usec = ev->input_event_usec; ++ usec = 1000000L * (ev->input_event_sec - evtime->tv_sec); ++ usec += ev->input_event_usec - evtime->tv_usec; + if (usec > 500) { + usleep(usec); +- *evtime = ev->time; ++ evtime->tv_sec = ev->input_event_sec; ++ evtime->tv_usec = ev->input_event_usec; + } + } + diff --git a/meta-oe/recipes-support/utouch/utouch-evemu_git.bb b/meta-oe/recipes-support/utouch/utouch-evemu_git.bb index 1dd5a86d50..41d1cbfd97 100644 --- a/meta-oe/recipes-support/utouch/utouch-evemu_git.bb +++ b/meta-oe/recipes-support/utouch/utouch-evemu_git.bb @@ -7,7 +7,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949" inherit autotools -SRC_URI = "git://bitmath.org/git/evemu.git;protocol=http" +SRC_URI = "git://bitmath.org/git/evemu.git;protocol=http \ + file://0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch \ + " SRCREV = "9752b50e922572e4cd214ac45ed95e4ee410fe24" PV = "1.0.5+git${SRCPV}" diff --git a/meta-oe/recipes-support/utouch/utouch-frame/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch b/meta-oe/recipes-support/utouch/utouch-frame/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch new file mode 100644 index 0000000000..d405d43f14 --- /dev/null +++ b/meta-oe/recipes-support/utouch/utouch-frame/0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch @@ -0,0 +1,41 @@ +From 895b6996e232700fb2a428838feaef418cc64b70 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 30 Nov 2019 22:52:13 -0800 +Subject: [PATCH] Fix build on 32bit arches with 64bit time_t + +time element is deprecated on new input_event structure in kernel's +input.h [1] + +[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=152194fe9c3f + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + src/frame-mtdev.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/frame-mtdev.c b/src/frame-mtdev.c +index c0f15d8..42ad380 100644 +--- a/src/frame-mtdev.c ++++ b/src/frame-mtdev.c +@@ -25,6 +25,11 @@ + #include + #include + ++#ifndef input_event_sec ++#define input_event_sec time.tv_sec ++#define input_event_usec time.tv_usec ++#endif ++ + static int is_pointer(const struct evemu_device *dev) + { + return evemu_has_event(dev, EV_REL, REL_X) || +@@ -200,7 +205,7 @@ static int handle_abs_event(utouch_frame_handle fh, + static utouch_frame_time_t get_evtime_ms(const struct input_event *syn) + { + static const utouch_frame_time_t ms = 1000; +- return syn->time.tv_usec / ms + syn->time.tv_sec * ms; ++ return syn->input_event_usec / ms + syn->input_event_sec * ms; + } + + const struct utouch_frame * diff --git a/meta-oe/recipes-support/utouch/utouch-frame/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch b/meta-oe/recipes-support/utouch/utouch-frame/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch new file mode 100644 index 0000000000..f3c8eeb418 --- /dev/null +++ b/meta-oe/recipes-support/utouch/utouch-frame/0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch @@ -0,0 +1,29 @@ +From 08b17ec505e09e8f5a4d73ffc3aa61561ec2e0da Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 30 Mar 2017 00:27:54 -0700 +Subject: [PATCH] include sys/stat.h for fixing build issue on musl + +error: field has incomplete + type 'struct stat' + struct stat fs; + +Signed-off-by: Khem Raj +--- + tools/utouch-frame-test-mtdev.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/utouch-frame-test-mtdev.c b/tools/utouch-frame-test-mtdev.c +index 5253320..2032af4 100644 +--- a/tools/utouch-frame-test-mtdev.c ++++ b/tools/utouch-frame-test-mtdev.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include "common-defs.h" + + struct frame_test { +-- +2.12.1 + diff --git a/meta-oe/recipes-support/utouch/utouch-frame/remove-man-page-creation.patch b/meta-oe/recipes-support/utouch/utouch-frame/remove-man-page-creation.patch new file mode 100644 index 0000000000..8706d91234 --- /dev/null +++ b/meta-oe/recipes-support/utouch/utouch-frame/remove-man-page-creation.patch @@ -0,0 +1,16 @@ +configure.ac: never generate the docs even if a2x is found as xmllint will fail finding custom dtd files + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Derek Straka +--- git/configure.ac.orig 2016-08-15 09:53:46.787003658 -0400 ++++ git/configure.ac 2016-08-15 09:53:51.698972432 -0400 +@@ -37,7 +37,7 @@ + ]) + + AC_CHECK_PROG([ASCIIDOC], [a2x], [a2x]) +-AM_CONDITIONAL([HAVE_DOCTOOLS], [test "x$ASCIIDOC" != "x"]) ++AM_CONDITIONAL([HAVE_DOCTOOLS], [false]) + AS_IF([test "x$ASCIIDOC" = "x"], + [AC_MSG_WARN([asciidoc not installed, man pages will not be created])]) + diff --git a/meta-oe/recipes-support/utouch/utouch-frame_git.bb b/meta-oe/recipes-support/utouch/utouch-frame_git.bb index 39d46af8e9..1ebebfa9f5 100644 --- a/meta-oe/recipes-support/utouch/utouch-frame_git.bb +++ b/meta-oe/recipes-support/utouch/utouch-frame_git.bb @@ -12,6 +12,7 @@ inherit autotools pkgconfig SRC_URI = "git://bitmath.org/git/frame.git;protocol=http \ file://remove-man-page-creation.patch \ file://0001-include-sys-stat.h-for-fixing-build-issue-on-musl.patch \ + file://0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch \ " SRCREV = "95363d5a1f7394d71144bf3b408ef4e6db4350fc" -- cgit v1.2.3-54-g00ecf