From ba4abea9605fde709fd700383791ca760b24f8b4 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 16 Apr 2020 11:21:06 +0200 Subject: build: Install bash-completion relative to datadir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- meson.build | 8 ++++++-- 1 file 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( -- cgit v1.2.1