summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2021-01-29 17:21:31 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2021-01-29 17:21:31 +0000
commit3970ddec0671c33dbe8e67114c4d252266bd87d9 (patch)
treebaee649eadee78338179a4d85d14764389370695
parent9a34c35c2b9b5450006ee3edaf59b6eda562440b (diff)
parent525bbb7712ae47354e5e8bebc1d752853f95f623 (diff)
downloadglib-3970ddec0671c33dbe8e67114c4d252266bd87d9.tar.gz
Merge branch '1054-check-bash-comp-dir' into 'master'
Check the completiondir from bash-completion package config file. Closes #1054 See merge request GNOME/glib!1896
-rw-r--r--gio/meson.build13
-rw-r--r--meson.build1
2 files changed, 13 insertions, 1 deletions
diff --git a/gio/meson.build b/gio/meson.build
index 8e039b68c..adb4b8f79 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -769,6 +769,17 @@ if host_system == 'windows'
endif
if have_bash
+ bash_comp_inst_dir = ''
+ if bash_comp_dep.found()
+ bash_comp_dir_override = bash_comp_dep.version().version_compare('>= 2.10') ? ['datadir', get_option('datadir')] : ['prefix', get_option('prefix')]
+ bash_comp_inst_dir = bash_comp_dep.get_pkgconfig_variable('completionsdir', define_variable: bash_comp_dir_override)
+ endif
+
+ if bash_comp_inst_dir == ''
+ message('Found bash-completion but the .pc file did not set \'completionsdir\', fallback to a predefined path')
+ bash_comp_inst_dir = join_paths(get_option('datadir'), 'bash-completion/completions')
+ endif
+
install_data([
'completion/gapplication',
'completion/gdbus',
@@ -776,7 +787,7 @@ if have_bash
'completion/gsettings',
'completion/gresource'
],
- install_dir: join_paths(get_option('datadir'), 'bash-completion/completions'))
+ install_dir: bash_comp_inst_dir)
endif
if enable_dtrace
diff --git a/meson.build b/meson.build
index d7d64118d..219236c26 100644
--- a/meson.build
+++ b/meson.build
@@ -2219,6 +2219,7 @@ endif
# Determine which user environment-dependent files that we want to install
have_bash = find_program('bash', required : false).found() # For completion scripts
+bash_comp_dep = dependency('bash-completion', version: '>=2.0', required: false)
have_sh = find_program('sh', required : false).found() # For glib-gettextize
# Some installed tests require a custom environment