summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-01-31 09:39:49 +0100
committerMichał Górny <mgorny@gentoo.org>2022-02-01 19:33:20 +0100
commite321a72564094603b5cb8c43dd7a54f970e1aa79 (patch)
treeac1962196a574cafd3cfa7ffe10d22b31bc82f71
parentdistutils-r1.eclass: Move DISTUTILS_OPTIONAL check into set_globals (diff)
downloadgentoo-e321a72564094603b5cb8c43dd7a54f970e1aa79.tar.gz
gentoo-e321a72564094603b5cb8c43dd7a54f970e1aa79.tar.bz2
gentoo-e321a72564094603b5cb8c43dd7a54f970e1aa79.zip
distutils-r1.eclass: Add DISTUTILS_DEPS output var for PEP 517 mode
The PEP 517 build-time deps have gotten more complex, and largely depend on the internal eclass logic used to build and install wheels. Introduce a DISTUTILS_DEPS output variable that contains the correct BDEPEND string for use in DISTUTILS_OPTIONAL=1 ebuilds. Bug: https://bugs.gentoo.org/832337 Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--eclass/distutils-r1.eclass34
1 files changed, 33 insertions, 1 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 4a9fdb4018b4..a0ad598eb58f 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -128,6 +128,24 @@ esac
# It is available only in non-PEP517 mode. It needs to be set before
# the inherit line.
+# @ECLASS-VARIABLE: DISTUTILS_DEPS
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# This is an eclass-generated build-time dependency string for the build
+# system packages. This string is automatically appended to BDEPEND
+# unless DISTUTILS_OPTIONAL is used. This variable is available only
+# in PEP 517 mode.
+#
+# Example use:
+# @CODE
+# DISTUTILS_OPTIONAL=1
+# # ...
+# RDEPEND="${PYTHON_DEPS}"
+# BDEPEND="
+# ${PYTHON_DEPS}
+# ${DISTUTILS_DEPS}"
+# @CODE
+
if [[ ! ${_DISTUTILS_R1} ]]; then
[[ ${EAPI} == 6 ]] && inherit eutils xdg-utils
@@ -156,7 +174,7 @@ _distutils_set_globals() {
# installer is used to install the wheel
# tomli is used to read build-backend from pyproject.toml
- bdep+='
+ bdep='
>=dev-python/installer-0.4.0_p20220124[${PYTHON_USEDEP}]
dev-python/tomli[${PYTHON_USEDEP}]'
case ${DISTUTILS_USE_PEP517} in
@@ -213,6 +231,20 @@ _distutils_set_globals() {
[[ -n ${rdep} ]] && rdep="$(python_gen_cond_dep "${rdep}")"
fi
+ if [[ ${DISTUTILS_USE_PEP517} ]]; then
+ if [[ ${DISTUTILS_DEPS+1} ]]; then
+ if [[ ${DISTUTILS_DEPS} != "${bdep}" ]]; then
+ eerror "DISTUTILS_DEPS have changed between inherits!"
+ eerror "Before: ${DISTUTILS_DEPS}"
+ eerror "Now : ${bdep}"
+ die "DISTUTILS_DEPS integrity check failed"
+ fi
+ else
+ DISTUTILS_DEPS=${bdep}
+ readonly DISTUTILS_DEPS
+ fi
+ fi
+
if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
RDEPEND="${PYTHON_DEPS} ${rdep}"
if [[ ${EAPI} != 6 ]]; then