diff options
-rw-r--r-- | meson.build | 14 |
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') | |||
54 | systemd = dependency('libsystemd', version: '>=239', required: false) | 54 | systemd = dependency('libsystemd', version: '>=239', required: false) |
55 | elogind = dependency('libelogind', version: '>=239', required: false) | 55 | elogind = dependency('libelogind', version: '>=239', required: false) |
56 | xcb = dependency('xcb', required: get_option('xwayland')) | 56 | xcb = dependency('xcb', required: get_option('xwayland')) |
57 | bash_comp = dependency('bash-completion', required: false) | ||
58 | fish_comp = dependency('fish', required: false) | ||
57 | math = cc.find_library('m') | 59 | math = cc.find_library('m') |
58 | rt = cc.find_library('rt') | 60 | rt = 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) |
266 | endif | 272 | endif |
@@ -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) |
277 | endif | 287 | endif |