diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2020-04-16 11:21:06 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2020-04-16 16:10:41 +0200 |
commit | ba4abea9605fde709fd700383791ca760b24f8b4 (patch) | |
tree | b6cdb5fc81ec4ce7eb595fb2b4407ade4df042c3 | |
parent | 417580550af147f99d1eedc13df977f3f870349d (diff) | |
download | dconf-ba4abea9605fde709fd700383791ca760b24f8b4.tar.gz |
build: Install bash-completion relative to datadir
Since bash-completion 2.9, it was no longer possible to override
the completionsdir through prefix. [1] In 2.10, the overridability
was re-estabilished but this time through datadir variable. [2]
This should not really matter except for developers installing the project
into a custom prefix or distros using per-package prefixes like NixOS.
[1]: https://github.com/scop/bash-completion/commit/81ba2c7e7dfbaefbafa1e8615727c9612e5fb314
[2]: https://github.com/scop/bash-completion/pull/344
Co-Authored-By: Iñigo Martínez <inigomartinez@gmail.com>
-rw-r--r-- | meson.build | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/meson.build b/meson.build index 6620112..b7114bf 100644 --- a/meson.build +++ b/meson.build @@ -50,8 +50,12 @@ dbus_session_service_dir = dependency('dbus-1').get_pkgconfig_variable('session_ enable_bash_completion = get_option('bash_completion') if enable_bash_completion - # FIXME: the `.pc` file is wrong because `completionsdir` should be relative to `datadir`, not `prefix` - completions_dir = dependency('bash-completion').get_pkgconfig_variable('completionsdir', define_variable: ['prefix', dconf_prefix]) + bash_completion_dep = dependency('bash-completion') + completions_dir = bash_completion_dep.get_pkgconfig_variable( + 'completionsdir', + # bash-completion 2.10 changed the substitutions + define_variable: bash_completion_dep.version().version_compare('>= 2.10') ? ['datadir', dconf_datadir] : ['prefix', dconf_prefix], + ) endif configure_file( |