From 7c29fbd36f87426b78fe4baa6eb1a68661fc1374 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Tue, 7 Sep 2021 12:45:53 -0500 Subject: [PATCH] build: install bash and zsh completions --- bash-completion/meson.build | 10 ++++++++++ meson.build | 6 ++++++ meson_options.txt | 4 ++++ zsh-completion/meson.build | 9 +++++++++ 4 files changed, 29 insertions(+) create mode 100644 bash-completion/meson.build create mode 100644 zsh-completion/meson.build diff --git a/bash-completion/meson.build b/bash-completion/meson.build new file mode 100644 index 00000000..926bb065 --- /dev/null +++ b/bash-completion/meson.build @@ -0,0 +1,10 @@ +bash_completions = [ + 'openrc', + 'openrc-service-script', + 'rc-service', + 'rc-status', + 'rc-update', + ] + +install_data(bash_completions, + install_dir : get_option('datadir') / 'bash-completion/completions') diff --git a/meson.build b/meson.build index 585ebb2d..3ac018ec 100644 --- a/meson.build +++ b/meson.build @@ -156,6 +156,9 @@ init_d_conf_data.set('SYSCONFDIR', get_option('sysconfdir')) dl_dep = cc.find_library('dl', required: false) util_dep = cc.find_library('util', required: false) +if get_option('bash-completions') + subdir('bash-completion') +endif subdir('conf.d') subdir('etc') subdir('init.d') @@ -169,6 +172,9 @@ subdir('sh') subdir('src') subdir('support') subdir('sysctl.d') +if get_option('zsh-completions') + subdir('zsh-completion') +endif meson.add_install_script('tools/meson_runlevels.sh', os, diff --git a/meson_options.txt b/meson_options.txt index cd922a21..e4e7c4df 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,7 @@ option('audit', type : 'feature', value : 'auto', description : 'enable libaudit support') +option('bash-completions', type : 'boolean', + description : 'install bash completions') option('branding', type : 'string', description : 'Add branding to OpenRC') option('local_prefix', type : 'string', value : '/usr/local', @@ -31,3 +33,5 @@ option('termcap', type : 'combo', choices : [ '', 'ncurses', 'termcap' ], description : 'the termcap library to use') +option('zsh-completions', type : 'boolean', + description : 'install zsh completions') diff --git a/zsh-completion/meson.build b/zsh-completion/meson.build new file mode 100644 index 00000000..b55d326b --- /dev/null +++ b/zsh-completion/meson.build @@ -0,0 +1,9 @@ +zsh_completions = [ + '_openrc', + '_rc-service', + '_rc-status', + '_rc-update', + ] + +install_data(zsh_completions, + install_dir : get_option('datadir') / 'zsh/site-functions')