1 | # Copyright 1999-2011 Gentoo Foundation |
1 | # Copyright 1999-2011 Gentoo Foundation |
2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.109 2011/02/14 20:46:52 arfrever Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.110 2011/03/10 17:49:49 arfrever Exp $ |
4 | |
4 | |
5 | # @ECLASS: python.eclass |
5 | # @ECLASS: python.eclass |
6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
7 | # Gentoo Python Project <python@gentoo.org> |
7 | # Gentoo Python Project <python@gentoo.org> |
8 | # @BLURB: Eclass for Python packages |
8 | # @BLURB: Eclass for Python packages |
… | |
… | |
14 | if ! has "${EAPI:-0}" 0 1 2 3; then |
14 | if ! has "${EAPI:-0}" 0 1 2 3; then |
15 | die "API of python.eclass in EAPI=\"${EAPI}\" not established" |
15 | die "API of python.eclass in EAPI=\"${EAPI}\" not established" |
16 | fi |
16 | fi |
17 | |
17 | |
18 | _CPYTHON2_GLOBALLY_SUPPORTED_ABIS=(2.4 2.5 2.6 2.7) |
18 | _CPYTHON2_GLOBALLY_SUPPORTED_ABIS=(2.4 2.5 2.6 2.7) |
19 | _CPYTHON3_GLOBALLY_SUPPORTED_ABIS=(3.0 3.1 3.2) |
19 | _CPYTHON3_GLOBALLY_SUPPORTED_ABIS=(3.0 3.1 3.2 3.3) |
20 | _JYTHON_GLOBALLY_SUPPORTED_ABIS=(2.5-jython) |
20 | _JYTHON_GLOBALLY_SUPPORTED_ABIS=(2.5-jython) |
21 | _PYTHON_GLOBALLY_SUPPORTED_ABIS=(${_CPYTHON2_GLOBALLY_SUPPORTED_ABIS[@]} ${_CPYTHON3_GLOBALLY_SUPPORTED_ABIS[@]} ${_JYTHON_GLOBALLY_SUPPORTED_ABIS[@]}) |
21 | _PYTHON_GLOBALLY_SUPPORTED_ABIS=(${_CPYTHON2_GLOBALLY_SUPPORTED_ABIS[@]} ${_CPYTHON3_GLOBALLY_SUPPORTED_ABIS[@]} ${_JYTHON_GLOBALLY_SUPPORTED_ABIS[@]}) |
22 | |
22 | |
23 | # ================================================================================================ |
23 | # ================================================================================================ |
24 | # ===================================== HANDLING OF METADATA ===================================== |
24 | # ===================================== HANDLING OF METADATA ===================================== |
… | |
… | |
618 | if [[ -n "${PYTHON_EXPORT_PHASE_FUNCTIONS}" ]]; then |
618 | if [[ -n "${PYTHON_EXPORT_PHASE_FUNCTIONS}" ]]; then |
619 | EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install |
619 | EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install |
620 | fi |
620 | fi |
621 | fi |
621 | fi |
622 | |
622 | |
623 | if has "${EAPI:-0}" 0 1 2 3; then |
623 | if has "${EAPI:-0}" 0 1 2 3 4; then |
624 | unset PYTHON_ABIS |
624 | unset PYTHON_ABIS |
625 | fi |
625 | fi |
626 | |
626 | |
627 | _python_calculate_PYTHON_ABIS() { |
627 | _python_calculate_PYTHON_ABIS() { |
628 | if ! _python_package_supporting_installation_for_multiple_python_abis; then |
628 | if ! _python_package_supporting_installation_for_multiple_python_abis; then |
629 | die "${FUNCNAME}() cannot be used in ebuilds of packages not supporting installation for multiple Python ABIs" |
629 | die "${FUNCNAME}() cannot be used in ebuilds of packages not supporting installation for multiple Python ABIs" |
630 | fi |
630 | fi |
631 | |
631 | |
632 | _python_initial_sanity_checks |
632 | _python_initial_sanity_checks |
633 | |
633 | |
634 | if [[ "$(declare -p PYTHON_ABIS 2> /dev/null)" != "declare -x PYTHON_ABIS="* ]] && has "${EAPI:-0}" 0 1 2 3; then |
634 | if [[ "$(declare -p PYTHON_ABIS 2> /dev/null)" != "declare -x PYTHON_ABIS="* ]] && has "${EAPI:-0}" 0 1 2 3 4; then |
635 | local PYTHON_ABI restricted_ABI restricted_ABIs support_ABI supported_PYTHON_ABIS |
635 | local PYTHON_ABI restricted_ABI restricted_ABIs support_ABI supported_PYTHON_ABIS |
636 | |
636 | |
637 | restricted_ABIs="${RESTRICT_PYTHON_ABIS// /$'\n'}" |
637 | restricted_ABIs="${RESTRICT_PYTHON_ABIS// /$'\n'}" |
638 | |
638 | |
639 | if [[ "$(declare -p USE_PYTHON 2> /dev/null)" == "declare -x USE_PYTHON="* ]]; then |
639 | if [[ "$(declare -p USE_PYTHON 2> /dev/null)" == "declare -x USE_PYTHON="* ]]; then |