Improve handling of package dependencies, support CMake and Meson #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fairly large-looking refactor aimed to replace manual
dependency configuration in package classes with automatic discovery
using pkg-config or CMake-provided package configs. Most packages ship
those and setting
PKG_CONFIG_PATH
andCMAKE_PREFIX_PATH
is far morerobust than fiddling with
*FLAGS
directly.This also adds full support for the CMake and Meson build systems and
makes lots of small changes required to do so in a clean fashion and
also to reduce boilerplate in package classes.
Specifically:
overloading
get_configure_script
is no longer necessary for packagesusing supported build systems,
get_configure_args
andget_configure_env
should be overloaded instead, returning a cleandictionary of flags instead;
related to above, calling
configure_dependency
directly is notrequired anymore, dependencies are auto-configured based on their
own build system declaration;
get_build_script
andget_build_install_script
overloads should notcall
make
(or whatever build system equivalent) and should insteadcall
get_build_command()
andget_build_install_command()
correspondingly which take care of command formatting and injection of
environment and global arguments.
Additionally, the root package can now control the overall layout of the
package bundle:
get_dep_install_subdir
may be overloaded to put all dependencies undera specified root, which is useful for packaging plugins and extensions
that have dynamic library dependencies which should ideally be isolated
with from similar dependencies of the host program;
get_root_install_subdir
may be overloaded to customize the name ofthe common parent directory in the installation prefix, e.g in
/opt/<subdir>
or/usr/lib/<host-triple>/<subdir>
.Other misc improvements and fixes:
{mandir}
and{docdir}
install patterns instead of hardcoded{datadir}
-based paths;