From ad66d0861d12b7bec9979cadd25d01040fd43113 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sun, 29 Mar 2020 10:06:48 +0200 Subject: [PATCH] build: make completions respect install prefix paths straight from pkgconfig will sometimes be outside of the users build prefix, we should never try to install anything outside of that directory. filter the value obtained from pkgconfig and use some fallback if it is not inside --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index bb3e4f494..7d9fd6bdc 100644 --- a/meson.build +++ b/meson.build @@ -264,6 +264,9 @@ if get_option('bash-completions') ) if bash_comp.found() bash_install_dir = bash_comp.get_pkgconfig_variable('completionsdir') + if not bash_install_dir.startswith(prefix) + bash_install_dir = join_paths(datadir, 'bash-completion', 'completions') + endif else bash_install_dir = join_paths(datadir, 'bash-completion', 'completions') endif @@ -279,6 +282,9 @@ if get_option('fish-completions') ) if fish_comp.found() fish_install_dir = fish_comp.get_pkgconfig_variable('completionsdir') + if not fish_install_dir.startswith(prefix) + fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d') + endif else fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d') endif