1 |
commit: e321a72564094603b5cb8c43dd7a54f970e1aa79 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 31 08:39:49 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 1 18:33:20 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e321a725 |
7 |
|
8 |
distutils-r1.eclass: Add DISTUTILS_DEPS output var for PEP 517 mode |
9 |
|
10 |
The PEP 517 build-time deps have gotten more complex, and largely depend |
11 |
on the internal eclass logic used to build and install wheels. |
12 |
Introduce a DISTUTILS_DEPS output variable that contains the correct |
13 |
BDEPEND string for use in DISTUTILS_OPTIONAL=1 ebuilds. |
14 |
|
15 |
Bug: https://bugs.gentoo.org/832337 |
16 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
17 |
|
18 |
eclass/distutils-r1.eclass | 34 +++++++++++++++++++++++++++++++++- |
19 |
1 file changed, 33 insertions(+), 1 deletion(-) |
20 |
|
21 |
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass |
22 |
index 4a9fdb4018b4..a0ad598eb58f 100644 |
23 |
--- a/eclass/distutils-r1.eclass |
24 |
+++ b/eclass/distutils-r1.eclass |
25 |
@@ -128,6 +128,24 @@ esac |
26 |
# It is available only in non-PEP517 mode. It needs to be set before |
27 |
# the inherit line. |
28 |
|
29 |
+# @ECLASS-VARIABLE: DISTUTILS_DEPS |
30 |
+# @OUTPUT_VARIABLE |
31 |
+# @DESCRIPTION: |
32 |
+# This is an eclass-generated build-time dependency string for the build |
33 |
+# system packages. This string is automatically appended to BDEPEND |
34 |
+# unless DISTUTILS_OPTIONAL is used. This variable is available only |
35 |
+# in PEP 517 mode. |
36 |
+# |
37 |
+# Example use: |
38 |
+# @CODE |
39 |
+# DISTUTILS_OPTIONAL=1 |
40 |
+# # ... |
41 |
+# RDEPEND="${PYTHON_DEPS}" |
42 |
+# BDEPEND=" |
43 |
+# ${PYTHON_DEPS} |
44 |
+# ${DISTUTILS_DEPS}" |
45 |
+# @CODE |
46 |
+ |
47 |
if [[ ! ${_DISTUTILS_R1} ]]; then |
48 |
|
49 |
[[ ${EAPI} == 6 ]] && inherit eutils xdg-utils |
50 |
@@ -156,7 +174,7 @@ _distutils_set_globals() { |
51 |
|
52 |
# installer is used to install the wheel |
53 |
# tomli is used to read build-backend from pyproject.toml |
54 |
- bdep+=' |
55 |
+ bdep=' |
56 |
>=dev-python/installer-0.4.0_p20220124[${PYTHON_USEDEP}] |
57 |
dev-python/tomli[${PYTHON_USEDEP}]' |
58 |
case ${DISTUTILS_USE_PEP517} in |
59 |
@@ -213,6 +231,20 @@ _distutils_set_globals() { |
60 |
[[ -n ${rdep} ]] && rdep="$(python_gen_cond_dep "${rdep}")" |
61 |
fi |
62 |
|
63 |
+ if [[ ${DISTUTILS_USE_PEP517} ]]; then |
64 |
+ if [[ ${DISTUTILS_DEPS+1} ]]; then |
65 |
+ if [[ ${DISTUTILS_DEPS} != "${bdep}" ]]; then |
66 |
+ eerror "DISTUTILS_DEPS have changed between inherits!" |
67 |
+ eerror "Before: ${DISTUTILS_DEPS}" |
68 |
+ eerror "Now : ${bdep}" |
69 |
+ die "DISTUTILS_DEPS integrity check failed" |
70 |
+ fi |
71 |
+ else |
72 |
+ DISTUTILS_DEPS=${bdep} |
73 |
+ readonly DISTUTILS_DEPS |
74 |
+ fi |
75 |
+ fi |
76 |
+ |
77 |
if [[ ! ${DISTUTILS_OPTIONAL} ]]; then |
78 |
RDEPEND="${PYTHON_DEPS} ${rdep}" |
79 |
if [[ ${EAPI} != 6 ]]; then |