This commit is contained in:
Picnoir 2024-04-04 16:44:03 +02:00
parent ae9076ab19
commit 693f2be36f
3 changed files with 6 additions and 7 deletions

View File

@ -79,12 +79,11 @@ address_sanitizer = get_option('b_sanitize') == 'address' or \
get_option('b_sanitize') == 'leak'
bashcomp = dependency('bash-completion', required: get_option('bashcomp'))
zshcomp = get_option('zshcomp') != ''
python = import('python')
python3 = python.find_installation('python3')
if bashcomp.found() or zshcomp
if bashcomp.found() or get_option('zshcomp')
python3_required_modules += 'shtab'
gi_required_modules += powerprofilesctl_required_gi_modules
endif

View File

@ -23,6 +23,6 @@ option('bashcomp',
type: 'feature',
value: 'auto')
option('zshcomp',
description: 'path for zsh completion file',
type: 'string',
value: '')
description: 'generate zsh completion file',
type: 'feature',
value: 'auto')

View File

@ -23,14 +23,14 @@ if bashcomp.found()
)
endif
if zshcomp
if get_option('zshcomp')
custom_target('zsh-completion',
output: '_powerprofilesctl',
command: [
generate_completion,
'zsh',
],
install_dir: get_option('zshcomp'),
install_dir: get_option('datadir') / 'zsh' / 'site-functions',
kwargs: completions_common,
)
endif