/[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.5 Revision 1.6
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.5 2012/03/26 19:12:28 nelchael Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/python-distutils-ng.eclass,v 1.6 2012/03/26 20:33:42 nelchael 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/python:${impl: -3}" ;;
79 jython?.?)
80 echo "dev-java/jython:${impl: -3}" ;;
81 pypy?.?)
82 echo "dev-python/pypy:${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.
118fi 97fi
119unset required_use_str 98unset required_use_str
120 99
121for impl in ${PYTHON_COMPAT}; do 100for impl in ${PYTHON_COMPAT}; do
122 IUSE+=" python_targets_${impl}" 101 IUSE+=" python_targets_${impl}"
123 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:${impl: -3}" ;;
106 jython?.?)
107 dep_str="dev-java/jython:${impl: -3}" ;;
108 pypy?.?)
109 dep_str="dv-python/pypy:${impl: -3}" ;;
110 *)
111 die "Unsupported implementation: ${impl}" ;;
112 esac
113 dep_str="python_targets_${impl}? ( ${dep_str} )"
124 114
125 if [[ "${PYTHON_OPTIONAL}" = "yes" ]]; then 115 if [[ "${PYTHON_OPTIONAL}" = "yes" ]]; then
126 RDEPEND="${RDEPEND} python? ( ${dep_str} )" 116 RDEPEND="${RDEPEND} python? ( ${dep_str} )"
127 DEPEND="${DEPEND} python? ( ${dep_str} )" 117 DEPEND="${DEPEND} python? ( ${dep_str} )"
128 else 118 else

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20