Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-python] [PATCH distutils-r1] Provide Python env in python_prepare_all().
Date: Sun, 27 Oct 2013 19:16:26
Message-Id: 1382901393-27141-1-git-send-email-mgorny@gentoo.org
1 Some of the ebuilds need that, and call 'python_export_best' explicitly
2 for that reason. It is better to handle it eclass-wide, and therefore
3 gain consistency with other _all() phases.
4 ---
5 eclass/distutils-r1.eclass | 21 +++++++++++++++------
6 1 file changed, 15 insertions(+), 6 deletions(-)
7
8 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
9 index 2b609b4..b3ffd13 100644
10 --- a/eclass/distutils-r1.eclass
11 +++ b/eclass/distutils-r1.eclass
12 @@ -655,12 +655,21 @@ distutils-r1_src_prepare() {
13
14 local _DISTUTILS_DEFAULT_CALLED
15
16 - # common preparations
17 - if declare -f python_prepare_all >/dev/null; then
18 - python_prepare_all
19 - else
20 - distutils-r1_python_prepare_all
21 - fi
22 + _distutils-r1_run_prepare_all() {
23 + # we need to keep those local to ensure that the best-impl
24 + # setting doesn't leak through to per-impl phases
25 + local -x EPYTHON PYTHON
26 + local -x PATH=${PATH} PKG_CONFIG_PATH=${PKG_CONFIG_PATH}
27 + python_setup
28 +
29 + # common preparations
30 + if declare -f python_prepare_all >/dev/null; then
31 + python_prepare_all
32 + else
33 + distutils-r1_python_prepare_all
34 + fi
35 + }
36 + _distutils-r1_run_prepare_all
37
38 if [[ ! ${_DISTUTILS_DEFAULT_CALLED} ]]; then
39 eqawarn "QA warning: python_prepare_all() didn't call distutils-r1_python_prepare_all"
40 --
41 1.8.4