Skip to content

build: Allow passing bash-completion dir and have a generic fallback

Mart Raudsepp requested to merge mraudsepp/dconf:bash-completion-dir into main

With autotools the installation path was just hardcoded to the usual location. In meson it was made to always check the path from bash-completion.pc, but some downstream might want to install the file without a bash-completion build-dep. Allow installing the completion file to a passed directory, and add back the fallback path if an explicit directory isn't passed and bash-completion package isn't found. This is also what the tracker project does.

I need this downstream because we (Gentoo) are source-based and we don't want to have a bash-completion build-dep just for installing a static file, because that build-dep would be imposed on the user. We also have a policy to not provide a choice for this, due to it being just a small file, thus we have tooling to figure out the necessary directory for passing to a build system option (it basically does the same thing as meson.build after this MR when default 'yes' is chosen) - however no such option existed and build would fail due to potentially not finding bash-completion package. If we can't change the option name to be clear (have _dir suffix), then that could be changed back to the old option name with the added semantics - if boolean values are passed, it'll work just as before in that case.

Merge request reports