summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2012-12-07 17:55:04 +0000
committerMichał Górny <mgorny@gentoo.org>2012-12-07 17:55:04 +0000
commit176c845b7ac822341c675800ccb4acc53ac5d92e (patch)
treebbd2da2e0fa5c8cebcaa9296f7ce1817f6d46580 /eclass
parentwww-servers/tomcat: updated elog with migration information (diff)
downloadgentoo-2-176c845b7ac822341c675800ccb4acc53ac5d92e.tar.gz
gentoo-2-176c845b7ac822341c675800ccb4acc53ac5d92e.tar.bz2
gentoo-2-176c845b7ac822341c675800ccb4acc53ac5d92e.zip
Pass the best Python implementation info to the implementation-common phase functions.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/distutils-r1.eclass33
2 files changed, 32 insertions, 7 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index f3a2230fd85e..6380ccdcbb4b 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.546 2012/12/06 09:28:11 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.547 2012/12/07 17:55:04 mgorny Exp $
+
+ 07 Dec 2012; Michał Górny <mgorny@gentoo.org> distutils-r1.eclass:
+ Pass the best Python implementation info to the implementation-common phase
+ functions.
06 Dec 2012; Tomáš Chvátal <scarabeus@gentoo.org> waf-utils.eclass:
Introduce NO_WAF_LIBDIR to allow building packages that fails when libdir is
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index b1b3f9048506..4e097f8c29ef 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.24 2012/12/01 10:54:50 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.25 2012/12/07 17:55:04 mgorny Exp $
# @ECLASS: distutils-r1
# @MAINTAINER:
@@ -388,6 +388,27 @@ distutils-r1_run_phase() {
if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
popd &>/dev/null || die
fi
+
+ # Store them for reuse.
+ _DISTUTILS_BEST_IMPL=(
+ "${EPYTHON}" "${PYTHON}" "${BUILD_DIR}" "${PYTHONPATH}"
+ )
+}
+
+# @FUNCTION: _distutils-r1_run_common_phase
+# @USAGE: [<argv>...]
+# @INTERNAL
+# @DESCRIPTION:
+# Run the given command, restoring the best-implementation state.
+_distutils-r1_run_common_phase() {
+ local EPYTHON=${_DISTUTILS_BEST_IMPL[0]}
+ local PYTHON=${_DISTUTILS_BEST_IMPL[1]}
+ local BEST_BUILD_DIR=${_DISTUTILS_BEST_IMPL[2]}
+ local PYTHONPATH=${_DISTUTILS_BEST_IMPL[3]}
+
+ export EPYTHON PYTHON PYTHONPATH
+
+ "${@}"
}
distutils-r1_src_prepare() {
@@ -419,7 +440,7 @@ distutils-r1_src_configure() {
multijob_finish
if declare -f python_configure_all >/dev/null; then
- python_configure_all
+ _distutils-r1_run_common_phase python_configure_all
fi
}
@@ -435,7 +456,7 @@ distutils-r1_src_compile() {
multijob_finish
if declare -f python_compile_all >/dev/null; then
- python_compile_all
+ _distutils-r1_run_common_phase python_compile_all
fi
}
@@ -451,7 +472,7 @@ distutils-r1_src_test() {
multijob_finish
if declare -f python_test_all >/dev/null; then
- python_test_all
+ _distutils-r1_run_common_phase python_test_all
fi
}
@@ -467,9 +488,9 @@ distutils-r1_src_install() {
multijob_finish
if declare -f python_install_all >/dev/null; then
- python_install_all
+ _distutils-r1_run_common_phase python_install_all
else
- distutils-r1_python_install_all
+ _distutils-r1_run_common_phase distutils-r1_python_install_all
fi
}