aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorLibravatar Eli Schwartz <eschwartz@archlinux.org>2020-01-21 23:03:58 -0500
committerLibravatar Simon Ser <contact@emersion.fr>2020-01-22 18:05:29 +0100
commit03e8ce7b203d38278fa35482fb2f6cd198bbebf7 (patch)
treef87993f58c0a05dc585450d7afb205da1ca07897 /meson.build
parentmeson: use join_paths to build paths, instead of string concat (diff)
downloadsway-03e8ce7b203d38278fa35482fb2f6cd198bbebf7.tar.gz
sway-03e8ce7b203d38278fa35482fb2f6cd198bbebf7.tar.zst
sway-03e8ce7b203d38278fa35482fb2f6cd198bbebf7.zip
completion: use pkg-config to get install location for bash/fish
Both shells provide pkg-config files which declare their designated completionsdir. Use this as the primary source of truth.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build14
1 files changed, 12 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 6efff3ed..ca0c791f 100644
--- a/meson.build
+++ b/meson.build
@@ -54,6 +54,8 @@ libinput = dependency('libinput', version: '>=1.6.0')
54systemd = dependency('libsystemd', version: '>=239', required: false) 54systemd = dependency('libsystemd', version: '>=239', required: false)
55elogind = dependency('libelogind', version: '>=239', required: false) 55elogind = dependency('libelogind', version: '>=239', required: false)
56xcb = dependency('xcb', required: get_option('xwayland')) 56xcb = dependency('xcb', required: get_option('xwayland'))
57bash_comp = dependency('bash-completion', required: false)
58fish_comp = dependency('fish', required: false)
57math = cc.find_library('m') 59math = cc.find_library('m')
58rt = cc.find_library('rt') 60rt = cc.find_library('rt')
59 61
@@ -260,7 +262,11 @@ if get_option('bash-completions')
260 'completions/bash/swaybar', 262 'completions/bash/swaybar',
261 'completions/bash/swaymsg', 263 'completions/bash/swaymsg',
262 ) 264 )
263 bash_install_dir = join_paths(datadir, 'bash-completion', 'completions') 265 if bash_comp.found()
266 bash_install_dir = bash_comp.get_pkgconfig_variable('completionsdir')
267 else
268 bash_install_dir = join_paths(datadir, 'bash-completion', 'completions')
269 endif
264 270
265 install_data(bash_files, install_dir: bash_install_dir) 271 install_data(bash_files, install_dir: bash_install_dir)
266endif 272endif
@@ -271,7 +277,11 @@ if get_option('fish-completions')
271 'completions/fish/swaymsg.fish', 277 'completions/fish/swaymsg.fish',
272 'completions/fish/swaynag.fish', 278 'completions/fish/swaynag.fish',
273 ) 279 )
274 fish_install_dir = join_paths(datadir, 'fish', 'completions') 280 if fish_comp.found()
281 fish_install_dir = fish_comp.get_pkgconfig_variable('completionsdir')
282 else
283 fish_install_dir = join_paths(datadir, 'fish', 'completions')
284 endif
275 285
276 install_data(fish_files, install_dir: fish_install_dir) 286 install_data(fish_files, install_dir: fish_install_dir)
277endif 287endif