diff options
author | Arnaud Rebillout <arnaud.rebillout@collabora.com> | 2018-11-05 11:42:24 +0700 |
---|---|---|
committer | Arun Raghavan <arun@arunraghavan.net> | 2019-06-08 11:57:00 +0200 |
commit | 8d241d62c52c6621c9996c2ac74a8dd9741a7489 (patch) | |
tree | b46e8b53510251db7af7b2ca68b85fb94ea55201 | |
parent | a37046cc38df7fc605f0287e135fa96d07b74317 (diff) | |
download | pulseaudio-8d241d62c52c6621c9996c2ac74a8dd9741a7489.tar.gz |
meson: Install completion files
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
-rw-r--r-- | meson.build | 21 | ||||
-rw-r--r-- | meson_options.txt | 6 | ||||
-rw-r--r-- | shell-completion/bash/meson.build | 17 | ||||
-rw-r--r-- | shell-completion/zsh/meson.build | 1 |
4 files changed, 43 insertions, 2 deletions
diff --git a/meson.build b/meson.build index e681cb853..f4449b81e 100644 --- a/meson.build +++ b/meson.build @@ -63,6 +63,21 @@ if pulsedspdir == '' join_paths(libdir, 'pulseaudio') endif +bashcompletiondir = get_option('bashcompletiondir') +if bashcompletiondir == '' + bash_completion_dep = dependency('bash-completion', required : false) + if bash_completion_dep.found() + bashcompletiondir = bash_completion_dep.get_pkgconfig_variable('completionsdir') + else + bashcompletiondir = join_paths(datadir, 'bash-completion', 'completions') + endif +endif + +zshcompletiondir = get_option('zshcompletiondir') +if zshcompletiondir == '' + zshcompletiondir = join_paths(datadir, 'zsh', 'site-functions') +endif + # Configuration data cc = meson.get_compiler('c') @@ -420,6 +435,8 @@ check_dep = dependency('check', version : '>= 0.9.10', required : get_option('te configure_file(output : 'config.h', configuration : cdata) subdir('man') +subdir('shell-completion/bash') +subdir('shell-completion/zsh') subdir('src') ############################################################ @@ -441,8 +458,8 @@ summary = [ 'System Runtime Path: @0@'.format(cdata.get_unquoted('PA_SYSTEM_RUNTIME_PATH')), 'System State Path: @0@'.format(cdata.get_unquoted('PA_SYSTEM_STATE_PATH')), 'System Config Path: @0@'.format(cdata.get_unquoted('PA_SYSTEM_CONFIG_PATH')), -# 'Zsh completions directory: @0@'.format(${zshcompletiondir}), -# 'Bash completions directory: @0@'.format(${bashcompletiondir}), + 'Bash completions directory: @0@'.format(bashcompletiondir), + 'Zsh completions directory: @0@'.format(zshcompletiondir), 'Compiler: @0@ @1@'.format(cc.get_id(), cc.version()), # 'CFLAGS: @0@'.format(${CFLAGS}), # 'CPPFLAGS: @0@'.format(${CPPFLAGS}), diff --git a/meson_options.txt b/meson_options.txt index 09927171b..fadd587f1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -24,6 +24,12 @@ option('pulsedspdir', option('modlibexecdir', type : 'string', description : 'Specify location where modules will be installed') +option('bashcompletiondir', + type : 'string', + description : 'Directory for bash completion files') +option('zshcompletiondir', + type : 'string', + description : 'Zsh completions directory') # Optional features diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build new file mode 100644 index 000000000..443049bd1 --- /dev/null +++ b/shell-completion/bash/meson.build @@ -0,0 +1,17 @@ +aliases = [ + 'pacat', + 'pacmd', + 'pactl', + 'padsp', + 'paplay', + 'parec', + 'parecord', + 'pasuspender', +] + +install_data('pulseaudio', install_dir : bashcompletiondir) + +foreach alias : aliases + dst = join_paths(bashcompletiondir, alias) + meson.add_install_script('ln', '-fs', 'pulseaudio', dst) +endforeach diff --git a/shell-completion/zsh/meson.build b/shell-completion/zsh/meson.build new file mode 100644 index 000000000..88c33554f --- /dev/null +++ b/shell-completion/zsh/meson.build @@ -0,0 +1 @@ +install_data('_pulseaudio', install_dir : zshcompletiondir) |