Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 22/25] eclass: python-r2.eclass → python-multi-r2.eclass
Date: Sat, 29 Feb 2020 20:49:24
Message-Id: 20200229204201.99290-23-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 00/25] python-r2 eclass suite by "Michał Górny"
1 Signed-off-by: Michał Górny <mgorny@g.o>
2 ---
3 eclass/distutils-r2.eclass | 14 ++++----
4 eclass/python-any-r2.eclass | 9 +++--
5 ...ython-r2.eclass => python-multi-r2.eclass} | 33 +++++++++----------
6 eclass/python-single-r2.eclass | 16 ++++-----
7 eclass/python-utils-r2.eclass | 8 ++---
8 5 files changed, 39 insertions(+), 41 deletions(-)
9 rename eclass/{python-r2.eclass => python-multi-r2.eclass} (96%)
10
11 diff --git a/eclass/distutils-r2.eclass b/eclass/distutils-r2.eclass
12 index b155c31d121e..b1bc7aadae57 100644
13 --- a/eclass/distutils-r2.eclass
14 +++ b/eclass/distutils-r2.eclass
15 @@ -14,7 +14,7 @@
16 # the src_* phases. Each of the phases runs two pseudo-phases:
17 # python_..._all() (e.g. python_prepare_all()) once in ${S}, then
18 # python_...() (e.g. python_prepare()) for each implementation
19 -# (see: python_foreach_impl() in python-r2).
20 +# (see: python_foreach_impl() in python-multi-r2).
21 #
22 # In distutils-r2_src_prepare(), the 'all' function is run before
23 # per-implementation ones (because it creates the implementations),
24 @@ -35,9 +35,9 @@
25 # Please note that distutils-r2 sets RDEPEND and DEPEND unconditionally
26 # for you.
27 #
28 -# Also, please note that distutils-r2 will always inherit python-r2
29 -# as well. Thus, all the variables defined and documented there are
30 -# relevant to the packages using distutils-r2.
31 +# Also, please note that distutils-r2 will always inherit
32 +# python-multi-r2 or python-single-r2. Thus, all the variables defined
33 +# and documented there are relevant to the packages using distutils-r2.
34
35 case "${EAPI:-0}" in
36 0|1|2|3|4)
37 @@ -66,8 +66,8 @@ esac
38 # @DEFAULT_UNSET
39 # @DESCRIPTION:
40 # If set to a non-null value, the ebuild will support setting a single
41 -# Python implementation only. It will effectively replace the python-r2
42 -# eclass inherit with python-single-r2.
43 +# Python implementation only. It will effectively replace
44 +# the python-multi-r2 eclass inherit with python-single-r2.
45 #
46 # Note that inheriting python-single-r2 will cause pkg_setup()
47 # to be exported. It must be run in order for the eclass functions
48 @@ -97,7 +97,7 @@ if [[ ! ${_DISTUTILS_R2} ]]; then
49 inherit multiprocessing toolchain-funcs
50
51 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
52 - inherit python-r2
53 + inherit python-multi-r2
54 else
55 inherit python-single-r2
56 fi
57 diff --git a/eclass/python-any-r2.eclass b/eclass/python-any-r2.eclass
58 index 11ff29167f56..d6523a93646a 100644
59 --- a/eclass/python-any-r2.eclass
60 +++ b/eclass/python-any-r2.eclass
61 @@ -40,8 +40,8 @@ esac
62
63 if [[ ! ${_PYTHON_ANY_R2} ]]; then
64
65 -if [[ ${_PYTHON_R2} ]]; then
66 - die 'python-any-r2.eclass can not be used with python-r2.eclass.'
67 +if [[ ${_PYTHON_MULTI_R2} ]]; then
68 + die 'python-any-r2.eclass can not be used with python-multi-r2.eclass.'
69 elif [[ ${_PYTHON_SINGLE_R2} ]]; then
70 die 'python-any-r2.eclass can not be used with python-single-r2.eclass.'
71 fi
72 @@ -124,9 +124,8 @@ EXPORT_FUNCTIONS pkg_setup
73 # An eclass-generated USE-dependency string for the currently tested
74 # implementation. It is set locally for python_check_deps() call.
75 #
76 -# The generate USE-flag list is compatible with packages using python-r2,
77 -# python-single-r2 and python-distutils-ng eclasses. It must not be used
78 -# on packages using python.eclass.
79 +# The generate USE-flag list is compatible with packages using
80 +# python-multi-r2 eclass.
81 #
82 # Example use:
83 # @CODE
84 diff --git a/eclass/python-r2.eclass b/eclass/python-multi-r2.eclass
85 similarity index 96%
86 rename from eclass/python-r2.eclass
87 rename to eclass/python-multi-r2.eclass
88 index f7a92c500317..093f794b909b 100644
89 --- a/eclass/python-r2.eclass
90 +++ b/eclass/python-multi-r2.eclass
91 @@ -1,7 +1,7 @@
92 # Copyright 1999-2020 Gentoo Authors
93 # Distributed under the terms of the GNU General Public License v2
94
95 -# @ECLASS: python-r2.eclass
96 +# @ECLASS: python-multi-r2.eclass
97 # @MAINTAINER:
98 # Python team <python@g.o>
99 # @AUTHOR:
100 @@ -15,15 +15,15 @@
101 #
102 # This eclass sets correct IUSE. Modification of REQUIRED_USE has to
103 # be done by the author of the ebuild (but PYTHON_REQUIRED_USE is
104 -# provided for convenience, see below). python-r2 exports PYTHON_DEPS
105 -# and PYTHON_USEDEP so you can create correct dependencies for your
106 -# package easily. It also provides methods to easily run a command for
107 -# each enabled Python implementation and duplicate the sources for them.
108 +# provided for convenience, see below). python-multi-r2 exports
109 +# PYTHON_DEPS and PYTHON_USEDEP so you can create correct dependencies
110 +# for your package easily. It also provides methods to easily run
111 +# a command for each enabled Python implementation and duplicate
112 +# the sources for them.
113 #
114 -# Please note that python-r2 will always inherit python-utils-r2 as
115 -# well. Thus, all the functions defined there can be used
116 -# in the packages using python-r2, and there is no need ever to inherit
117 -# both.
118 +# Please note that python-multi-r2 will always inherit python-utils-r2.
119 +# Thus, all the functions defined there can be used in the packages
120 +# using python-multi-r2, and there is no need ever to inherit both.
121
122 case "${EAPI:-0}" in
123 0|1|2|3|4)
124 @@ -37,12 +37,12 @@ case "${EAPI:-0}" in
125 ;;
126 esac
127
128 -if [[ ! ${_PYTHON_R2} ]]; then
129 +if [[ ! ${_PYTHON_MULTI_R2} ]]; then
130
131 if [[ ${_PYTHON_SINGLE_R2} ]]; then
132 - die 'python-r2.eclass can not be used with python-single-r2.eclass.'
133 + die 'python-multi-r2.eclass can not be used with python-single-r2.eclass.'
134 elif [[ ${_PYTHON_ANY_R2} ]]; then
135 - die 'python-r2.eclass can not be used with python-any-r2.eclass.'
136 + die 'python-multi-r2.eclass can not be used with python-any-r2.eclass.'
137 fi
138
139 [[ ${EAPI} == [45] ]] && inherit eutils
140 @@ -131,9 +131,8 @@ fi
141 # depend on another Python package being built for the same Python
142 # implementations.
143 #
144 -# The generate USE-flag list is compatible with packages using python-r2
145 -# and python-distutils-ng eclasses. It must not be used on packages
146 -# using python.eclass.
147 +# The generate USE-flag list is compatible with packages using
148 +# python-multi-r2.
149 #
150 # Example use:
151 # @CODE
152 @@ -230,7 +229,7 @@ _python_set_globals() {
153 _python_set_globals
154 unset -f _python_set_globals
155
156 -if [[ ! ${_PYTHON_R2} ]]; then
157 +if [[ ! ${_PYTHON_MULTI_R2} ]]; then
158
159 # @FUNCTION: _python_validate_useflags
160 # @INTERNAL
161 @@ -779,5 +778,5 @@ python_replicate_script() {
162 done
163 }
164
165 -_PYTHON_R2=1
166 +_PYTHON_MULTI_R2=1
167 fi
168 diff --git a/eclass/python-single-r2.eclass b/eclass/python-single-r2.eclass
169 index 2c73ec4d11fb..833622f1a49a 100644
170 --- a/eclass/python-single-r2.eclass
171 +++ b/eclass/python-single-r2.eclass
172 @@ -20,12 +20,12 @@
173 #
174 # The eclass exports PYTHON_SINGLE_USEDEP that is suitable for depending
175 # on other packages using the eclass. Dependencies on packages using
176 -# python-r2 should be created via python_gen_cond_dep() function,
177 +# python-multi-r2 should be created via python_gen_cond_dep() function,
178 # using PYTHON_USEDEP placeholder.
179 #
180 # Please note that packages support multiple Python implementations
181 -# (using python-r2 eclass) can not depend on packages not supporting
182 -# them (using this eclass).
183 +# (using python-multi-r2 eclass) can not depend on packages
184 +# not supporting them (using this eclass).
185 #
186 # Please note that python-single-r2 will always inherit python-utils-r2
187 # as well. Thus, all the functions defined there can be used
188 @@ -46,8 +46,8 @@ esac
189
190 if [[ ! ${_PYTHON_SINGLE_R2} ]]; then
191
192 -if [[ ${_PYTHON_R2} ]]; then
193 - die 'python-single-r2.eclass can not be used with python-r2.eclass.'
194 +if [[ ${_PYTHON_MULTI_R2} ]]; then
195 + die 'python-single-r2.eclass can not be used with python-multi-r2.eclass.'
196 elif [[ ${_PYTHON_ANY_R2} ]]; then
197 die 'python-single-r2.eclass can not be used with python-any-r2.eclass.'
198 fi
199 @@ -141,7 +141,7 @@ EXPORT_FUNCTIONS pkg_setup
200 # depend on another python-single-r2 package being built for the same
201 # Python implementations.
202 #
203 -# If you need to depend on a multi-impl (python-r2) package, use
204 +# If you need to depend on a multi-impl (python-multi-r2) package, use
205 # python_gen_cond_dep with PYTHON_USEDEP placeholder instead.
206 #
207 # Example use:
208 @@ -157,8 +157,8 @@ EXPORT_FUNCTIONS pkg_setup
209 # @ECLASS-VARIABLE: PYTHON_USEDEP
210 # @DESCRIPTION:
211 # This is a placeholder variable supported by python_gen_cond_dep,
212 -# in order to depend on python-r2 packages built for the same Python
213 -# implementations.
214 +# in order to depend on python-multi-r2 packages built for the same
215 +# Python implementations.
216 #
217 # Example use:
218 # @CODE
219 diff --git a/eclass/python-utils-r2.eclass b/eclass/python-utils-r2.eclass
220 index 8486ee901cd9..8d1012a40513 100644
221 --- a/eclass/python-utils-r2.eclass
222 +++ b/eclass/python-utils-r2.eclass
223 @@ -193,8 +193,8 @@ _python_impl_matches() {
224 #
225 # This variable is set automatically in the following contexts:
226 #
227 -# python-r2: Set in functions called by python_foreach_impl() or after
228 -# calling python_setup().
229 +# python-multi-r2: Set in functions called by python_foreach_impl()
230 +# or after calling python_setup().
231 #
232 # python-single-r2: Set after calling python-single-r2_pkg_setup().
233 #
234 @@ -212,8 +212,8 @@ _python_impl_matches() {
235 #
236 # This variable is set automatically in the following contexts:
237 #
238 -# python-r2: Set in functions called by python_foreach_impl() or after
239 -# calling python_setup().
240 +# python-multi-r2: Set in functions called by python_foreach_impl()
241 +# or after calling python_setup().
242 #
243 # python-single-r2: Set after calling python-single-r2_pkg_setup().
244 #
245 --
246 2.25.1