Gentoo Archives: gentoo-commits

From: Krzysztof Pawlik <nelchael@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/nelchael:master commit in: eclass/, profiles/desc/
Date: Tue, 28 Feb 2012 20:52:55
Message-Id: 1330278052.5d3bba49fc5957f68193ea9e29f2822beb596bc4.nelchael@gentoo
1 commit: 5d3bba49fc5957f68193ea9e29f2822beb596bc4
2 Author: Krzysztof Pawlik <none <AT> none>
3 AuthorDate: Sun Feb 26 17:40:52 2012 +0000
4 Commit: Krzysztof Pawlik <nelchael <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 26 17:40:52 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/nelchael.git;a=commit;h=5d3bba49
7
8 Use implementationX_Y notation istead of implementationXY.
9
10 ---
11 eclass/python-distutils-ng.eclass | 48 +++++++++++++++++++-----------------
12 profiles/desc/python_targets.desc | 16 ++++++------
13 2 files changed, 33 insertions(+), 31 deletions(-)
14
15 diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
16 index 880b525..48de447 100644
17 --- a/eclass/python-distutils-ng.eclass
18 +++ b/eclass/python-distutils-ng.eclass
19 @@ -23,10 +23,10 @@
20
21 if [[ -z "${USE_PYTHON}" ]]; then
22 # Default: pure python, support all implementations
23 - USE_PYTHON=" python25 python26 python27"
24 - USE_PYTHON+=" python31 python32"
25 - USE_PYTHON+=" jython25"
26 - USE_PYTHON+=" pypy17 pypy18"
27 + USE_PYTHON=" python2_5 python2_6 python2_7"
28 + USE_PYTHON+=" python3_1 python3_2"
29 + USE_PYTHON+=" jython2_5"
30 + USE_PYTHON+=" pypy1_7 pypy1_8"
31 fi
32
33 # @ECLASS-VARIABLE: PYTHON_OPTIONAL
34 @@ -60,13 +60,14 @@ esac
35 #
36 # `implementation' has to be one of the valid values for USE_PYTHON.
37 _python-distutils-ng_generate_depend() {
38 - case "${1}" in
39 - python??)
40 - echo "dev-lang/${1::-2}:${1: -2:-1}.${1: -1}" ;;
41 - jython??)
42 - echo "dev-java/${1::-2}:${1: -2:-1}.${1: -1}" ;;
43 - pypy??)
44 - echo "dev-python/${1::-2}:${1: -2:-1}.${1: -1}" ;;
45 + local impl="${1/_/.}"
46 + case "${impl}" in
47 + python?.?)
48 + echo "dev-lang/${impl::-3}:${impl: -3}" ;;
49 + jython?.?)
50 + echo "dev-java/${impl::-3}:${impl: -3}" ;;
51 + pypy?.?)
52 + echo "dev-python/${impl::-3}:${impl: -3}" ;;
53 *)
54 die "Unsupported implementation: ${1}" ;;
55 esac
56 @@ -81,10 +82,11 @@ _python-distutils-ng_generate_depend() {
57 # Binary returned by this function should be used instead of simply calling
58 # `python'.
59 _python-distutils-ng_get_binary_for_implementation() {
60 - case "${1}" in
61 - python??|jython??)
62 - echo "/usr/bin/${1::-1}.${1: -1}" ;;
63 - pypy??)
64 + local impl="${1/_/.}"
65 + case "${impl}" in
66 + python?.?|jython?.?)
67 + echo "/usr/bin/${impl}" ;;
68 + pypy?.?)
69 echo "TODO" ;;
70 *)
71 die "Unsupported implementation: ${1}" ;;
72 @@ -92,10 +94,10 @@ _python-distutils-ng_get_binary_for_implementation() {
73 }
74
75 required_use_str=" || (
76 - python_targets_python25 python_targets_python26 python_targets_python27
77 - python_targets_python31 python_targets_python32
78 - python_targets_jython25
79 - python_targets_pypy17 python_targets_pypy18 )"
80 + python_targets_python2_5 python_targets_python2_6 python_targets_python2_7
81 + python_targets_python3_1 python_targets_python3_2
82 + python_targets_jython2_5
83 + python_targets_pypy1_7 python_targets_pypy1_8 )"
84 if [[ "${PYTHON_OPTIONAL}" = "yes" ]]; then
85 IUSE+="python"
86 REQUIRED_USE+=" python? ( ${required_use_str} )"
87 @@ -175,7 +177,7 @@ _python-distutils-ng_default_distutils_install() {
88 # implementation.
89 _python-distutils-ng_has_compileall() {
90 case "${1}" in
91 - python??|jython??)
92 + python?_?|jython?_?)
93 return 0 ;;
94 *)
95 return 1 ;;
96 @@ -190,7 +192,7 @@ _python-distutils-ng_has_compileall() {
97 # modules for given implementation.
98 _python-distutils-ng_has_compileall_opt() {
99 case "${1}" in
100 - python??)
101 + python?_?)
102 return 0 ;;
103 *)
104 return 1 ;;
105 @@ -222,7 +224,7 @@ python-distutils-ng_doscript() {
106 # symlink to default implementation, which defaults to value of
107 # PYTHON_DEFAULT_IMPLEMENTATION, if not specified the function will pick default
108 # implementation: it will the be first enabled from the following list:
109 -# python27, python26, python25, python32, python31, pypy18, pypy17, jython25
110 +# python2_7, python2_6, python2_5, python3_2, python3_1, pypy1_8, pypy1_7, jython2_5
111 python-distutils-ng_newscript() {
112 [[ -n "${1}" ]] || die "Missing source file name"
113 [[ -n "${2}" ]] || die "Missing destination file name"
114 @@ -232,7 +234,7 @@ python-distutils-ng_newscript() {
115
116 if [[ -z "${default_impl}" ]]; then
117 # TODO: Pick default implementation
118 - for impl in python{27,26,25,32,21} pypy{18,17} jython25; do
119 + for impl in python{2_7,2_6,2_5,3_2,2_1} pypy{1_8,1_7} jython2_5; do
120 use "python_targets_${impl}" || continue
121 default_impl="${impl}"
122 break;
123
124 diff --git a/profiles/desc/python_targets.desc b/profiles/desc/python_targets.desc
125 index 350fa10..c0a156d 100644
126 --- a/profiles/desc/python_targets.desc
127 +++ b/profiles/desc/python_targets.desc
128 @@ -4,11 +4,11 @@
129
130 # This file contains descriptions of PYTHON_TARGETS USE_EXPAND flags.
131
132 -python25 - Build with Python 2.5
133 -python26 - Build with Python 2.6
134 -python27 - Build with Python 2.7
135 -python31 - Build with Python 3.1
136 -python32 - Build with Python 3.2
137 -jython25 - Build with Jythin 2.5
138 -pypy17 - Build with PyPy 1.7
139 -pypy18 - Build with PyPy 1.8
140 +python2_5 - Build with Python 2.5
141 +python2_6 - Build with Python 2.6
142 +python2_7 - Build with Python 2.7
143 +python3_1 - Build with Python 3.1
144 +python3_2 - Build with Python 3.2
145 +jython2_5 - Build with Jython 2.5
146 +pypy1_7 - Build with PyPy 1.7
147 +pypy1_8 - Build with PyPy 1.8