From e68814c2ea05e0fec24fbdeaa70d9f4f52a34efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sun, 30 Aug 2026 21:06:59 +0200 Subject: [PATCH] distutils-r1.eclass: Use SYSROOT condition for all cross logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Acked by chewi. Signed-off-by: Michał Górny Part-of: https://codeberg.org/gentoo/gentoo/pulls/1732 Merges: https://codeberg.org/gentoo/gentoo/pulls/1732 --- eclass/distutils-r1.eclass | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 0d0d4672d668a..bbeea93126607 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -1162,11 +1162,6 @@ distutils_pep517_install() { die "DISTUTILS_CONFIG_SETTINGS_JSON supported only for standalone backends" fi - # https://pyo3.rs/latest/building-and-distribution.html#cross-compiling - if tc-is-cross-compiler; then - local -x PYO3_CROSS_LIB_DIR=${SYSROOT}/$(python_get_stdlib) - fi - local build_backend=$(_distutils-r1_get_backend) einfo " Building the wheel for ${PWD#${WORKDIR}/} via ${build_backend}" cmd+=( @@ -1180,6 +1175,9 @@ distutils_pep517_install() { cmd+=( --config-json "${config_settings}" ) fi if [[ -n ${SYSROOT} ]]; then + # https://pyo3.rs/latest/building-and-distribution.html#cross-compiling + local -x PYO3_CROSS_LIB_DIR=${SYSROOT}/$(python_get_stdlib) + cmd+=( --sysroot "${SYSROOT}" ) fi printf '%s\n' "${cmd[*]}"