public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH v2] meson.eclass: stop calling ninja
@ 2021-08-24 14:58 William Hubbs
  0 siblings, 0 replies; only message in thread
From: William Hubbs @ 2021-08-24 14:58 UTC (permalink / raw
  To: gentoo-dev; +Cc: William Hubbs

Use the compile and install subcommands of meson instead of calling
ninja. This allows for the possibility of a different back end.

Signed-off-by: William Hubbs <williamh@gentoo.org>
---
 eclass/meson.eclass | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 2a563e367c6..0bc74012fb1 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -379,7 +379,19 @@ meson_src_configure() {
 meson_src_compile() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	eninja -C "${BUILD_DIR}" "$@"
+	local mesoncompileargs=(
+		-C "${BUILD_DIR}"
+	)
+	# use NINJAOPTS before MAKEOPTS for consistency with meson_src_test
+	local options="${NINJAOPTS:-${MAKEOPTS}}"
+	if [[ -n ${options} ]]; then
+		mesoncompileargs+=(
+			--jobs "$(makeopts_jobs ${options})"
+			--load-average "$(makeopts_loadavg ${options})"
+		)
+	fi
+
+	meson compile "${mesoncompileargs[@]}" "$@" || die "compile failed"
 }
 
 # @FUNCTION: meson_src_test
@@ -406,13 +418,17 @@ meson_src_test() {
 }
 
 # @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}"
+	)
+	meson install "${mesoninstallargs[@]}" "$@"
 
 	pushd "${S}" > /dev/null || die
 	einstalldocs
-- 
2.31.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-24 14:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-24 14:58 [gentoo-dev] [PATCH v2] meson.eclass: stop calling ninja William Hubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox