Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog python-r1.eclass python-single-r1.eclass python-utils-r1.eclass
Date: Fri, 30 Nov 2012 11:40:26
Message-Id: 20121130114015.49E7620C65@flycatcher.gentoo.org
1 mgorny 12/11/30 11:40:15
2
3 Modified: ChangeLog python-r1.eclass python-single-r1.eclass
4 python-utils-r1.eclass
5 Log:
6 Make python-single-r1 stand-alone, and blocking python-r1.
7
8 Revision Changes Path
9 1.530 eclass/ChangeLog
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.530&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.530&content-type=text/plain
13 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.529&r2=1.530
14
15 Index: ChangeLog
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
18 retrieving revision 1.529
19 retrieving revision 1.530
20 diff -u -r1.529 -r1.530
21 --- ChangeLog 29 Nov 2012 17:56:39 -0000 1.529
22 +++ ChangeLog 30 Nov 2012 11:40:15 -0000 1.530
23 @@ -1,6 +1,10 @@
24 # ChangeLog for eclass directory
25 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
26 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.529 2012/11/29 17:56:39 hasufell Exp $
27 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.530 2012/11/30 11:40:15 mgorny Exp $
28 +
29 + 30 Nov 2012; Michał Górny <mgorny@g.o> python-r1.eclass,
30 + python-single-r1.eclass, python-utils-r1.eclass:
31 + Make python-single-r1 stand-alone, and blocking python-r1.
32
33 29 Nov 2012; Julian Ospald <hasufell@g.o> waf-utils.eclass:
34 add verbosity to waf-utils.eclass wrt #444562
35
36
37
38 1.24 eclass/python-r1.eclass
39
40 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?rev=1.24&view=markup
41 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?rev=1.24&content-type=text/plain
42 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-r1.eclass?r1=1.23&r2=1.24
43
44 Index: python-r1.eclass
45 ===================================================================
46 RCS file: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v
47 retrieving revision 1.23
48 retrieving revision 1.24
49 diff -u -r1.23 -r1.24
50 --- python-r1.eclass 26 Nov 2012 08:31:26 -0000 1.23
51 +++ python-r1.eclass 30 Nov 2012 11:40:15 -0000 1.24
52 @@ -1,6 +1,6 @@
53 # Copyright 1999-2012 Gentoo Foundation
54 # Distributed under the terms of the GNU General Public License v2
55 -# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.23 2012/11/26 08:31:26 mgorny Exp $
56 +# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.24 2012/11/30 11:40:15 mgorny Exp $
57
58 # @ECLASS: python-r1
59 # @MAINTAINER:
60 @@ -42,18 +42,11 @@
61
62 if [[ ! ${_PYTHON_R1} ]]; then
63
64 -inherit python-utils-r1
65 +if [[ ${_PYTHON_SINGLE_R1} ]]; then
66 + die 'python-r1.eclass can not be used with python-single-r1.eclass.'
67 +fi
68
69 -# @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
70 -# @INTERNAL
71 -# @DESCRIPTION:
72 -# All supported Python implementations, most preferred last.
73 -_PYTHON_ALL_IMPLS=(
74 - jython2_5
75 - pypy1_8 pypy1_9
76 - python3_1 python3_2 python3_3
77 - python2_5 python2_6 python2_7
78 -)
79 +inherit python-utils-r1
80
81 # @ECLASS-VARIABLE: PYTHON_COMPAT
82 # @REQUIRED
83
84
85
86 1.5 eclass/python-single-r1.eclass
87
88 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-single-r1.eclass?rev=1.5&view=markup
89 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-single-r1.eclass?rev=1.5&content-type=text/plain
90 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-single-r1.eclass?r1=1.4&r2=1.5
91
92 Index: python-single-r1.eclass
93 ===================================================================
94 RCS file: /var/cvsroot/gentoo-x86/eclass/python-single-r1.eclass,v
95 retrieving revision 1.4
96 retrieving revision 1.5
97 diff -u -r1.4 -r1.5
98 --- python-single-r1.eclass 26 Nov 2012 10:05:11 -0000 1.4
99 +++ python-single-r1.eclass 30 Nov 2012 11:40:15 -0000 1.5
100 @@ -1,6 +1,6 @@
101 # Copyright 1999-2012 Gentoo Foundation
102 # Distributed under the terms of the GNU General Public License v2
103 -# $Header: /var/cvsroot/gentoo-x86/eclass/python-single-r1.eclass,v 1.4 2012/11/26 10:05:11 mgorny Exp $
104 +# $Header: /var/cvsroot/gentoo-x86/eclass/python-single-r1.eclass,v 1.5 2012/11/30 11:40:15 mgorny Exp $
105
106 # @ECLASS: python-single-r1
107 # @MAINTAINER:
108 @@ -23,9 +23,10 @@
109 # (using python-r1 eclass) can not depend on packages not supporting
110 # them (using this eclass).
111 #
112 -# Also, please note that python-single-r1 will always inherit python-r1
113 -# as well. Thus, all the variables defined there are relevant
114 -# to the packages using python-single-r1.
115 +# Please note that python-single-r1 will always inherit python-utils-r1
116 +# as well. Thus, all the functions defined there can be used
117 +# in the packages using python-single-r1, and there is no need ever
118 +# to inherit both.
119 #
120 # For more information, please see the python-r1 Developer's Guide:
121 # http://www.gentoo.org/proj/en/Python/python-r1/dev-guide.xml
122 @@ -44,7 +45,11 @@
123
124 if [[ ! ${_PYTHON_SINGLE_R1} ]]; then
125
126 -inherit python-r1
127 +if [[ ${_PYTHON_R1} ]]; then
128 + die 'python-single-r1.eclass can not be used with python-r1.eclass.'
129 +fi
130 +
131 +inherit python-utils-r1
132
133 fi
134
135 @@ -52,13 +57,89 @@
136
137 if [[ ! ${_PYTHON_SINGLE_R1} ]]; then
138
139 +# @ECLASS-VARIABLE: PYTHON_COMPAT
140 +# @REQUIRED
141 +# @DESCRIPTION:
142 +# This variable contains a list of Python implementations the package
143 +# supports. It must be set before the `inherit' call. It has to be
144 +# an array.
145 +#
146 +# Example:
147 +# @CODE
148 +# PYTHON_COMPAT=( python{2_5,2_6,2_7} )
149 +# @CODE
150 +if ! declare -p PYTHON_COMPAT &>/dev/null; then
151 + die 'PYTHON_COMPAT not declared.'
152 +fi
153 +
154 +# @ECLASS-VARIABLE: PYTHON_REQ_USE
155 +# @DEFAULT_UNSET
156 +# @DESCRIPTION:
157 +# The list of USEflags required to be enabled on the chosen Python
158 +# implementations, formed as a USE-dependency string. It should be valid
159 +# for all implementations in PYTHON_COMPAT, so it may be necessary to
160 +# use USE defaults.
161 +#
162 +# Example:
163 +# @CODE
164 +# PYTHON_REQ_USE="gdbm,ncurses(-)?"
165 +# @CODE
166 +#
167 +# It will cause the Python dependencies to look like:
168 +# @CODE
169 +# python_single_target_pythonX_Y? ( dev-lang/python:X.Y[gdbm,ncurses(-)?] )
170 +# @CODE
171 +
172 +# @ECLASS-VARIABLE: PYTHON_DEPS
173 +# @DESCRIPTION:
174 +# This is an eclass-generated Python dependency string for all
175 +# implementations listed in PYTHON_COMPAT.
176 +#
177 +# The dependency string is conditional on PYTHON_SINGLE_TARGET.
178 +#
179 +# Example use:
180 +# @CODE
181 +# RDEPEND="${PYTHON_DEPS}
182 +# dev-foo/mydep"
183 +# DEPEND="${RDEPEND}"
184 +# @CODE
185 +#
186 +# Example value:
187 +# @CODE
188 +# dev-python/python-exec
189 +# python_single_target_python2_6? ( dev-lang/python:2.6[gdbm] )
190 +# python_single_target_python2_7? ( dev-lang/python:2.7[gdbm] )
191 +# @CODE
192 +
193 +# @ECLASS-VARIABLE: PYTHON_USEDEP
194 +# @DESCRIPTION:
195 +# This is an eclass-generated USE-dependency string which can be used to
196 +# depend on another Python package being built for the same Python
197 +# implementations.
198 +#
199 +# The generate USE-flag list is compatible with packages using python-r1,
200 +# python-single-r1 and python-distutils-ng eclasses. It must not be used
201 +# on packages using python.eclass.
202 +#
203 +# Example use:
204 +# @CODE
205 +# RDEPEND="dev-python/foo[${PYTHON_USEDEP}]"
206 +# @CODE
207 +#
208 +# Example value:
209 +# @CODE
210 +# python_targets_python2_7?,python_single_target_python2_7(+)?
211 +# @CODE
212 +
213 _python_single_set_globals() {
214 + local flags_mt=( "${PYTHON_COMPAT[@]/#/python_targets_}" )
215 local flags=( "${PYTHON_COMPAT[@]/#/python_single_target_}" )
216 - local optflags=${flags[@]/%/(+)?}
217 + local optflags=${flags_mt[@]/%/?}
218 + optflags+=,${flags[@]/%/(+)?}
219
220 - IUSE=${flags[*]}
221 - REQUIRED_USE="^^ ( ${flags[*]} )"
222 - PYTHON_USEDEP+=,${optflags// /,}
223 + IUSE="${flags_mt[*]} ${flags[*]}"
224 + REQUIRED_USE="|| ( ${flags_mt[*]} ) ^^ ( ${flags[*]} )"
225 + PYTHON_USEDEP=${optflags// /,}
226
227 local usestr
228 [[ ${PYTHON_REQ_USE} ]] && usestr="[${PYTHON_REQ_USE}]"
229 @@ -88,6 +169,10 @@
230 }
231 _python_single_set_globals
232
233 +# @FUNCTION: python-single-r1_pkg_setup
234 +# @DESCRIPTION:
235 +# Determine what the selected Python implementation is and set EPYTHON
236 +# and PYTHON accordingly.
237 python-single-r1_pkg_setup() {
238 debug-print-function ${FUNCNAME} "${@}"
239
240 @@ -102,19 +187,5 @@
241 done
242 }
243
244 -# Incompatible python-r1 functions.
245 -
246 -python_copy_sources() {
247 - die "${FUNCNAME} must not be used with python-single-r1 eclass."
248 -}
249 -
250 -python_foreach_impl() {
251 - die "${FUNCNAME} must not be used with python-single-r1 eclass."
252 -}
253 -
254 -python_export_best() {
255 - die "${FUNCNAME} must not be used with python-single-r1 eclass."
256 -}
257 -
258 _PYTHON_SINGLE_R1=1
259 fi
260
261
262
263 1.4 eclass/python-utils-r1.eclass
264
265 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?rev=1.4&view=markup
266 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?rev=1.4&content-type=text/plain
267 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?r1=1.3&r2=1.4
268
269 Index: python-utils-r1.eclass
270 ===================================================================
271 RCS file: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v
272 retrieving revision 1.3
273 retrieving revision 1.4
274 diff -u -r1.3 -r1.4
275 --- python-utils-r1.eclass 26 Nov 2012 10:16:43 -0000 1.3
276 +++ python-utils-r1.eclass 30 Nov 2012 11:40:15 -0000 1.4
277 @@ -1,6 +1,6 @@
278 # Copyright 1999-2012 Gentoo Foundation
279 # Distributed under the terms of the GNU General Public License v2
280 -# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.3 2012/11/26 10:16:43 mgorny Exp $
281 +# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.4 2012/11/30 11:40:15 mgorny Exp $
282
283 # @ECLASS: python-utils-r1
284 # @MAINTAINER:
285 @@ -40,6 +40,17 @@
286
287 inherit multilib
288
289 +# @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
290 +# @INTERNAL
291 +# @DESCRIPTION:
292 +# All supported Python implementations, most preferred last.
293 +_PYTHON_ALL_IMPLS=(
294 + jython2_5
295 + pypy1_8 pypy1_9
296 + python3_1 python3_2 python3_3
297 + python2_5 python2_6 python2_7
298 +)
299 +
300 # @ECLASS-VARIABLE: PYTHON
301 # @DESCRIPTION:
302 # The absolute path to the current Python interpreter.