1 |
commit: 0dd937bace2f074eee910c733ca608627272b60d |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 18 21:39:33 2021 +0000 |
4 |
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 19 19:10:33 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0dd937ba |
7 |
|
8 |
perl-module.eclass: Add EAPI=8 support |
9 |
|
10 |
New features: DIST_WIKI and DIST_MAKE |
11 |
File permissions are fixed on installation |
12 |
|
13 |
Bug: https://bugs.gentoo.org/733020 |
14 |
Bug: https://bugs.gentoo.org/554346 |
15 |
Bug: https://bugs.gentoo.org/261375 |
16 |
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org> |
17 |
|
18 |
eclass/perl-module.eclass | 89 ++++++++++++++++++++++++++++++++++++++++------- |
19 |
1 file changed, 76 insertions(+), 13 deletions(-) |
20 |
|
21 |
diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass |
22 |
index 3f7e4100db0..6285e936315 100644 |
23 |
--- a/eclass/perl-module.eclass |
24 |
+++ b/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 |
30 |
+# @SUPPORTED_EAPIS: 5 6 7 8 |
31 |
# @BLURB: eclass for installing Perl module distributions |
32 |
# @DESCRIPTION: |
33 |
# The perl-module eclass is designed to allow easier installation of Perl |
34 |
@@ -27,6 +27,10 @@ case ${EAPI:-0} in |
35 |
inherit multiprocessing perl-functions |
36 |
PERL_EXPF="src_prepare src_configure src_compile src_test src_install" |
37 |
;; |
38 |
+ 8) |
39 |
+ inherit multiprocessing perl-functions readme.gentoo-r1 |
40 |
+ PERL_EXPF="src_prepare src_configure src_compile src_test src_install" |
41 |
+ ;; |
42 |
*) |
43 |
die "EAPI=${EAPI} is not supported by perl-module.eclass" |
44 |
;; |
45 |
@@ -99,7 +103,7 @@ case ${EAPI:-0} in |
46 |
|
47 |
EXPORT_FUNCTIONS ${PERL_EXPF} |
48 |
;; |
49 |
- 7) |
50 |
+ *) |
51 |
[[ ${CATEGORY} == perl-core ]] && \ |
52 |
PERL_EXPF+=" pkg_postinst pkg_postrm" |
53 |
|
54 |
@@ -126,9 +130,6 @@ case ${EAPI:-0} in |
55 |
|
56 |
EXPORT_FUNCTIONS ${PERL_EXPF} |
57 |
;; |
58 |
- *) |
59 |
- die "EAPI=${EAPI:-0} is not supported by perl-module.eclass" |
60 |
- ;; |
61 |
esac |
62 |
|
63 |
LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}" |
64 |
@@ -180,6 +181,25 @@ LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}" |
65 |
# a use-flag examples, if not you'll have to add the useflag in your ebuild. |
66 |
# Examples are installed only if the useflag examples exists and is activated. |
67 |
|
68 |
+# @ECLASS-VARIABLE: DIST_WIKI |
69 |
+# @DEFAULT_UNSET |
70 |
+# @DESCRIPTION: |
71 |
+# (EAPI=8 and later) This variable can be set to contain space-separated keywords |
72 |
+# corresponding to article sections in a maintenance notes wiki article. If a |
73 |
+# keyword is set, an ebuild phase can output a message and a link to the wiki. |
74 |
+# Current keywords as of EAPI=8 are: |
75 |
+# * features: Notes about additional dependencies for optional features |
76 |
+# * tests: Notes about additional dependencies and preparations needed for testing |
77 |
+ |
78 |
+# @ECLASS-VARIABLE: DIST_MAKE |
79 |
+# @DESCRIPTION: |
80 |
+# (EAPI=8 and later) This Bash array contains parameters to the make call |
81 |
+# from ExtUtils::MakeMaker. Replaces mymake in EAPI=7 and earlier. |
82 |
+# Defaults to ( OPTIMIZE="${CFLAGS}" ) |
83 |
+if [[ $(declare -p DIST_MAKE 2>&-) != "declare -a DIST_MAKE="* ]]; then |
84 |
+ DIST_MAKE=( OPTIMIZE="${CFLAGS}" ) |
85 |
+fi |
86 |
+ |
87 |
|
88 |
if [[ ${EAPI:-0} == 5 ]]; then |
89 |
if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then |
90 |
@@ -343,11 +363,18 @@ perl-module_src_compile() { |
91 |
debug-print-function $FUNCNAME "$@" |
92 |
perl_set_version |
93 |
|
94 |
- if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then |
95 |
- local mymake_local=(${mymake}) |
96 |
- else |
97 |
- local mymake_local=("${mymake[@]}") |
98 |
- fi |
99 |
+ case ${EAPI} in |
100 |
+ 5|6|7) |
101 |
+ if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then |
102 |
+ local mymake_local=(${mymake}) |
103 |
+ else |
104 |
+ local mymake_local=("${mymake[@]}") |
105 |
+ fi |
106 |
+ ;; |
107 |
+ *) |
108 |
+ local mymake_local=("${DIST_MAKE[@]}") |
109 |
+ ;; |
110 |
+ esac |
111 |
|
112 |
if [[ -f Build ]] ; then |
113 |
./Build build \ |
114 |
@@ -396,7 +423,7 @@ perl-module_src_test() { |
115 |
local my_test_control |
116 |
local my_test_verbose |
117 |
|
118 |
- if [[ ${EAPI:-0} == 5 ]] ; then |
119 |
+ if [[ ${EAPI} == 5 ]] ; then |
120 |
my_test_control=${SRC_TEST} |
121 |
my_test_verbose=${TEST_VERBOSE:-0} |
122 |
if has 'do' ${my_test_control} || has 'parallel' ${my_test_control} ; then |
123 |
@@ -434,6 +461,18 @@ perl-module_src_test() { |
124 |
fi |
125 |
fi |
126 |
|
127 |
+ case ${EAPI} in |
128 |
+ 5|6|7) |
129 |
+ ;; |
130 |
+ *) |
131 |
+ if has 'tests' ${DIST_WIKI} ; then |
132 |
+ ewarn "This package may require additional dependencies and/or preparation steps for" |
133 |
+ ewarn "comprehensive testing. For details, see:" |
134 |
+ ewarn "$(perl_get_wikiurl_tests)" |
135 |
+ fi |
136 |
+ ;; |
137 |
+ esac |
138 |
+ |
139 |
perl_set_version |
140 |
if [[ -f Build ]] ; then |
141 |
./Build test verbose=${my_test_verbose} || die "test failed" |
142 |
@@ -473,9 +512,17 @@ perl-module_src_install() { |
143 |
|| die "emake ${myinst_local[@]} ${mytargets} failed" |
144 |
fi |
145 |
|
146 |
+ case ${EAPI} in |
147 |
+ 5|6|7) |
148 |
+ ;; |
149 |
+ *) |
150 |
+ perl_fix_permissions |
151 |
+ ;; |
152 |
+ esac |
153 |
+ |
154 |
perl_delete_module_manpages |
155 |
perl_delete_localpod |
156 |
- if [[ ${EAPI:-0} == 5 ]] ; then |
157 |
+ if [[ ${EAPI} == 5 ]] ; then |
158 |
perl_delete_packlist |
159 |
else |
160 |
perl_fix_packlist |
161 |
@@ -487,13 +534,29 @@ perl-module_src_install() { |
162 |
[[ -s ${f} ]] && dodoc ${f} |
163 |
done |
164 |
|
165 |
- if [[ ${EAPI:-0} != 5 ]] ; then |
166 |
+ if [[ ${EAPI} != 5 ]] ; then |
167 |
if in_iuse examples && use examples ; then |
168 |
[[ ${#DIST_EXAMPLES[@]} -eq 0 ]] || perl_doexamples "${DIST_EXAMPLES[@]}" |
169 |
fi |
170 |
fi |
171 |
|
172 |
perl_link_duallife_scripts |
173 |
+ |
174 |
+ case ${EAPI} in |
175 |
+ 5|6|7) |
176 |
+ ;; |
177 |
+ *) |
178 |
+ if has 'features' ${DIST_WIKI} ; then |
179 |
+ DISABLE_AUTOFORMATTING=yes |
180 |
+ DOC_CONTENTS="This package may require additional dependencies and/or preparation steps for\n" |
181 |
+ DOC_CONTENTS+="some optional features. For details, see\n" |
182 |
+ DOC_CONTENTS+="$(perl_get_wikiurl_features)" |
183 |
+ einfo |
184 |
+ readme.gentoo_create_doc |
185 |
+ readme.gentoo_print_elog |
186 |
+ fi |
187 |
+ ;; |
188 |
+ esac |
189 |
} |
190 |
|
191 |
# @FUNCTION: perl-module_pkg_postinst |