summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2013-10-22 15:16:56 +0000
committerMichał Górny <mgorny@gentoo.org>2013-10-22 15:16:56 +0000
commit1815e2d197d4e04f6d9b512d3d327ca48304e546 (patch)
tree332a2ca213e1e1b5bb4323d32546e6d285bb4fc9 /eclass/python-any-r1.eclass
parentSupport installing Python scripts with custom --install-scripts argument. Bug... (diff)
downloadgentoo-2-1815e2d197d4e04f6d9b512d3d327ca48304e546.tar.gz
gentoo-2-1815e2d197d4e04f6d9b512d3d327ca48304e546.tar.bz2
gentoo-2-1815e2d197d4e04f6d9b512d3d327ca48304e546.zip
Introduce a "common" python_setup function to set up Python for use in outer scope.
Diffstat (limited to 'eclass/python-any-r1.eclass')
-rw-r--r--eclass/python-any-r1.eclass26
1 files changed, 18 insertions, 8 deletions
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index 760e8e758c72..46506d3e1d32 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-any-r1.eclass,v 1.15 2013/10/12 11:08:12 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-any-r1.eclass,v 1.16 2013/10/22 15:16:56 mgorny Exp $
# @ECLASS: python-any-r1
# @MAINTAINER:
@@ -259,17 +259,15 @@ _python_EPYTHON_supported() {
return 1
}
-# @FUNCTION: python-any-r1_pkg_setup
+# @FUNCTION: python_setup
# @DESCRIPTION:
# Determine what the best installed (and supported) Python
-# implementation is and set EPYTHON and PYTHON accordingly.
-python-any-r1_pkg_setup() {
+# implementation is, and set the Python build environment up for it.
+#
+# This function will call python_check_deps() if defined.
+python_setup() {
debug-print-function ${FUNCNAME} "${@}"
- # avoid looking up Python for binary package install.
- # if you need Python during pkg_preinst/_postinst, please let us know.
- [[ ${MERGE_TYPE} == binary ]] && return 0
-
# first, try ${EPYTHON}... maybe it's good enough for us.
if [[ ${EPYTHON} ]]; then
if _python_EPYTHON_supported "${EPYTHON}"; then
@@ -317,5 +315,17 @@ python-any-r1_pkg_setup() {
die "No supported Python implementation installed."
}
+# @FUNCTION: python-any-r1_pkg_setup
+# @DESCRIPTION:
+# Runs python_setup during from-source installs.
+#
+# In a binary package installs is a no-op. If you need Python in pkg_*
+# phases of a binary package, call python_setup directly.
+python-any-r1_pkg_setup() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ [[ ${MERGE_TYPE} != binary ]] && python_setup
+}
+
_PYTHON_ANY_R1=1
fi