public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH v5] meson.eclass: several cleanups
@ 2021-08-25 15:27 William Hubbs
  2021-08-25 16:16 ` William Hubbs
  0 siblings, 1 reply; 3+ messages in thread
From: William Hubbs @ 2021-08-25 15:27 UTC (permalink / raw
  To: gentoo-dev; +Cc: floppym, William Hubbs

- 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.
- Remove extraneous whitespace.
---
 eclass/meson.eclass | 41 ++++++++++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 17 deletions(-)

diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 2a563e367c6..8b22797da71 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
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH v5] meson.eclass: several cleanups
  2021-08-25 15:27 [gentoo-dev] [PATCH v5] meson.eclass: several cleanups William Hubbs
@ 2021-08-25 16:16 ` William Hubbs
  2021-08-26 17:19   ` William Hubbs
  0 siblings, 1 reply; 3+ messages in thread
From: William Hubbs @ 2021-08-25 16:16 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

On Wed, Aug 25, 2021 at 10:27:54AM -0500, William Hubbs wrote:
> - Remove extraneous whitespace.

This will be removed from the commit message before I add the patch to
the tree, and a sign-off will be added.

Thanks,

William


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH v5] meson.eclass: several cleanups
  2021-08-25 16:16 ` William Hubbs
@ 2021-08-26 17:19   ` William Hubbs
  0 siblings, 0 replies; 3+ messages in thread
From: William Hubbs @ 2021-08-26 17:19 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

On Wed, Aug 25, 2021 at 11:16:40AM -0500, William Hubbs wrote:
> On Wed, Aug 25, 2021 at 10:27:54AM -0500, William Hubbs wrote:
> > - Remove extraneous whitespace.
> 
> This will be removed from the commit message before I add the patch to
> the tree, and a sign-off will be added.

This is in the tree.

Thanks,

William

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-26 17:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-25 15:27 [gentoo-dev] [PATCH v5] meson.eclass: several cleanups William Hubbs
2021-08-25 16:16 ` William Hubbs
2021-08-26 17:19   ` William Hubbs

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