From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4A4DB158043 for ; Tue, 5 Mar 2024 17:20:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6D5BDE2A4A; Tue, 5 Mar 2024 17:18:26 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0EFB1E2A45 for ; Tue, 5 Mar 2024 17:18:26 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: Eli Schwartz , Sam James , =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 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 Message-ID: <20240305171812.125985-8-mgorny@gentoo.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240305171812.125985-1-mgorny@gentoo.org> References: <20240305171812.125985-1-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 49c2d5c5-4357-4d5c-9073-00b5c70b89a9 X-Archives-Hash: fa365c81e1b10a3963abff42c0b94401 From: Eli Schwartz 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 Signed-off-by: Sam James Signed-off-by: Michał Górny --- 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