[PATCH libinput 2/5] tools: quirks: if we're executing from the builddir, use the git datadir

Peter Hutterer peter.hutterer at who-t.net
Wed Jun 27 23:51:40 UTC 2018


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 tools/libinput-quirks.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/libinput-quirks.c b/tools/libinput-quirks.c
index 88c860e4..862bb0ae 100644
--- a/tools/libinput-quirks.c
+++ b/tools/libinput-quirks.c
@@ -162,8 +162,16 @@ main(int argc, char **argv)
 
 	/* Overriding the data dir means no custom override file */
 	if (!data_path) {
-		data_path = LIBINPUT_DATA_DIR;
-		override_file = LIBINPUT_DATA_OVERRIDE_FILE;
+		char *builddir;
+
+		builddir = tools_execdir_is_builddir();
+		if (builddir) {
+			data_path = LIBINPUT_DATA_SRCDIR;
+			free(builddir);
+		} else {
+			data_path = LIBINPUT_DATA_DIR;
+			override_file = LIBINPUT_DATA_OVERRIDE_FILE;
+		}
 	}
 
 	quirks = quirks_init_subsystem(data_path,
-- 
2.17.1



More information about the wayland-devel mailing list