fwupd/data/bash-completion/meson.build
Jan Tojnar 0f035013df build: Install bash-completion relative to datadir
Since bash-completion 2.9, it was no longer possible to override
the completionsdir through prefix. [1] In 2.10, the overridability
was re-estabilished but this time through datadir variable. [2]

This should not really matter except for developers installing the project
into a custom prefix or distros using per-package prefixes like NixOS.

[1]: 81ba2c7e7d
[2]: https://github.com/scop/bash-completion/pull/344
2020-04-16 12:45:19 -05:00

34 lines
863 B
Meson

if bashcomp.found()
completions_dir = bashcomp.get_pkgconfig_variable('completionsdir',
define_variable: bashcomp.version().version_compare('>= 2.10') ? ['datadir', datadir] : ['prefix', prefix],
)
if get_option('agent')
install_data(['fwupdagent'],
install_dir : completions_dir,
)
endif # get_option('agent')
# replace @libexecdir@
fwupdtool_path = join_paths(libexecdir, 'fwupd')
con2 = configuration_data()
con2.set('libexecdir', fwupdtool_path)
configure_file(
input : 'fwupdtool.in',
output : 'fwupdtool',
configuration : con2,
install: true,
install_dir: completions_dir)
if build_daemon and get_option('agent')
configure_file(
input : 'fwupdmgr.in',
output : 'fwupdmgr',
configuration : con2,
install: true,
install_dir: completions_dir)
endif # build_daemon and get_option('agent')
endif # bashcomp.found()