commit: 4513d38fc645df01a068bafc18be9a0057836c8f Author: Michał Górny <mgorny <AT> gentoo <DOT> org> AuthorDate: Wed Apr 19 11:00:46 2023 +0000 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> CommitDate: Sat Apr 22 06:17:01 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4513d38f
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 <AT> chromium.org>. Closes: https://github.com/gentoo/gentoo/pull/30469 Signed-off-by: Michał Górny <mgorny <AT> 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