Create /etc/libinput on install
authorPeter Hutterer <peter.hutterer@who-t.net>
Wed, 3 Feb 2021 00:19:20 +0000 (10:19 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 8 Feb 2021 04:28:42 +0000 (04:28 +0000)
Users that need to create the local-overrides.quirks are sometimes hesitant to
do so because /etc/libinput doesn't exist by default. Let's create it on
install.

Related #568

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
.gitlab-ci/libinput.spec.in
meson.build

index ef91c40..670afd1 100644 (file)
@@ -73,6 +73,7 @@ intended to be run by users.
 
 %files
 %doc COPYING
+%dir %{_sysconfdir}/libinput
 %{_libdir}/libinput.so.*
 %{udevdir}/libinput-device-group
 %{udevdir}/libinput-fuzz-extract
index f2a064a..ad87594 100644 (file)
@@ -7,7 +7,8 @@ project('libinput', 'c',
 libinput_version = meson.project_version().split('.')
 
 dir_data        = join_paths(get_option('prefix'), get_option('datadir'), 'libinput')
-dir_sysconf     = join_paths(get_option('prefix'), get_option('sysconfdir'), 'libinput')
+dir_etc         = join_paths(get_option('prefix'), get_option('sysconfdir'))
+dir_overrides   = join_paths(get_option('prefix'), get_option('sysconfdir'), 'libinput')
 dir_libexec     = join_paths(get_option('prefix'), get_option('libexecdir'), 'libinput')
 dir_lib         = join_paths(get_option('prefix'), get_option('libdir'))
 dir_man1        = join_paths(get_option('prefix'), get_option('mandir'), 'man1')
@@ -312,7 +313,7 @@ dep_libfilter = declare_dependency(link_with : libfilter)
 
 ############ libquirks.a #############
 libinput_data_path = dir_data
-libinput_data_override_path = join_paths(dir_sysconf, 'local-overrides.quirks')
+libinput_data_override_path = join_paths(dir_overrides, 'local-overrides.quirks')
 config_h.set_quoted('LIBINPUT_QUIRKS_DIR', dir_data)
 config_h.set_quoted('LIBINPUT_QUIRKS_OVERRIDE_FILE', libinput_data_override_path)
 
@@ -334,6 +335,9 @@ libquirks = static_library('quirks', src_libquirks,
                           include_directories : includes_include)
 dep_libquirks = declare_dependency(link_with : libquirks)
 
+# Create /etc/libinput
+install_subdir('libinput', install_dir : dir_etc)
+
 ############ libinput.so ############
 install_headers('src/libinput.h')
 src_libinput = src_libfilter + [