The meson eclass should have an equivalent of econf_build to support projects that build their own tools to execute natively but don't understand cross-compilation. The meson_src_configure function is huge but only requires a few tweaks to provide this functionality. Maybe it could be converted to an internal function that takes an argument to select native configuration, so meson_src_configure and meson_build could both just call that? Here is a prototype edit to demonstrate: - Set the new function name - Drop the cross file - Pick a different build directory - Copy --build.pkg-config-path to --pkg-config-path For correctness, this also requires an EAPI change to support "get_libdir -b" as in bug #762454, but it can use BUILD_PKG_CONFIG_PATH to work around it. --- eclass/meson.eclass +++ eclass/meson.eclass @@ -379,6 +379,13 @@ ) || die } +eval "$(declare -f meson_src_configure | sed ' +s/meson_src_configure/meson_build/g +s/.*cross_file/: # &/ +s,BUILD_DIR=.*,local BUILD_DIR="${WORKDIR}/${P}-native", +/build.pkg/{s/[^ ]*-pkg[^ ]* *[^ ]*//;s/\([^ ]*\)build.\(pkg[^ ]* [^ ]*\)/& \1\2/;} +')" + # @FUNCTION: meson_src_compile # @USAGE: [extra ninja arguments] # @DESCRIPTION: