[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev] [PATCH 2/5] distutils-r1.eclass: Add PYTHON_DEPS to DEPEND when DISTUTILS_EXT
From:       Michał Górny <mgorny () gentoo ! org>
Date:       2023-04-20 14:29:52
Message-ID: 20230420142955.1092937-3-mgorny () gentoo ! org
[Download RAW message or body]

Add `${PYTHON_DEPS}` to `DEPEND` (i.e. `SYSROOT` dependencies) when
building extensions.  This is necessary to support cross-compilations
correctly.

Originally proposed by Raul E Rangel <rrangel@chromium.org>.

Closes: https://github.com/gentoo/gentoo/pull/30469
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/distutils-r1.eclass | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index f283aa90cfaa..f56fa5a51efa 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -55,6 +55,11 @@ esac
 # Set this variable to a non-null value if the package (possibly
 # optionally) builds Python extensions (loadable modules written in C,
 # Cython, Rust, etc.).
+#
+# When enabled, the eclass:
+#
+# - adds PYTHON_DEPS to DEPEND (for cross-compilation support), unless
+#   DISTUTILS_OPTIONAL is used
 
 # @ECLASS_VARIABLE: DISTUTILS_OPTIONAL
 # @DEFAULT_UNSET
@@ -317,6 +322,10 @@ _distutils_set_globals() {
 		RDEPEND="${PYTHON_DEPS} ${rdep}"
 		BDEPEND="${PYTHON_DEPS} ${bdep}"
 		REQUIRED_USE=${PYTHON_REQUIRED_USE}
+
+		if [[ ${DISTUTILS_EXT} ]]; then
+			DEPEND="${PYTHON_DEPS}"
+		fi
 	fi
 }
 _distutils_set_globals
-- 
2.40.0


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic