diff options
author | William Hubbs <williamh@gentoo.org> | 2021-08-26 12:15:21 -0500 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2021-08-26 12:15:21 -0500 |
commit | 5974284d8cb3c2b6d3dab3ad83c2f270db3b0798 (patch) | |
tree | 711cfda6903bcf988ea7a9ca90f1cb0f06de787a /eclass/meson.eclass | |
parent | net-im/zoom: Remove old (diff) | |
download | gentoo-5974284d8cb3c2b6d3dab3ad83c2f270db3b0798.tar.gz gentoo-5974284d8cb3c2b6d3dab3ad83c2f270db3b0798.tar.bz2 gentoo-5974284d8cb3c2b6d3dab3ad83c2f270db3b0798.zip |
meson.eclass: several cleanups
- Drop the unused emesontestargs variable.
- Use the compile and install subcommands of meson instead of calling
ninja. This allows for the possibility of a different back end.
- Stop using the NINJAOPTS variable.
- Add --num-processes to "meson test" call regardless of whether MAKEOPTS
is set since the default is 1 process.
- Pass --jobs 0 instead of 999 to represent infinity.
- Echo commands before running them.
Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'eclass/meson.eclass')
-rw-r--r-- | eclass/meson.eclass | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/eclass/meson.eclass b/eclass/meson.eclass index 2a563e367c66..8b22797da718 100644 --- a/eclass/meson.eclass +++ b/eclass/meson.eclass @@ -77,12 +77,6 @@ fi # Optional meson arguments as Bash array; this should be defined before # calling meson_src_configure. -# @VARIABLE: emesontestargs -# @DEFAULT_UNSET -# @DESCRIPTION: -# Optional meson test arguments as Bash array; this should be defined before -# calling meson_src_test. - # @VARIABLE: MYMESONARGS # @DEFAULT_UNSET # @DESCRIPTION: @@ -379,7 +373,17 @@ meson_src_configure() { meson_src_compile() { debug-print-function ${FUNCNAME} "$@" - eninja -C "${BUILD_DIR}" "$@" + local mesoncompileargs=( + -C "${BUILD_DIR}" + --jobs "$(makeopts_jobs "${MAKEOPTS}" 0)" + --load-average "$(makeopts_loadavg "${MAKEOPTS}" 0)" + --verbose + "$@" + ) + + set -- meson compile "${mesoncompileargs[@]}" + echo "$@" >&2 + "$@" || die "compile failed" } # @FUNCTION: meson_src_test @@ -391,28 +395,31 @@ meson_src_test() { local mesontestargs=( -C "${BUILD_DIR}" + --num-processes "$(makeopts_jobs "${MAKEOPTS}")" + "$@" ) - [[ -n ${NINJAOPTS} || -n ${MAKEOPTS} ]] && - mesontestargs+=( - --num-processes "$(makeopts_jobs ${NINJAOPTS:-${MAKEOPTS}})" - ) - - # Append additional arguments from ebuild - mesontestargs+=("${emesontestargs[@]}") - set -- meson test "${mesontestargs[@]}" "$@" + set -- meson test "${mesontestargs[@]}" echo "$@" >&2 "$@" || die "tests failed" } # @FUNCTION: meson_src_install -# @USAGE: [extra ninja install arguments] +# @USAGE: [extra meson install arguments] # @DESCRIPTION: # This is the meson_src_install function. meson_src_install() { debug-print-function ${FUNCNAME} "$@" - DESTDIR="${D}" eninja -C "${BUILD_DIR}" install "$@" + local mesoninstallargs=( + -C "${BUILD_DIR}" + --destdir "${D}" + "$@" + ) + + set -- meson install "${mesoninstallargs[@]}" + echo "$@" >&2 + "$@" || die "install failed" pushd "${S}" > /dev/null || die einstalldocs |