mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
meson: install bash completion helper for ges-launch-1.0
Fixes #77 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/203>
This commit is contained in:
parent
2cd8e6d0db
commit
a1d5282ba7
3 changed files with 43 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
project('gst-editing-services', 'c',
|
||||
version : '1.17.2.1',
|
||||
meson_version : '>= 0.48',
|
||||
meson_version : '>= 0.49',
|
||||
default_options : [ 'warning_level=1',
|
||||
'buildtype=debugoptimized' ])
|
||||
|
||||
|
@ -33,6 +33,9 @@ mathlib = cc.find_library('m', required : false)
|
|||
|
||||
cdata = configuration_data()
|
||||
|
||||
prefix = get_option('prefix')
|
||||
datadir = prefix / get_option('datadir')
|
||||
|
||||
# Ignore several spurious warnings for things gstreamer does very commonly
|
||||
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
|
||||
# If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
|
||||
|
|
|
@ -11,6 +11,8 @@ option('tools', type : 'feature', value : 'auto', yield : true,
|
|||
description : 'Build ges-launch command line tool')
|
||||
|
||||
# GES options
|
||||
option('bash-completion', type : 'feature', value : 'auto',
|
||||
description : 'Install bash completion files')
|
||||
option('pygi-overrides-dir', type : 'string', value : '',
|
||||
description: 'Path to pygobject overrides directory')
|
||||
option('xptv', type : 'feature', value : 'auto',
|
||||
|
|
|
@ -14,3 +14,40 @@ ges_launch = executable('ges-launch-@0@'.format(apiversion),
|
|||
)
|
||||
|
||||
install_man('ges-launch-1.0.1')
|
||||
|
||||
# bash completion
|
||||
bashcomp_option = get_option('bash-completion')
|
||||
bashcomp_dep = dependency('bash-completion', version : '>= 2.0', required : bashcomp_option)
|
||||
bash_completions_dir = ''
|
||||
bash_helpers_dir = ''
|
||||
|
||||
bashcomp_found = false
|
||||
if bashcomp_dep.found()
|
||||
bashcomp_found = true
|
||||
bashcomp_dir_override = bashcomp_dep.version().version_compare('>= 2.10') ? ['datadir', datadir] : ['prefix', prefix]
|
||||
bash_completions_dir = bashcomp_dep.get_pkgconfig_variable('completionsdir', define_variable: bashcomp_dir_override)
|
||||
if bash_completions_dir == ''
|
||||
msg = 'Found bash-completion but the .pc file did not set \'completionsdir\'.'
|
||||
if bashcomp_option.enabled()
|
||||
error(msg)
|
||||
else
|
||||
message(msg)
|
||||
endif
|
||||
bashcomp_found = false
|
||||
endif
|
||||
|
||||
bash_helpers_dir = bashcomp_dep.get_pkgconfig_variable('helpersdir', define_variable: bashcomp_dir_override)
|
||||
if bash_helpers_dir == ''
|
||||
msg = 'Found bash-completion, but the .pc file did not set \'helpersdir\'.'
|
||||
if bashcomp_option.enabled()
|
||||
error(msg)
|
||||
else
|
||||
message(msg)
|
||||
endif
|
||||
bashcomp_found = false
|
||||
endif
|
||||
|
||||
if bashcomp_found
|
||||
install_data('../data/completions/ges-launch-1.0', install_dir : bash_completions_dir)
|
||||
endif
|
||||
endif
|
||||
|
|
Loading…
Reference in a new issue