/[gentoo-x86]/eclass/python.eclass
Gentoo

Diff of /eclass/python.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.149 Revision 1.152
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 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.149 2012/02/10 22:54:33 tommy Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.152 2012/03/07 04:13:27 floppym 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
28fi 28fi
29 29
30_CPYTHON2_GLOBALLY_SUPPORTED_ABIS=(2.4 2.5 2.6 2.7) 30_CPYTHON2_GLOBALLY_SUPPORTED_ABIS=(2.4 2.5 2.6 2.7)
31_CPYTHON3_GLOBALLY_SUPPORTED_ABIS=(3.1 3.2) 31_CPYTHON3_GLOBALLY_SUPPORTED_ABIS=(3.1 3.2)
32_JYTHON_GLOBALLY_SUPPORTED_ABIS=(2.5-jython) 32_JYTHON_GLOBALLY_SUPPORTED_ABIS=(2.5-jython)
33_PYPY_GLOBALLY_SUPPORTED_ABIS=(2.7-pypy-1.7) 33_PYPY_GLOBALLY_SUPPORTED_ABIS=(2.7-pypy-1.7 2.7-pypy-1.8)
34_PYTHON_GLOBALLY_SUPPORTED_ABIS=(${_CPYTHON2_GLOBALLY_SUPPORTED_ABIS[@]} ${_CPYTHON3_GLOBALLY_SUPPORTED_ABIS[@]} ${_JYTHON_GLOBALLY_SUPPORTED_ABIS[@]} ${_PYPY_GLOBALLY_SUPPORTED_ABIS[@]}) 34_PYTHON_GLOBALLY_SUPPORTED_ABIS=(${_CPYTHON2_GLOBALLY_SUPPORTED_ABIS[@]} ${_CPYTHON3_GLOBALLY_SUPPORTED_ABIS[@]} ${_JYTHON_GLOBALLY_SUPPORTED_ABIS[@]} ${_PYPY_GLOBALLY_SUPPORTED_ABIS[@]})
35 35
36# ================================================================================================ 36# ================================================================================================
37# ===================================== HANDLING OF METADATA ===================================== 37# ===================================== HANDLING OF METADATA =====================================
38# ================================================================================================ 38# ================================================================================================
842 die "Active version of CPython 3 is not supported by ${CATEGORY}/${PF}" 842 die "Active version of CPython 3 is not supported by ${CATEGORY}/${PF}"
843 fi 843 fi
844 else 844 else
845 python3_version="" 845 python3_version=""
846 fi 846 fi
847 fi
848
849 if [[ -z "${python2_version}" && -z "${python3_version}" ]]; then
850 eerror "${CATEGORY}/${PF} requires at least one of the following packages:"
851 for PYTHON_ABI in "${_CPYTHON2_GLOBALLY_SUPPORTED_ABIS[@]}" "${_CPYTHON3_GLOBALLY_SUPPORTED_ABIS[@]}"; do
852 if ! _python_check_python_abi_matching --patterns-list "${PYTHON_ABI}" "${RESTRICT_PYTHON_ABIS}"; then
853 eerror " dev-lang/python:${PYTHON_ABI}"
854 fi
855 done
856 die "No supported version of CPython installed"
847 fi 857 fi
848 858
849 if [[ -n "${python2_version}" && "${python_version}" == "2."* && "${python_version}" != "${python2_version}" ]]; then 859 if [[ -n "${python2_version}" && "${python_version}" == "2."* && "${python_version}" != "${python2_version}" ]]; then
850 eerror "Python wrapper is configured incorrectly or '${EPREFIX}/usr/bin/python2' symlink" 860 eerror "Python wrapper is configured incorrectly or '${EPREFIX}/usr/bin/python2' symlink"
851 eerror "is set incorrectly. Use \`eselect python\` to fix configuration." 861 eerror "is set incorrectly. Use \`eselect python\` to fix configuration."
1009 python_default_function() { 1019 python_default_function() {
1010 emake "$@" 1020 emake "$@"
1011 } 1021 }
1012 elif [[ "${EBUILD_PHASE}" == "test" ]]; then 1022 elif [[ "${EBUILD_PHASE}" == "test" ]]; then
1013 python_default_function() { 1023 python_default_function() {
1024 # Stolen from portage's _eapi0_src_test()
1025 local emake_cmd="${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE}"
1014 if emake -j1 -n check &> /dev/null; then 1026 if ${emake_cmd} -j1 -n check &> /dev/null; then
1015 emake -j1 check "$@" 1027 ${emake_cmd} -j1 check "$@"
1016 elif emake -j1 -n test &> /dev/null; then 1028 elif ${emake_cmd} -j1 -n test &> /dev/null; then
1017 emake -j1 test "$@" 1029 ${emake_cmd} -j1 test "$@"
1018 fi 1030 fi
1019 } 1031 }
1020 elif [[ "${EBUILD_PHASE}" == "install" ]]; then 1032 elif [[ "${EBUILD_PHASE}" == "install" ]]; then
1021 python_default_function() { 1033 python_default_function() {
1022 emake DESTDIR="${D}" install "$@" 1034 emake DESTDIR="${D}" install "$@"

Legend:
Removed from v.1.149  
changed lines
  Added in v.1.152

  ViewVC Help
Powered by ViewVC 1.1.20