[PATCH libinput 2/2] meson: Fix bindir usage in install script

Quentin Glidic sardemff7+wayland at sardemff7.net
Thu Nov 30 08:23:39 UTC 2017


From: Quentin Glidic <sardemff7+git at sardemff7.net>

Since the install script cannot know the correct bindir, just pass it
from Meson directly.

Signed-off-by: Quentin Glidic <sardemff7+git at sardemff7.net>
---
 meson.build                     |  3 ++-
 tools/install-compat-scripts.sh | 10 ++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/meson.build b/meson.build
index 6c5b9a84..734bf1a5 100644
--- a/meson.build
+++ b/meson.build
@@ -473,7 +473,8 @@ configure_file(input : 'tools/libinput.man',
 	       install_dir : join_paths(get_option('mandir'), 'man1')
 	       )
 
-meson.add_install_script('tools/install-compat-scripts.sh')
+meson.add_install_script('tools/install-compat-scripts.sh',
+			 join_paths(get_option('prefix'), get_option('bindir')))
 
 ptraccel_debug_sources = [ 'tools/ptraccel-debug.c' ]
 executable('ptraccel-debug',
diff --git a/tools/install-compat-scripts.sh b/tools/install-compat-scripts.sh
index 0d8b3adb..b046b849 100755
--- a/tools/install-compat-scripts.sh
+++ b/tools/install-compat-scripts.sh
@@ -1,9 +1,7 @@
 #!/bin/sh
-#
-# This does not honor $bindir properly, because we cannot get to it
-# here. Does anyone build to something but prefix/bin?
-#
-bindir="${DESTDIR}/${MESON_INSTALL_PREFIX}/bin"
-mkdir -p "$bindir"
+
+bindir="${DESTDIR}${1}"
+
+# Do not create bindir, because if it is not there now, we have a problem
 cp "${MESON_SOURCE_ROOT}/tools/libinput-list-devices.compat" "${bindir}/libinput-list-devices"
 cp "${MESON_SOURCE_ROOT}/tools/libinput-debug-events.compat" "${bindir}/libinput-debug-events"
-- 
2.15.0



More information about the wayland-devel mailing list