diff --git a/meson.build b/meson.build index f80f40117abe270eb1ee7e912a237ef13aabddd8..0ce413e52f6bc7a7923d287efc2456b47a5cc5f4 100644 --- a/meson.build +++ b/meson.build @@ -132,12 +132,22 @@ else endif dep_bash = dependency('bash-completion', required : false) +bashcompletiondir = '' if dep_bash.found() - bashcompletiondir = dep_bash.get_pkgconfig_variable('completionsdir') + prefixdir = get_option('prefix') + bash_prefix = dep_bash.get_pkgconfig_variable('prefix') + if prefixdir != bash_prefix + warning('User provided prefix \'@0@\' differs from bash-completion one \'@1@\'. ' + .format(prefixdir, bash_prefix) + 'Disabling completion.') + else + bashcompletiondir = dep_bash.get_pkgconfig_variable('completionsdir') + endif else bashcompletiondir = join_paths(get_option('datadir'), 'bash-completion/completions') endif -install_data('shell-completion/bash/wflinfo', install_dir : bashcompletiondir) +if bashcompletiondir != '' + install_data('shell-completion/bash/wflinfo', install_dir : bashcompletiondir) +endif zshcompletiondir = join_paths(get_option('datadir'), 'zsh/site-functions') install_data('shell-completion/zsh/_wflinfo', install_dir : zshcompletiondir)