public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Eli Schwartz" <eschwartz93@gmail.com>,
	"Sam James" <sam@gentoo.org>, "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH v2 7/7] distutils-r1.eclass: wire up meson-python to meson.eclass
Date: Tue,  5 Mar 2024 18:16:36 +0100	[thread overview]
Message-ID: <20240305171812.125985-8-mgorny@gentoo.org> (raw)
In-Reply-To: <20240305171812.125985-1-mgorny@gentoo.org>

From: Eli Schwartz <eschwartz93@gmail.com>

The meson-python build backend -- as the name suggests -- uses meson
under the hood. We have a meson eclass which does lots of useful things
pertinent to meson. Make sure it gets invoked, by prying out the options
that meson_src_configure would use and setting passing them as our seed
values for gpep517.

[sam: Tweak '=' style.]
[sam: Tweak mesonargs->MESONARGS for final version of e9189344b971f7ee0e2bec36650c57dbade4f122.]
[sam: Update local variable list.]
[mgorny: Add local variables for LTO filtering.]

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/distutils-r1.eclass | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 134cb39f276a..e0c54d81a846 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -197,6 +197,10 @@ _DISTUTILS_R1_ECLASS=1
 inherit flag-o-matic
 inherit multibuild multilib multiprocessing ninja-utils toolchain-funcs
 
+if [[ ${DISTUTILS_USE_PEP517} == meson-python ]]; then
+	inherit meson
+fi
+
 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
 	inherit python-r1
 else
@@ -1386,9 +1390,19 @@ distutils_pep517_install() {
 			)
 			;;
 		meson-python)
+			# variables defined by setup_meson_src_configure
+			local MESONARGS=() BOOST_INCLUDEDIR BOOST_LIBRARYDIR NM READELF
+			# it also calls filter-lto
+			local x
+			for x in $(all-flag-vars); do
+				local -x "${x}=${!x}"
+			done
+
+			setup_meson_src_configure "${DISTUTILS_ARGS[@]}"
+
 			local -x NINJAOPTS=$(get_NINJAOPTS)
 			config_settings=$(
-				"${EPYTHON}" - "${DISTUTILS_ARGS[@]}" <<-EOF || die
+				"${EPYTHON}" - "${MESONARGS[@]}" <<-EOF || die
 					import json
 					import os
 					import shlex
-- 
2.44.0



      parent reply	other threads:[~2024-03-05 17:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 17:16 [gentoo-dev] [PATCH v2 0/7] distutils-r1.eclass + python-utils-r1.eclass + meson.eclass: combined patches Michał Górny
2024-03-05 17:16 ` [gentoo-dev] [PATCH v2 1/7] distutils-r1.eclass: Remove -Werror... hack (now in cython) Michał Górny
2024-03-05 17:16 ` [gentoo-dev] [PATCH v2 2/7] distutils-r1.eclass: Limit DISTUTILS_EXT logic to compile & test Michał Górny
2024-03-05 17:16 ` [gentoo-dev] [PATCH v2 3/7] distutils-r1.eclass: Move filter-lto into DISTUTILS_EXT block Michał Górny
2024-03-05 17:16 ` [gentoo-dev] [PATCH v2 4/7] distutils-r1.eclass: Make vars local before calling filter-lto Michał Górny
2024-03-09 19:59   ` Mike Gilbert
2024-03-10  1:58     ` Eli Schwartz
2024-03-05 17:16 ` [gentoo-dev] [PATCH v2 5/7] python-utils-r1.eclass: Fix python_doheader install location with ROOT Michał Górny
2024-03-05 17:16 ` [gentoo-dev] [PATCH v2 6/7] meson.eclass: move python_export_utf8_locale to meson_src_configure Michał Górny
2024-03-05 17:16 ` Michał Górny [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240305171812.125985-8-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=eschwartz93@gmail.com \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=sam@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox