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 20017158020 for ; Mon, 12 Dec 2022 06:20:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D6F1FE088F; Mon, 12 Dec 2022 06:19:29 +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 9953BE087E for ; Mon, 12 Dec 2022 06:19:29 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 2/4] distutils-r1.eclass: Pass --sysroot to gpep517 when cross-compiling Date: Mon, 12 Dec 2022 07:19:20 +0100 Message-Id: <20221212061922.46687-3-mgorny@gentoo.org> X-Mailer: git-send-email 2.38.2 In-Reply-To: <20221212061922.46687-1-mgorny@gentoo.org> References: <20221212061922.46687-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: 6e7e4c78-fec7-48e0-b32b-acf61e2b60e0 X-Archives-Hash: 3b94f4f08fbfd9bb41f0a5d0f7662d07 Signed-off-by: Michał Górny --- eclass/distutils-r1.eclass | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 6e8ff5467bdb..371d52bcb7ef 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -1033,6 +1033,11 @@ distutils-r1_python_prepare_all() { python_export_utf8_locale _distutils-r1_print_package_versions + if [[ -n ${SYSROOT} ]] && ! has_version -b ">=dev-python/gpep517-12"; then + ewarn ">=dev-python/gpep517-12 features cross-compilation fixes." + ewarn "Please consider upgrading to avoid issues." + fi + _DISTUTILS_DEFAULT_CALLED=1 } @@ -1356,16 +1361,18 @@ distutils_pep517_install() { local build_backend=$(_distutils-r1_get_backend) einfo " Building the wheel for ${PWD#${WORKDIR}/} via ${build_backend}" - local config_args=() - [[ -n ${config_settings} ]] && - config_args+=( --config-json "${config_settings}" ) local cmd=( gpep517 build-wheel --backend "${build_backend}" --output-fd 3 --wheel-dir "${WHEEL_BUILD_DIR}" - "${config_args[@]}" ) + if [[ -n ${config_settings} ]]; then + cmd+=( --config-json "${config_settings}" ) + fi + if [[ -n ${SYSROOT} ]] && has_version -b ">=dev-python/gpep517-12"; then + cmd+=( --sysroot "${SYSROOT}" ) + fi printf '%s\n' "${cmd[*]}" local wheel=$( "${cmd[@]}" 3>&1 >&2 || die "Wheel build failed" @@ -1428,7 +1435,9 @@ distutils-r1_python_compile() { # # see extension.py for list of suffixes # .pyx is added for Cython - if [[ 1 -ne ${jobs} && 2 -eq $( + # + # esetup.py does not respect SYSROOT, so skip it there + if [[ -z ${SYSROOT} && 1 -ne ${jobs} && 2 -eq $( find '(' -name '*.c' -o -name '*.cc' -o -name '*.cpp' \ -o -name '*.cxx' -o -name '*.c++' -o -name '*.m' \ -o -name '*.mm' -o -name '*.pyx' ')' -printf '\n' | -- 2.38.2