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 <rran...@chromium.org>. Closes: https://github.com/gentoo/gentoo/pull/30469 Signed-off-by: Michał Górny <mgo...@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