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

Diff of /eclass/python-distutils-ng.eclass

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

Revision 1.2 Revision 1.8
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/Attic/python-distutils-ng.eclass,v 1.2 2012/03/26 06:12:53 jlec Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/python-distutils-ng.eclass,v 1.8 2012/03/28 14:21:55 marienz Exp $
4 4
5# @ECLASS: python-distutils-ng 5# @ECLASS: python-distutils-ng
6# @MAINTAINER: 6# @MAINTAINER:
7# Python herd <python@gentoo.org> 7# Python herd <python@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
62 ;; 62 ;;
63 *) 63 *)
64 die "Unsupported EAPI=${EAPI} (unknown) for python-distutils-ng.eclass" ;; 64 die "Unsupported EAPI=${EAPI} (unknown) for python-distutils-ng.eclass" ;;
65esac 65esac
66 66
67# @FUNCTION: _python-distutils-ng_generate_depend
68# @USAGE: implementation
69# @RETURN: Package atom of a Python implementation for *DEPEND.
70# @DESCRIPTION:
71# This function returns the full package atom of a Python implementation.
72#
73# `implementation' has to be one of the valid values for PYTHON_COMPAT.
74_python-distutils-ng_generate_depend() {
75 local impl="${1/_/.}"
76 case "${impl}" in
77 python?.?)
78 echo "dev-lang/${impl::-3}:${impl: -3}" ;;
79 jython?.?)
80 echo "dev-java/${impl::-3}:${impl: -3}" ;;
81 pypy?.?)
82 echo "dev-python/${impl::-3}:${impl: -3}" ;;
83 *)
84 die "Unsupported implementation: ${1}" ;;
85 esac
86}
87
88# @FUNCTION: _python-distutils-ng_get_binary_for_implementation 67# @FUNCTION: _python-distutils-ng_get_binary_for_implementation
89# @USAGE: implementation 68# @USAGE: implementation
90# @RETURN: Full path to Python binary for given implementation. 69# @RETURN: Full path to Python binary for given implementation.
91# @DESCRIPTION: 70# @DESCRIPTION:
92# This function returns full path for Python binary for given implementation. 71# This function returns full path for Python binary for given implementation.
103 *) 82 *)
104 die "Unsupported implementation: ${1}" ;; 83 die "Unsupported implementation: ${1}" ;;
105 esac 84 esac
106} 85}
107 86
108required_use_str=" || ( 87required_use_str=""
109 python_targets_python2_5 python_targets_python2_6 python_targets_python2_7 88for impl in ${PYTHON_COMPAT}; do
110 python_targets_python3_1 python_targets_python3_2 89 required_use_str+=" python_targets_${impl}"
111 python_targets_jython2_5 90done
112 python_targets_pypy1_7 python_targets_pypy1_8 )" 91required_use_str=" || ( ${required_use_str} )"
113if [[ "${PYTHON_OPTIONAL}" = "yes" ]]; then 92if [[ "${PYTHON_OPTIONAL}" = "yes" ]]; then
114 IUSE+="python" 93 IUSE+=" python"
115 REQUIRED_USE+=" python? ( ${required_use_str} )" 94 REQUIRED_USE+=" python? ( ${required_use_str} )"
116else 95else
117 REQUIRED_USE+=" ${required_use_str}" 96 REQUIRED_USE+=" ${required_use_str}"
118fi 97fi
98unset required_use_str
119 99
120for impl in ${PYTHON_COMPAT}; do 100for impl in ${PYTHON_COMPAT}; do
121 IUSE+=" python_targets_${impl} " 101 IUSE+=" python_targets_${impl}"
122 local dep_str="python_targets_${impl}? ( $(_python-distutils-ng_generate_depend "${impl}") )" 102 dep_str="${impl/_/.}"
103 case "${dep_str}" in
104 python?.?)
105 dep_str="dev-lang/python:${dep_str: -3}" ;;
106 jython?.?)
107 dep_str="dev-java/jython:${dep_str: -3}" ;;
108 pypy?.?)
109 dep_str="dev-python/pypy:${dep_str: -3}" ;;
110 *)
111 die "Unsupported implementation: ${impl}" ;;
112 esac
113 dep_str="python_targets_${impl}? ( ${dep_str} )"
123 114
124 if [[ "${PYTHON_OPTIONAL}" = "yes" ]]; then 115 if [[ "${PYTHON_OPTIONAL}" = "yes" ]]; then
125 RDEPEND="${RDEPEND} python? ( ${dep_str} )" 116 RDEPEND="${RDEPEND} python? ( ${dep_str} )"
126 DEPEND="${DEPEND} python? ( ${dep_str} )" 117 DEPEND="${DEPEND} python? ( ${dep_str} )"
127 else 118 else
128 RDEPEND="${RDEPEND} ${dep_str}" 119 RDEPEND="${RDEPEND} ${dep_str}"
129 DEPEND="${DEPEND} ${dep_str}" 120 DEPEND="${DEPEND} ${dep_str}"
130 fi 121 fi
122 unset dep_str
131done 123done
132 124
133_PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}" 125_PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}"
134 126
135# @FUNCTION: _python-distutils-ng_run_for_impl 127# @FUNCTION: _python-distutils-ng_run_for_impl

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20