summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac10
-rw-r--r--test/Makefile.am2
-rw-r--r--udev/.gitignore1
-rw-r--r--udev/80-libinput-device-groups.rules.in (renamed from udev/80-libinput-device-groups.rules)2
-rw-r--r--udev/90-libinput-model-quirks.rules.in (renamed from udev/90-libinput-model-quirks.rules)0
-rw-r--r--udev/Makefile.am12
6 files changed, 24 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 978bbeaf..9b425840 100644
--- a/configure.ac
+++ b/configure.ac
@@ -184,6 +184,12 @@ AM_CONDITIONAL(HAVE_VALGRIND, [test "x$VALGRIND" != "x"])
AM_CONDITIONAL(BUILD_TESTS, [test "x$build_tests" = "xyes"])
AM_CONDITIONAL(BUILD_DOCS, [test "x$build_documentation" = "xyes"])
+# Used by the udev rules so we can use callouts during testing without
+# installing everything first. Default is the empty string so the installed
+# rule will use udev's default path. Override is in udev/Makefile.am
+AC_SUBST(UDEV_TEST_PATH, "")
+AC_PATH_PROG(SED, [sed])
+
AC_CONFIG_FILES([Makefile
doc/Makefile
doc/libinput.doxygen
@@ -192,7 +198,9 @@ AC_CONFIG_FILES([Makefile
src/libinput-version.h
test/Makefile
tools/Makefile
- udev/Makefile])
+ udev/Makefile
+ udev/80-libinput-device-groups.rules
+ udev/90-libinput-model-quirks.rules])
AC_CONFIG_FILES([test/symbols-leak-test],
[chmod +x test/symbols-leak-test])
AC_OUTPUT
diff --git a/test/Makefile.am b/test/Makefile.am
index 3580e8aa..457c2971 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -43,7 +43,7 @@ liblitest_la_SOURCES = \
litest.c
liblitest_la_LIBADD = $(top_builddir)/src/libinput-util.la
liblitest_la_CFLAGS = $(AM_CFLAGS) \
- -DLIBINPUT_UDEV_RULES_FILE="\"$(abs_top_srcdir)/udev/90-libinput-model-quirks.rules\"" \
+ -DLIBINPUT_UDEV_RULES_FILE="\"$(abs_top_srcdir)/udev/90-libinput-model-quirks-litest.rules\"" \
-DLIBINPUT_UDEV_HWDB_FILE="\"$(abs_top_srcdir)/udev/90-libinput-model-quirks.hwdb\""
if HAVE_LIBUNWIND
liblitest_la_LIBADD += $(LIBUNWIND_LIBS) -ldl
diff --git a/udev/.gitignore b/udev/.gitignore
index d8e1456b..72c77a0f 100644
--- a/udev/.gitignore
+++ b/udev/.gitignore
@@ -1 +1,2 @@
libinput-device-group
+*.rules
diff --git a/udev/80-libinput-device-groups.rules b/udev/80-libinput-device-groups.rules.in
index f826bec6..c2af0ce7 100644
--- a/udev/80-libinput-device-groups.rules
+++ b/udev/80-libinput-device-groups.rules.in
@@ -2,7 +2,7 @@ ACTION!="add|change", GOTO="libinput_device_group_end"
KERNEL!="event[0-9]*", GOTO="libinput_device_group_end"
ATTRS{phys}=="?*", \
- PROGRAM="libinput-device-group %S%p", \
+ PROGRAM="@UDEV_TEST_PATH@libinput-device-group %S%p", \
ENV{LIBINPUT_DEVICE_GROUP}="%c"
LABEL="libinput_device_group_end"
diff --git a/udev/90-libinput-model-quirks.rules b/udev/90-libinput-model-quirks.rules.in
index 43674f55..43674f55 100644
--- a/udev/90-libinput-model-quirks.rules
+++ b/udev/90-libinput-model-quirks.rules.in
diff --git a/udev/Makefile.am b/udev/Makefile.am
index 7d19809d..e5cf95c4 100644
--- a/udev/Makefile.am
+++ b/udev/Makefile.am
@@ -1,6 +1,10 @@
udevdir=$(UDEV_DIR)
udev_PROGRAMS = libinput-device-group
+litest_rules = 80-libinput-device-groups-litest.rules \
+ 90-libinput-model-quirks-litest.rules
+udev_SCRIPTS = $(litest_rules)
+
libinput_device_group_SOURCES = libinput-device-group.c
libinput_device_group_CFLAGS = $(LIBUDEV_CFLAGS) $(GCC_CFLAGS)
libinput_device_group_LDADD = $(LIBUDEV_LIBS)
@@ -13,3 +17,11 @@ dist_udev_rules_DATA = \
udev_hwdbdir=$(UDEV_DIR)/hwdb.d
dist_udev_hwdb_DATA = \
90-libinput-model-quirks.hwdb
+
+%-litest.rules: %.rules.in
+ $(SED) -e "s|\@UDEV_TEST_PATH\@|$(abs_builddir)/|" < $^ > $@
+
+CLEANFILES = $(litest_rules)
+DISTCLEANFILES = \
+ 80-libinput-device-groups.rules \
+ 90-libinput-model-quirks.rules