diff -Nru evemu-2.7.0/debian/changelog evemu-2.7.0/debian/changelog --- evemu-2.7.0/debian/changelog 2019-08-30 10:17:10.000000000 +0000 +++ evemu-2.7.0/debian/changelog 2020-09-30 12:29:19.000000000 +0000 @@ -1,3 +1,10 @@ +evemu (2.7.0-3) unstable; urgency=medium + + * Apply upstream fix for the tests. Closes: #971161. + * Switch to debhelper compatibility level 13. + + -- Stephen Kitt Wed, 30 Sep 2020 14:29:19 +0200 + evemu (2.7.0-2) unstable; urgency=medium [ Ondřej Nový ] diff -Nru evemu-2.7.0/debian/control evemu-2.7.0/debian/control --- evemu-2.7.0/debian/control 2019-08-30 09:52:38.000000000 +0000 +++ evemu-2.7.0/debian/control 2020-09-30 08:12:18.000000000 +0000 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Stephen Kitt Build-Depends: asciidoc, - debhelper-compat (= 12), + debhelper-compat (= 13), dh-python, libevdev-dev (>= 1.2.99.902), pkg-config, 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 19:40:58.000000000 +0000 +++ evemu-2.7.0/debian/patches/series 2020-09-30 12:07:01.000000000 +0000 @@ -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 00:00:00.000000000 +0000 +++ evemu-2.7.0/debian/patches/swmax-test.patch 2020-09-30 07:58:43.000000000 +0000 @@ -0,0 +1,94 @@ +commit 86a5627dbeac8d9d9bc34326a758d6a477e876e4 +Author: Peter Hutterer +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 + +--- 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 + #include "evemu.h" + #include ++#include + + #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)); ++ } + } + } +