Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 02 Jul 2022 18:14:01
Message-Id: 1656785624.18d50f93d272243b2e16f396e7a334c4e4bba582.soap@gentoo
1 commit: 18d50f93d272243b2e16f396e7a334c4e4bba582
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 2 18:13:44 2022 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 2 18:13:44 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18d50f93
7
8 perl-module.eclass: remove EAPI 5
9
10 Signed-off-by: David Seifert <soap <AT> gentoo.org>
11
12 eclass/perl-module.eclass | 212 ++++++++++++----------------------------------
13 1 file changed, 56 insertions(+), 156 deletions(-)
14
15 diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
16 index 273cc2bc8059..d1f9dc6ffccd 100644
17 --- a/eclass/perl-module.eclass
18 +++ b/eclass/perl-module.eclass
19 @@ -1,4 +1,4 @@
20 -# Copyright 1999-2021 Gentoo Authors
21 +# Copyright 1999-2022 Gentoo Authors
22 # Distributed under the terms of the GNU General Public License v2
23
24 # @ECLASS: perl-module.eclass
25 @@ -7,7 +7,7 @@
26 # @AUTHOR:
27 # Seemant Kulleen <seemant@g.o>
28 # Andreas K. Hüttel <dilfridge@g.o>
29 -# @SUPPORTED_EAPIS: 5 6 7 8
30 +# @SUPPORTED_EAPIS: 6 7 8
31 # @PROVIDES: perl-functions
32 # @BLURB: eclass for installing Perl module distributions
33 # @DESCRIPTION:
34 @@ -19,11 +19,7 @@
35 # ExtUtils::MakeMaker or Module::Build), we recommend to use perl-functions.eclass
36 # instead.
37
38 -case ${EAPI:-0} in
39 - 5)
40 - inherit eutils multiprocessing unpacker perl-functions
41 - PERL_EXPF="src_unpack src_prepare src_configure src_compile src_test src_install"
42 - ;;
43 +case ${EAPI} in
44 6|7)
45 inherit multiprocessing perl-functions
46 PERL_EXPF="src_prepare src_configure src_compile src_test src_install"
47 @@ -33,7 +29,7 @@ case ${EAPI:-0} in
48 PERL_EXPF="src_prepare src_configure src_compile src_test src_install"
49 ;;
50 *)
51 - die "EAPI=${EAPI} is not supported by perl-module.eclass"
52 + die "${ECLASS}: EAPI ${EAPI:-0} not supported"
53 ;;
54 esac
55
56 @@ -48,37 +44,7 @@ esac
57 # a use-conditional build time dependency on virtual/perl-Test-Simple, and
58 # the required RESTRICT setting.
59
60 -case ${EAPI:-0} in
61 - 5)
62 - [[ ${CATEGORY} == perl-core ]] && \
63 - PERL_EXPF+=" pkg_postinst pkg_postrm"
64 -
65 - case "${GENTOO_DEPEND_ON_PERL:-yes}" in
66 - yes)
67 - case "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" in
68 - yes)
69 - DEPEND="dev-lang/perl:=[-build(-)]"
70 - ;;
71 - *)
72 - DEPEND="dev-lang/perl[-build(-)]"
73 - ;;
74 - esac
75 - RDEPEND="${DEPEND}"
76 - ;;
77 - esac
78 -
79 - case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in
80 - yes)
81 - EXPORT_FUNCTIONS ${PERL_EXPF}
82 - ;;
83 - no)
84 - debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no"
85 - ;;
86 - *)
87 - die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by perl-module.eclass"
88 - ;;
89 - esac
90 - ;;
91 +case ${EAPI} in
92 6)
93 [[ ${CATEGORY} == perl-core ]] && \
94 PERL_EXPF+=" pkg_postinst pkg_postrm"
95 @@ -170,46 +136,43 @@ LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}"
96 # @ECLASS_VARIABLE: DIST_NAME
97 # @DEFAULT_UNSET
98 # @DESCRIPTION:
99 -# (EAPI=6 and later) This variable provides a way to override PN for the calculation of S,
100 +# This variable provides a way to override PN for the calculation of S,
101 # SRC_URI, and HOMEPAGE. If unset, defaults to PN.
102
103 # @ECLASS_VARIABLE: DIST_VERSION
104 # @DEFAULT_UNSET
105 # @DESCRIPTION:
106 -# (EAPI=6 and later) This variable provides a way to override PV for the calculation of S and SRC_URI.
107 +# This variable provides a way to override PV for the calculation of S and SRC_URI.
108 # Use it to provide the non-normalized, upstream version number. If unset, defaults to PV.
109 -# Named MODULE_VERSION in EAPI=5.
110
111 # @ECLASS_VARIABLE: DIST_A_EXT
112 # @DEFAULT_UNSET
113 # @DESCRIPTION:
114 -# (EAPI=6 and later) This variable provides a way to override the distfile extension for the calculation of
115 -# SRC_URI. If unset, defaults to tar.gz. Named MODULE_A_EXT in EAPI=5.
116 +# This variable provides a way to override the distfile extension for the calculation of
117 +# SRC_URI. If unset, defaults to tar.gz.
118
119 # @ECLASS_VARIABLE: DIST_A
120 # @DEFAULT_UNSET
121 # @DESCRIPTION:
122 -# (EAPI=6 and later) This variable provides a way to override the distfile name for the calculation of
123 -# SRC_URI. If unset, defaults to ${DIST_NAME}-${DIST_VERSION}.${DIST_A_EXT} Named MODULE_A in EAPI=5.
124 +# This variable provides a way to override the distfile name for the calculation of
125 +# SRC_URI. If unset, defaults to ${DIST_NAME}-${DIST_VERSION}.${DIST_A_EXT}.
126
127 # @ECLASS_VARIABLE: DIST_AUTHOR
128 # @DEFAULT_UNSET
129 # @DESCRIPTION:
130 -# (EAPI=6 and later) This variable sets the module author name for the calculation of
131 -# SRC_URI. Named MODULE_AUTHOR in EAPI=5.
132 +# This variable sets the module author name for the calculation of SRC_URI.
133
134 # @ECLASS_VARIABLE: DIST_SECTION
135 # @DEFAULT_UNSET
136 # @DESCRIPTION:
137 -# (EAPI=6 and later) This variable sets the module section for the calculation of
138 +# This variable sets the module section for the calculation of
139 # SRC_URI. Only required in rare cases for very special snowflakes.
140 -# Named MODULE_SECTION in EAPI=5.
141
142 # @ECLASS_VARIABLE: DIST_EXAMPLES
143 # @PRE_INHERIT
144 # @DEFAULT_UNSET
145 # @DESCRIPTION:
146 -# (EAPI=6 and later) This Bash array allows passing a list of example files to be installed
147 +# This Bash array allows passing a list of example files to be installed
148 # in /usr/share/doc/${PF}/examples. If set before inherit, automatically adds
149 # a use-flag examples, if not you'll have to add the useflag in your ebuild.
150 # Examples are installed only if the useflag examples exists and is activated.
151 @@ -233,53 +196,23 @@ if [[ $(declare -p DIST_MAKE 2>&-) != "declare -a DIST_MAKE="* ]]; then
152 DIST_MAKE=( OPTIMIZE="${CFLAGS}" )
153 fi
154
155 +DIST_NAME=${DIST_NAME:-${PN}}
156 +DIST_P=${DIST_NAME}-${DIST_VERSION:-${PV}}
157 +S=${WORKDIR}/${DIST_P}
158
159 -if [[ ${EAPI:-0} == 5 ]]; then
160 - if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then
161 - : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}}
162 - S=${MY_S:-${WORKDIR}/${MY_P}}
163 - fi
164 - MODULE_NAME=${MY_PN:-${PN}}
165 - MODULE_P=${MY_P:-${P}}
166 -
167 - [[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \
168 - MODULE_A="${MODULE_P}.${MODULE_A_EXT:-tar.gz}"
169 - [[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \
170 - SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
171 - [[ -z "${HOMEPAGE}" ]] && \
172 - HOMEPAGE="https://metacpan.org/release/${MODULE_NAME}"
173 -
174 - SRC_TEST="skip"
175 -else
176 - DIST_NAME=${DIST_NAME:-${PN}}
177 - DIST_P=${DIST_NAME}-${DIST_VERSION:-${PV}}
178 - S=${WORKDIR}/${DIST_P}
179 -
180 - [[ -z "${SRC_URI}" && -z "${DIST_A}" ]] && \
181 - DIST_A="${DIST_P}.${DIST_A_EXT:-tar.gz}"
182 - [[ -z "${SRC_URI}" && -n "${DIST_AUTHOR}" ]] && \
183 - SRC_URI="mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${DIST_SECTION:+${DIST_SECTION}/}${DIST_A}"
184 - [[ -z "${HOMEPAGE}" ]] && \
185 - HOMEPAGE="https://metacpan.org/release/${DIST_NAME}"
186 -
187 - [[ -z "${DIST_EXAMPLES}" ]] || IUSE+=" examples"
188 -fi
189 +[[ -z "${SRC_URI}" && -z "${DIST_A}" ]] &&
190 + DIST_A="${DIST_P}.${DIST_A_EXT:-tar.gz}"
191 +[[ -z "${SRC_URI}" && -n "${DIST_AUTHOR}" ]] &&
192 + SRC_URI="mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${DIST_SECTION:+${DIST_SECTION}/}${DIST_A}"
193 +[[ -z "${HOMEPAGE}" ]] &&
194 + HOMEPAGE="https://metacpan.org/release/${DIST_NAME}"
195 +
196 +[[ -z "${DIST_EXAMPLES}" ]] || IUSE+=" examples"
197
198 -SRC_PREP="no"
199 PREFER_BUILDPL="yes"
200
201 pm_echovar=""
202
203 -# @FUNCTION: perl-module_src_unpack
204 -# @DESCRIPTION:
205 -# Unpack the ebuild tarball(s).
206 -# This function is to be called during the ebuild src_unpack() phase.
207 -perl-module_src_unpack() {
208 - debug-print-function $FUNCNAME "$@"
209 - [[ ${EAPI:-0} == 5 ]] || die "perl-module_src_unpack is banned in EAPI=6 or later"
210 - unpacker_src_unpack
211 -}
212 -
213 # @FUNCTION: perl-module_src_prepare
214 # @DESCRIPTION:
215 # Get the ebuild sources ready.
216 @@ -287,13 +220,7 @@ perl-module_src_unpack() {
217 perl-module_src_prepare() {
218 debug-print-function $FUNCNAME "$@"
219
220 - if [[ ${EAPI:-0} == 5 ]] ; then
221 - [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
222 - debug-print "$FUNCNAME: applying user patches"
223 - epatch_user
224 - else
225 - default
226 - fi
227 + default
228
229 if [[ ${PERL_RM_FILES[@]} ]]; then
230 debug-print "$FUNCNAME: stripping unneeded files"
231 @@ -309,11 +236,6 @@ perl-module_src_prepare() {
232 perl-module_src_configure() {
233 debug-print-function $FUNCNAME "$@"
234
235 - if [[ ${EAPI:-0} == 5 && ${SRC_PREP} == yes ]]; then
236 - return 0
237 - fi
238 - SRC_PREP="yes"
239 -
240 perl_check_env
241
242 perl_set_version
243 @@ -329,8 +251,8 @@ perl-module_src_configure() {
244 fi
245
246 if [[ ( ${PREFER_BUILDPL} == yes || ! -f Makefile.PL ) && -f Build.PL ]] ; then
247 - case ${EAPI:-0} in
248 - 5|6)
249 + case ${EAPI} in
250 + 6)
251 if grep -q '\(use\|require\)\s*Module::Build::Tiny' Build.PL ; then
252 einfo "Using Module::Build::Tiny"
253 if [[ ${DEPEND} != *dev-perl/Module-Build-Tiny* && ${PN} != Module-Build-Tiny ]]; then
254 @@ -397,7 +319,7 @@ perl-module_src_compile() {
255 perl_set_version
256
257 case ${EAPI} in
258 - 5|6|7)
259 + 6|7)
260 if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then
261 local mymake_local=(${mymake})
262 else
263 @@ -426,11 +348,9 @@ perl-module_src_compile() {
264 # @ECLASS_VARIABLE: DIST_TEST
265 # @DEFAULT_UNSET
266 # @DESCRIPTION:
267 -# (EAPI=6 and later) Variable that controls if tests are run in the test phase
268 +# Variable that controls if tests are run in the test phase
269 # at all, and if yes under which conditions. If unset, defaults to "do parallel"
270 # If neither "do" nor "parallel" is recognized, tests are skipped.
271 -# (In EAPI=5 the variable is called SRC_TEST, defaults to "skip", and
272 -# recognizes fewer options.)
273 # The following space-separated keywords are recognized:
274 # do : run tests
275 # parallel : run tests in parallel
276 @@ -441,7 +361,7 @@ perl-module_src_compile() {
277 # @USER_VARIABLE
278 # @DEFAULT_UNSET
279 # @DESCRIPTION:
280 -# (EAPI=6 and later) Variable that controls if tests are run in the test phase
281 +# Variable that controls if tests are run in the test phase
282 # at all, and if yes under which conditions. It is intended for use in
283 # make.conf or the environment by ebuild authors during testing, and
284 # accepts the same values as DIST_TEST. If set, it overrides DIST_TEST
285 @@ -456,46 +376,32 @@ perl-module_src_test() {
286 local my_test_control
287 local my_test_verbose
288
289 - if [[ ${EAPI} == 5 ]] ; then
290 - my_test_control=${SRC_TEST}
291 - my_test_verbose=${TEST_VERBOSE:-0}
292 - if has 'do' ${my_test_control} || has 'parallel' ${my_test_control} ; then
293 - if has "${my_test_verbose}" 0 && has 'parallel' ${my_test_control} ; then
294 - export HARNESS_OPTIONS=j$(makeopts_jobs)
295 - einfo "Test::Harness Jobs=$(makeopts_jobs)"
296 - fi
297 - else
298 - einfo Skipping tests due to SRC_TEST=${SRC_TEST}
299 - return 0
300 - fi
301 - else
302 - [[ -n "${DIST_TEST_OVERRIDE}" ]] && ewarn DIST_TEST_OVERRIDE is set to ${DIST_TEST_OVERRIDE}
303 - my_test_control=${DIST_TEST_OVERRIDE:-${DIST_TEST:-do parallel}}
304 + [[ -n "${DIST_TEST_OVERRIDE}" ]] && ewarn "DIST_TEST_OVERRIDE is set to ${DIST_TEST_OVERRIDE}"
305 + my_test_control=${DIST_TEST_OVERRIDE:-${DIST_TEST:-do parallel}}
306
307 - if ! has 'do' ${my_test_control} && ! has 'parallel' ${my_test_control} ; then
308 - einfo Skipping tests due to DIST_TEST=${my_test_control}
309 - return 0
310 - fi
311 + if ! has 'do' ${my_test_control} && ! has 'parallel' ${my_test_control} ; then
312 + einfo Skipping tests due to DIST_TEST=${my_test_control}
313 + return 0
314 + fi
315
316 - if has verbose ${my_test_control} ; then
317 - my_test_verbose=1
318 - else
319 - my_test_verbose=0
320 - fi
321 + if has verbose ${my_test_control} ; then
322 + my_test_verbose=1
323 + else
324 + my_test_verbose=0
325 + fi
326
327 - if has parallel ${my_test_control} ; then
328 - export HARNESS_OPTIONS=j$(makeopts_jobs)
329 - einfo "Test::Harness Jobs=$(makeopts_jobs)"
330 - fi
331 + if has parallel ${my_test_control} ; then
332 + export HARNESS_OPTIONS=j$(makeopts_jobs)
333 + einfo "Test::Harness Jobs=$(makeopts_jobs)"
334 + fi
335
336 - # this might sometimes work...
337 - if ! has network ${my_test_control} ; then
338 - export NO_NETWORK_TESTING=1
339 - fi
340 + # this might sometimes work...
341 + if ! has network ${my_test_control} ; then
342 + export NO_NETWORK_TESTING=1
343 fi
344
345 case ${EAPI} in
346 - 5|6|7)
347 + 6|7)
348 ;;
349 *)
350 if has 'tests' ${DIST_WIKI} ; then
351 @@ -546,7 +452,7 @@ perl-module_src_install() {
352 fi
353
354 case ${EAPI} in
355 - 5|6|7)
356 + 6|7)
357 ;;
358 *)
359 perl_fix_permissions
360 @@ -555,28 +461,22 @@ perl-module_src_install() {
361
362 perl_delete_module_manpages
363 perl_delete_localpod
364 - if [[ ${EAPI} == 5 ]] ; then
365 - perl_delete_packlist
366 - else
367 - perl_fix_packlist
368 - perl_delete_emptybsdir
369 - fi
370 + perl_fix_packlist
371 + perl_delete_emptybsdir
372 perl_remove_temppath
373
374 for f in Change* CHANGES README* TODO FAQ ${mydoc}; do
375 [[ -s ${f} ]] && dodoc ${f}
376 done
377
378 - if [[ ${EAPI} != 5 ]] ; then
379 - if in_iuse examples && use examples ; then
380 - [[ ${#DIST_EXAMPLES[@]} -eq 0 ]] || perl_doexamples "${DIST_EXAMPLES[@]}"
381 - fi
382 + if in_iuse examples && use examples ; then
383 + [[ ${#DIST_EXAMPLES[@]} -eq 0 ]] || perl_doexamples "${DIST_EXAMPLES[@]}"
384 fi
385
386 perl_link_duallife_scripts
387
388 case ${EAPI} in
389 - 5|6|7)
390 + 6|7)
391 ;;
392 *)
393 if has 'features' ${DIST_WIKI} ; then