aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2022-11-28 20:07:07 +0100
committerLibravatar Simon Zeni <simon@bl4ckb0ne.ca>2022-11-28 18:51:45 -0500
commita358d6760ef751588d310f0141798387e7f4d4b1 (patch)
treea174bb8e6f9dbdd9c58e07381a188c70a8301b7e
parentFix build on Debian Stable (diff)
downloadsway-a358d6760ef751588d310f0141798387e7f4d4b1.tar.gz
sway-a358d6760ef751588d310f0141798387e7f4d4b1.tar.zst
sway-a358d6760ef751588d310f0141798387e7f4d4b1.zip
build: move completions to separate file
-rw-r--r--completions/meson.build57
-rw-r--r--meson.build56
2 files changed, 58 insertions, 55 deletions
diff --git a/completions/meson.build b/completions/meson.build
new file mode 100644
index 00000000..6bca9391
--- /dev/null
+++ b/completions/meson.build
@@ -0,0 +1,57 @@
1if get_option('zsh-completions')
2 zsh_files = files(
3 'zsh/_sway',
4 'zsh/_swaymsg',
5 )
6 zsh_install_dir = join_paths(datadir, 'zsh', 'site-functions')
7
8 install_data(zsh_files, install_dir: zsh_install_dir)
9endif
10
11if get_option('bash-completions')
12 bash_comp = dependency('bash-completion', required: false)
13
14 bash_files = files(
15 'bash/sway',
16 'bash/swaymsg',
17 )
18
19 if get_option('swaybar')
20 bash_files += files('bash/swaybar')
21 endif
22
23 if bash_comp.found()
24 bash_install_dir = bash_comp.get_variable(
25 pkgconfig: 'completionsdir',
26 pkgconfig_define: ['datadir', datadir]
27 )
28 else
29 bash_install_dir = join_paths(datadir, 'bash-completion', 'completions')
30 endif
31
32 install_data(bash_files, install_dir: bash_install_dir)
33endif
34
35if get_option('fish-completions')
36 fish_comp = dependency('fish', required: false)
37
38 fish_files = files(
39 'fish/sway.fish',
40 'fish/swaymsg.fish',
41 )
42
43 if get_option('swaynag')
44 fish_files += files('fish/swaynag.fish')
45 endif
46
47 if fish_comp.found()
48 fish_install_dir = fish_comp.get_variable(
49 pkgconfig: 'completionsdir',
50 pkgconfig_define: ['datadir', datadir]
51 )
52 else
53 fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d')
54 endif
55
56 install_data(fish_files, install_dir: fish_install_dir)
57endif
diff --git a/meson.build b/meson.build
index eb3229cf..e22bc36e 100644
--- a/meson.build
+++ b/meson.build
@@ -81,8 +81,6 @@ xcb = dependency('xcb', required: get_option('xwayland'))
81drm_full = dependency('libdrm') # only needed for drm_fourcc.h 81drm_full = dependency('libdrm') # only needed for drm_fourcc.h
82drm = drm_full.partial_dependency(compile_args: true, includes: true) 82drm = drm_full.partial_dependency(compile_args: true, includes: true)
83libudev = wlroots_features['libinput_backend'] ? dependency('libudev') : null_dep 83libudev = wlroots_features['libinput_backend'] ? dependency('libudev') : null_dep
84bash_comp = dependency('bash-completion', required: false)
85fish_comp = dependency('fish', required: false)
86math = cc.find_library('m') 84math = cc.find_library('m')
87rt = cc.find_library('rt') 85rt = cc.find_library('rt')
88xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland')) 86xcb_icccm = dependency('xcb-icccm', required: get_option('xwayland'))
@@ -266,59 +264,7 @@ if get_option('default-wallpaper')
266 install_data(wallpaper_files, install_dir: wallpaper_install_dir) 264 install_data(wallpaper_files, install_dir: wallpaper_install_dir)
267endif 265endif
268 266
269if get_option('zsh-completions') 267subdir('completions')
270 zsh_files = files(
271 'completions/zsh/_sway',
272 'completions/zsh/_swaymsg',
273 )
274 zsh_install_dir = join_paths(datadir, 'zsh', 'site-functions')
275
276 install_data(zsh_files, install_dir: zsh_install_dir)
277endif
278
279if get_option('bash-completions')
280 bash_files = files(
281 'completions/bash/sway',
282 'completions/bash/swaymsg',
283 )
284
285 if get_option('swaybar')
286 bash_files += files('completions/bash/swaybar')
287 endif
288
289 if bash_comp.found()
290 bash_install_dir = bash_comp.get_variable(
291 pkgconfig: 'completionsdir',
292 pkgconfig_define: ['datadir', datadir]
293 )
294 else
295 bash_install_dir = join_paths(datadir, 'bash-completion', 'completions')
296 endif
297
298 install_data(bash_files, install_dir: bash_install_dir)
299endif
300
301if get_option('fish-completions')
302 fish_files = files(
303 'completions/fish/sway.fish',
304 'completions/fish/swaymsg.fish',
305 )
306
307 if get_option('swaynag')
308 fish_files += files('completions/fish/swaynag.fish')
309 endif
310
311 if fish_comp.found()
312 fish_install_dir = fish_comp.get_variable(
313 pkgconfig: 'completionsdir',
314 pkgconfig_define: ['datadir', datadir]
315 )
316 else
317 fish_install_dir = join_paths(datadir, 'fish', 'vendor_completions.d')
318 endif
319
320 install_data(fish_files, install_dir: fish_install_dir)
321endif
322 268
323summary({ 269summary({
324 'xwayland': have_xwayland, 270 'xwayland': have_xwayland,