diff options
author | Michał Górny <mgorny@gentoo.org> | 2013-09-17 13:33:55 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2013-09-17 13:33:55 +0000 |
commit | cf31a0906d5ee8a2fa7dd0097ba2735a01670f2d (patch) | |
tree | 81a8e8f675a1284f7f1581461cde1caf57a19237 /eclass/python-r1.eclass | |
parent | Stable on amd64 and x86 (diff) | |
download | gentoo-2-cf31a0906d5ee8a2fa7dd0097ba2735a01670f2d.tar.gz gentoo-2-cf31a0906d5ee8a2fa7dd0097ba2735a01670f2d.tar.bz2 gentoo-2-cf31a0906d5ee8a2fa7dd0097ba2735a01670f2d.zip |
Support python-exec:2.
Diffstat (limited to 'eclass/python-r1.eclass')
-rw-r--r-- | eclass/python-r1.eclass | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index 6f59c5fdd619..03f2f586c75a 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-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-r1.eclass,v 1.60 2013/09/17 13:24:39 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.61 2013/09/17 13:33:55 mgorny Exp $ # @ECLASS: python-r1 # @MAINTAINER: @@ -122,7 +122,7 @@ fi # # Example value: # @CODE -# dev-python/python-exec:0 +# dev-python/python-exec:= # python_targets_python2_6? ( dev-lang/python:2.6[gdbm] ) # python_targets_python2_7? ( dev-lang/python:2.7[gdbm] ) # @CODE @@ -203,7 +203,13 @@ _python_set_globals() { # but no point in making this overcomplex, BDEP doesn't hurt anyone # 2) python-exec should be built with all targets forced anyway # but if new targets were added, we may need to force a rebuild - PYTHON_DEPS+="dev-python/python-exec:0[${PYTHON_USEDEP}]" + # 3) use whichever python-exec slot installed in EAPI 5. For EAPI 4, + # just fix :0 for now since := deps are not supported. + if [[ ${EAPI} != 4 ]]; then + PYTHON_DEPS+="dev-python/python-exec:=[${PYTHON_USEDEP}]" + else + PYTHON_DEPS+="dev-python/python-exec:0[${PYTHON_USEDEP}]" + fi } _python_set_globals @@ -742,12 +748,26 @@ python_replicate_script() { debug-print-function ${FUNCNAME} "${@}" _python_replicate_script() { - local f - for f in "${files[@]}"; do - cp -p "${f}" "${f}-${EPYTHON}" || die - done - _python_rewrite_shebang "${EPYTHON}" \ - "${files[@]/%/-${EPYTHON}}" + if _python_want_python_exec2; then + local PYTHON_SCRIPTDIR + python_export PYTHON_SCRIPTDIR + + ( + exeinto "${PYTHON_SCRIPTDIR#${EPREFIX}}" + doexe "${files[@]}" + ) + + _python_rewrite_shebang "${EPYTHON}" \ + "${files[@]/*\//${D%/}/${PYTHON_SCRIPTDIR}/}" + else + local f + for f in "${files[@]}"; do + cp -p "${f}" "${f}-${EPYTHON}" || die + done + + _python_rewrite_shebang "${EPYTHON}" \ + "${files[@]/%/-${EPYTHON}}" + fi } local files=( "${@}" ) @@ -756,7 +776,7 @@ python_replicate_script() { # install the wrappers local f for f; do - _python_ln_rel "${ED%/}"/usr/bin/python-exec "${f}" || die + _python_ln_rel "${ED%/}$(_python_get_wrapper_path)" "${f}" || die done } |