build: Do not use use auto dependencies for shell completion scripts
It is difficult for downstream to track dependencies when they are automatic. This results in shell completion scripts not being installed in packages because builders do not have the right dependency. This commit adds meson feature arguments to guard those dependencies so that downstream distributions can use `-Dauto_features=enabled`. For more explanation, see rule #3 of: https://blogs.gnome.org/mcatanzaro/2022/07/15/best-practices-for-build-options/ https://github.com/containers/toolbox/pull/1442 Signed-off-by: Valentin David <me@valentindavid.com>
This commit is contained in:
parent
037dc29388
commit
3092ca5f75
|
|
@ -29,7 +29,7 @@ skopeo = find_program('skopeo', required: false)
|
|||
|
||||
bashcompletionsdir = get_option('bash_completions_dir')
|
||||
if bashcompletionsdir == ''
|
||||
bash_completion_dep = dependency('bash-completion', required: false)
|
||||
bash_completion_dep = dependency('bash-completion', required: get_option('bash_completions'))
|
||||
if bash_completion_dep.found()
|
||||
bashcompletionsdir = bash_completion_dep.get_variable(pkgconfig: 'completionsdir')
|
||||
endif
|
||||
|
|
@ -37,7 +37,7 @@ endif
|
|||
|
||||
fishcompletionsdir = get_option('fish_completions_dir')
|
||||
if fishcompletionsdir == ''
|
||||
fish_completion_dep = dependency('fish', required: false)
|
||||
fish_completion_dep = dependency('fish', required: get_option('fish_completions'))
|
||||
if fish_completion_dep.found()
|
||||
fishcompletionsdir = fish_completion_dep.get_variable(pkgconfig: 'completionsdir')
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -1,9 +1,21 @@
|
|||
option(
|
||||
'bash_completions',
|
||||
description: 'Install Bash completion scripts',
|
||||
type: 'feature',
|
||||
)
|
||||
|
||||
option(
|
||||
'bash_completions_dir',
|
||||
description: 'Directory for Bash completion scripts',
|
||||
type: 'string',
|
||||
)
|
||||
|
||||
option(
|
||||
'fish_completions',
|
||||
description: 'Install fish completion scripts',
|
||||
type: 'feature',
|
||||
)
|
||||
|
||||
option(
|
||||
'fish_completions_dir',
|
||||
description: 'Directory for fish completion scripts',
|
||||
|
|
|
|||
Loading…
Reference in New Issue