summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-04-19 13:00:46 +0200
committerMichał Górny <mgorny@gentoo.org>2023-04-22 08:17:01 +0200
commit4513d38fc645df01a068bafc18be9a0057836c8f (patch)
tree7b1ae6ae47d44e6d465268c918429e48d4182536 /eclass
parentdistutils-r1.eclass: Add DISTUTILS_EXT control variable (diff)
downloadgentoo-4513d38fc645df01a068bafc18be9a0057836c8f.tar.gz
gentoo-4513d38fc645df01a068bafc18be9a0057836c8f.tar.bz2
gentoo-4513d38fc645df01a068bafc18be9a0057836c8f.zip
distutils-r1.eclass: Add PYTHON_DEPS to DEPEND when DISTUTILS_EXT
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>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/distutils-r1.eclass9
1 files changed, 9 insertions, 0 deletions
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