Package: release.debian.org
Severity: normal
Tags: buster
User: release.debian....@packages.debian.org
Usertags: pu
X-Debbugs-Cc: Stephen Kitt <sk...@debian.org>

  * Add upstream fix for FTBFS with recent kernel headers.
    (Closes: #971161)

Test-only issue, I was able to reproduce the FTBFS on buster.
diff -Nru evemu-2.7.0/debian/changelog evemu-2.7.0/debian/changelog
--- evemu-2.7.0/debian/changelog        2018-05-26 22:01:16.000000000 +0300
+++ evemu-2.7.0/debian/changelog        2022-08-26 22:17:57.000000000 +0300
@@ -1,3 +1,11 @@
+evemu (2.7.0-1+deb10u1) buster; urgency=medium
+
+  * Non-maintainer upload.
+  * Add upstream fix for FTBFS with recent kernel headers.
+    (Closes: #971161)
+
+ -- Adrian Bunk <b...@debian.org>  Fri, 26 Aug 2022 22:17:57 +0300
+
 evemu (2.7.0-1) unstable; urgency=medium
 
   * New upstream release.
diff -Nru evemu-2.7.0/debian/patches/series evemu-2.7.0/debian/patches/series
--- evemu-2.7.0/debian/patches/series   2018-05-25 22:40:58.000000000 +0300
+++ evemu-2.7.0/debian/patches/series   2022-08-26 22:17:50.000000000 +0300
@@ -1,2 +1,3 @@
 0002-check-test-conditions.patch
 0003-fix-python-startup-crash.patch
+swmax-test.patch
diff -Nru evemu-2.7.0/debian/patches/swmax-test.patch 
evemu-2.7.0/debian/patches/swmax-test.patch
--- evemu-2.7.0/debian/patches/swmax-test.patch 1970-01-01 02:00:00.000000000 
+0200
+++ evemu-2.7.0/debian/patches/swmax-test.patch 2022-08-26 22:17:40.000000000 
+0300
@@ -0,0 +1,94 @@
+commit 86a5627dbeac8d9d9bc34326a758d6a477e876e4
+Author: Peter Hutterer <peter.hutte...@who-t.net>
+Date:   Wed Sep 30 08:53:36 2020 +1000
+
+    test: replace the hardcoded EV_MAX array with the libevdev one
+    
+    Kernel 5.8 changed the value of SW_MAX but libevdev has a built-in check 
for
+    out-of-range bits (it silently discards those).
+    
+    So where evemu is built against a new kernel but a libevdev that hasn't 
been
+    updated yet, our test expects bit up to the new SW_MAX while libevdev
+    discards all bits above the old SW_MAX.
+    
+    Fix this by making sure the test and uses the same value of the
+    respective type max as evemu itself does.
+    
+    Fixes #3
+    
+    Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
+
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -11,8 +11,12 @@
+ test_cxx_compile_LDADD = $(top_builddir)/src/libevemu.la
+ 
+ test_evemu_create_SOURCES = test-evemu-create.c
+-test_evemu_create_LDADD = $(top_builddir)/src/libevemu.la
+-test_evemu_create_LDFLAGS = -static
++test_evemu_create_LDADD = \
++                         $(top_builddir)/src/libevemu.la \
++                         $(LIBEVDEV_LIBS) \
++                         $(NULL)
++test_evemu_create_LDFLAGS = -no-install
++test_evemu_create_CFLAGS = $(LIBEVDEV_CFLAGS)
+ endif
+ 
+ CLEANFILES = evemu.tmp.*
+--- a/test/test-evemu-create.c
++++ b/test/test-evemu-create.c
+@@ -10,6 +10,7 @@
+ #include <assert.h>
+ #include "evemu.h"
+ #include <linux/input.h>
++#include <libevdev/libevdev.h>
+ 
+ #define UNUSED __attribute__((unused))
+ 
+@@ -45,19 +46,6 @@
+       ALLFLAGS         = (WITHNAME << 1) - 1
+ };
+ 
+-static int max[EV_CNT] = {
+-      0,       /* EV_SYN */
+-      KEY_MAX, /* EV_KEY */
+-      REL_MAX, /* EV_REL */
+-      ABS_MAX, /* EV_ABS */
+-      MSC_MAX, /* EV_MSC */
+-      SW_MAX,  /* EV_SW */
+-      LED_MAX, /* EV_LED */
+-      SND_MAX, /* EV_SND */
+-      REP_MAX, /* EV_REP */
+-      FF_MAX   /* EV_FF */
+-};
+-
+ static void println(int fd, int flags, const char *format, ...)
+ {
+       va_list args;
+@@ -119,8 +107,8 @@
+       if (flags & BITS) {
+               int i;
+               for (i = 0; i < EV_CNT; i++) {
+-                      int j;
+-                      for (j = 0; j <= max[i]; j += 8) {
++                      int max = libevdev_event_type_get_max(i);
++                      for (int j = 0; j <= max; j += 8) {
+                               println(fd, flags, bits, i, 0xff, 0xff, 0xff, 
0xff, 0xff, 0xff, 0xff, 0xff);
+                               if (flags & EMPTYLINE)
+                                       println(fd, flags, "%s", emptyline);
+@@ -177,11 +165,14 @@
+       if (flags & BITS) {
+               int i, j;
+               for (i = 1; i < EV_CNT; i++) {
++                      int max = libevdev_event_type_get_max(i);
++
+                       if (!evemu_has_bit(dev, i))
+                               continue;
+ 
+-                      for (j = 0; j <= max[i]; j++)
++                      for (j = 0; j <= max; j++) {
+                               assert(evemu_has_event(dev, i, j));
++                      }
+               }
+       }
+ 

Reply via email to