Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 02/18] distutils-r1.eclass: Support internal post-python_* phase functions
Date: Sat, 04 Jun 2022 09:04:32
Message-Id: 20220604090334.4003-3-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches by "Michał Górny"
1 Support running additional post-python_* phase functions for internal
2 usage. The goal is to replace some of the inline logic
3 in distutils-r1_python_* functions that relies on the user calling them
4 and additional calls to python_foreach_impl.
5
6 Signed-off-by: Michał Górny <mgorny@g.o>
7 ---
8 eclass/distutils-r1.eclass | 6 ++++++
9 1 file changed, 6 insertions(+)
10
11 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
12 index ed368da79896..d6fd176192de 100644
13 --- a/eclass/distutils-r1.eclass
14 +++ b/eclass/distutils-r1.eclass
15 @@ -1687,6 +1687,11 @@ distutils-r1_run_phase() {
16 fi
17
18 cd "${_DISTUTILS_INITIAL_CWD}" || die
19 + if [[ ! ${_DISTUTILS_IN_COMMON_IMPL} ]] &&
20 + declare -f "_distutils-r1_post_python_${EBUILD_PHASE}" >/dev/null
21 + then
22 + "_distutils-r1_post_python_${EBUILD_PHASE}"
23 + fi
24 return "${ret}"
25 }
26
27 @@ -1701,6 +1706,7 @@ distutils-r1_run_phase() {
28 # of sources made for the selected Python interpreter.
29 _distutils-r1_run_common_phase() {
30 local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR}
31 + local _DISTUTILS_IN_COMMON_IMPL=1
32
33 if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
34 # reuse the dedicated code branch
35 --
36 2.35.1