1 |
(Relatively) significant changes: |
2 |
* inherit eutils for < EAPI 7 for eqawarn |
3 |
* mark WANT_AUTO*, AUTOTOOLS_AUTO_DEPEND as @PRE_INHERIT |
4 |
* convert phase test to EBUILD_PHASE_FUNC |
5 |
* drop support for < EAPI 5 |
6 |
|
7 |
[Needed for the EBUILD_PHASE_FUNC change. |
8 |
< EAPI 5 is no longer in ::gentoo (since December).] |
9 |
|
10 |
eclassdoc fixes: |
11 |
* explicitly blank and mark variables as @DEFAULT_UNSET |
12 |
* add @DESCRIPTION for _at_uses_pkg |
13 |
* mark AT_M4DIR as @DEFAULT_UNSET |
14 |
* document AUTOTOOLS_DEPEND |
15 |
|
16 |
Cosmetic changes: |
17 |
* minor cosmetic changes to various elogs |
18 |
* fix whitespace/phrasing in comment |
19 |
* convert ewarn to eqawarn |
20 |
* consistent 'case' style |
21 |
* consistent variable references |
22 |
* consistent references to bugs in comments |
23 |
* consistent use of ${ECLASS}, not "autotools.eclass" |
24 |
* use same ${WANT_AUTOCONF} comparison test throughout |
25 |
|
26 |
Signed-off-by: Sam James <sam@g.o> |
27 |
--- |
28 |
eclass/autotools.eclass | 101 ++++++++++++++++++++++++---------------- |
29 |
1 file changed, 61 insertions(+), 40 deletions(-) |
30 |
|
31 |
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass |
32 |
index 4ae360aa24d..1c687d7cb5e 100644 |
33 |
--- a/eclass/autotools.eclass |
34 |
+++ b/eclass/autotools.eclass |
35 |
@@ -19,31 +19,38 @@ if [[ ${__AUTOTOOLS_AUTO_DEPEND+set} == "set" ]] ; then |
36 |
# eclass at that point, but that adds overhead, and it's trivial |
37 |
# to re-order inherit in eclasses/ebuilds instead. #409611 |
38 |
if [[ ${__AUTOTOOLS_AUTO_DEPEND} != ${AUTOTOOLS_AUTO_DEPEND} ]] ; then |
39 |
- die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; please inherit autotools.eclass first! ${__AUTOTOOLS_AUTO_DEPEND} -> ${AUTOTOOLS_AUTO_DEPEND}" |
40 |
+ die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; please inherit ${ECLASS} first! ${__AUTOTOOLS_AUTO_DEPEND} -> ${AUTOTOOLS_AUTO_DEPEND}" |
41 |
fi |
42 |
fi |
43 |
|
44 |
-if [[ -z ${_AUTOTOOLS_ECLASS} ]]; then |
45 |
+if [[ -z ${_AUTOTOOLS_ECLASS} ]] ; then |
46 |
_AUTOTOOLS_ECLASS=1 |
47 |
|
48 |
case ${EAPI:-0} in |
49 |
- 0|1|2|3|4|5|6|7) ;; |
50 |
+ 5|6) |
51 |
+ # Needed for eqawarn |
52 |
+ inherit eutils |
53 |
+ ;; |
54 |
+ 7) ;; |
55 |
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;; |
56 |
esac |
57 |
|
58 |
inherit libtool |
59 |
|
60 |
# @ECLASS-VARIABLE: WANT_AUTOCONF |
61 |
+# @PRE_INHERIT |
62 |
# @DESCRIPTION: |
63 |
# The major version of autoconf your package needs |
64 |
: ${WANT_AUTOCONF:=latest} |
65 |
|
66 |
# @ECLASS-VARIABLE: WANT_AUTOMAKE |
67 |
+# @PRE_INHERIT |
68 |
# @DESCRIPTION: |
69 |
# The major version of automake your package needs |
70 |
: ${WANT_AUTOMAKE:=latest} |
71 |
|
72 |
# @ECLASS-VARIABLE: WANT_LIBTOOL |
73 |
+# @PRE_INHERIT |
74 |
# @DESCRIPTION: |
75 |
# Do you want libtool? Valid values here are "latest" and "none". |
76 |
: ${WANT_LIBTOOL:=latest} |
77 |
@@ -61,9 +68,9 @@ inherit libtool |
78 |
# version. |
79 |
# If a newer slot is stable on any arch, and is NOT reflected in this list, |
80 |
# then circular dependencies may arise during emerge @system bootstraps. |
81 |
-# |
82 |
-# See bug 312315 and 465732 for further information and context. |
83 |
-# |
84 |
+# |
85 |
+# See bug #312315 and bug #465732 for further information and context. |
86 |
+# |
87 |
# Do NOT change this variable in your ebuilds! |
88 |
# If you want to force a newer minor version, you can specify the correct |
89 |
# WANT value by using a colon: <PV>:<WANT_AUTOMAKE> |
90 |
@@ -71,11 +78,11 @@ _LATEST_AUTOMAKE=( 1.16.2-r1:1.16 ) |
91 |
|
92 |
_automake_atom="sys-devel/automake" |
93 |
_autoconf_atom="sys-devel/autoconf" |
94 |
-if [[ -n ${WANT_AUTOMAKE} ]]; then |
95 |
+if [[ -n ${WANT_AUTOMAKE} ]] ; then |
96 |
case ${WANT_AUTOMAKE} in |
97 |
# Even if the package doesn't use automake, we still need to depend |
98 |
# on it because we run aclocal to process m4 macros. This matches |
99 |
- # the autoreconf tool, so this requirement is correct. #401605 |
100 |
+ # the autoreconf tool, so this requirement is correct, bug #401605. |
101 |
none) ;; |
102 |
latest) |
103 |
# Use SLOT deps if we can. For EAPI=0, we get pretty close. |
104 |
@@ -111,12 +118,18 @@ if [[ -n ${WANT_LIBTOOL} ]] ; then |
105 |
export WANT_LIBTOOL |
106 |
fi |
107 |
|
108 |
+# @ECLASS-VARIABLE: AUTOTOOLS_DEPEND |
109 |
+# @INTERNAL |
110 |
+# @DESCRIPTION: |
111 |
+# Contains the combination of requested automake/autoconf/libtool |
112 |
+# versions in *DEPEND format. |
113 |
AUTOTOOLS_DEPEND="${_automake_atom} |
114 |
${_autoconf_atom} |
115 |
${_libtool_atom}" |
116 |
RDEPEND="" |
117 |
|
118 |
# @ECLASS-VARIABLE: AUTOTOOLS_AUTO_DEPEND |
119 |
+# @PRE_INHERIT |
120 |
# @DESCRIPTION: |
121 |
# Set to 'no' to disable automatically adding to DEPEND. This lets |
122 |
# ebuilds form conditional depends by using ${AUTOTOOLS_DEPEND} in |
123 |
@@ -137,12 +150,14 @@ unset _automake_atom _autoconf_atom |
124 |
# @DESCRIPTION: |
125 |
# Additional options to pass to automake during |
126 |
# eautoreconf call. |
127 |
+: ${AM_OPTS:=} |
128 |
|
129 |
# @ECLASS-VARIABLE: AT_NOEAUTOHEADER |
130 |
# @DEFAULT_UNSET |
131 |
# @DESCRIPTION: |
132 |
# Don't run eautoheader command if set to 'yes'; only used to work around |
133 |
# packages that don't want their headers being modified. |
134 |
+: ${AT_NOEAUTOHEADER:=} |
135 |
|
136 |
# @ECLASS-VARIABLE: AT_NOEAUTOMAKE |
137 |
# @DEFAULT_UNSET |
138 |
@@ -150,6 +165,7 @@ unset _automake_atom _autoconf_atom |
139 |
# Don't run eautomake command if set to 'yes'; only used to workaround |
140 |
# broken packages. Generally you should, instead, fix the package to |
141 |
# not call AM_INIT_AUTOMAKE if it doesn't actually use automake. |
142 |
+: ${AT_NOEAUTOMAKE:=} |
143 |
|
144 |
# @ECLASS-VARIABLE: AT_NOELIBTOOLIZE |
145 |
# @DEFAULT_UNSET |
146 |
@@ -157,13 +173,16 @@ unset _automake_atom _autoconf_atom |
147 |
# Don't run elibtoolize command if set to 'yes', |
148 |
# useful when elibtoolize needs to be ran with |
149 |
# particular options |
150 |
+: ${AT_NOELIBTOOLIZE:=} |
151 |
|
152 |
# @ECLASS-VARIABLE: AT_M4DIR |
153 |
+# @DEFAULT_UNSET |
154 |
# @DESCRIPTION: |
155 |
# Additional director(y|ies) aclocal should search |
156 |
: ${AT_M4DIR:=} |
157 |
|
158 |
# @ECLASS-VARIABLE: AT_SYS_M4DIR |
159 |
+# @DEFAULT_UNSET |
160 |
# @INTERNAL |
161 |
# @DESCRIPTION: |
162 |
# For system integrators, a list of additional aclocal search paths. |
163 |
@@ -182,13 +201,13 @@ unset _automake_atom _autoconf_atom |
164 |
eautoreconf() { |
165 |
local x g |
166 |
|
167 |
- # Subdirs often share a common build dir #529404. If so, we can't safely |
168 |
+ # Subdirs often share a common build dir, bug #529404. If so, we can't safely |
169 |
# run in parallel because many tools clobber the content in there. Libtool |
170 |
# and automake both `rm && cp` while aclocal reads the output. We might be |
171 |
# able to handle this if we split the steps and grab locks on the dirs the |
172 |
# tools actually write to. Then we'd run all the common tools that use |
173 |
# those inputs. Doing this in bash does not scale easily. |
174 |
- # If we do re-enable parallel support, make sure #426512 is handled. |
175 |
+ # If we do re-enable parallel support, make sure bug #426512 is handled. |
176 |
if [[ -z ${AT_NO_RECURSIVE} ]] ; then |
177 |
# Take care of subdirs |
178 |
for x in $(autotools_check_macro_val AC_CONFIG_SUBDIRS) ; do |
179 |
@@ -239,7 +258,7 @@ eautoreconf() { |
180 |
done |
181 |
${rerun_aclocal} && eaclocal |
182 |
|
183 |
- if [[ ${WANT_AUTOCONF} = 2.1 ]] ; then |
184 |
+ if [[ ${WANT_AUTOCONF} == "2.1" ]] ; then |
185 |
eautoconf |
186 |
else |
187 |
eautoconf --force |
188 |
@@ -259,6 +278,7 @@ eautoreconf() { |
189 |
# @FUNCTION: _at_uses_pkg |
190 |
# @USAGE: <macros> |
191 |
# @INTERNAL |
192 |
+# @DESCRIPTION: |
193 |
# See if the specified macros are enabled. |
194 |
_at_uses_pkg() { |
195 |
if [[ -n $(autotools_check_macro "$@") ]] ; then |
196 |
@@ -294,8 +314,8 @@ eaclocal_amflags() { |
197 |
[[ -e ${amflags_file} ]] || continue |
198 |
# setup the env in case the pkg does something crazy |
199 |
# in their ACLOCAL_AMFLAGS. like run a shell script |
200 |
- # which turns around and runs autotools. #365401 |
201 |
- # or split across multiple lines. #383525 |
202 |
+ # which turns around and runs autotools (bug #365401) |
203 |
+ # or split across multiple lines (bug #383525) |
204 |
autotools_env_setup |
205 |
aclocal_opts=$(sed -n \ |
206 |
"/^ACLOCAL_AMFLAGS[[:space:]]*=/{ \ |
207 |
@@ -317,7 +337,7 @@ eaclocal_amflags() { |
208 |
# specified parametes. The name of the tool run is the same of the function |
209 |
# without e prefix. |
210 |
# They also force installing the support files for safety. |
211 |
-# Respects AT_M4DIR for additional directories to search for macro's. |
212 |
+# Respects AT_M4DIR for additional directories to search for macros. |
213 |
eaclocal() { |
214 |
[[ ! -f aclocal.m4 || -n $(grep -e 'generated.*by aclocal' aclocal.m4) ]] && \ |
215 |
autotools_run_tool --at-m4flags aclocal "$@" $(eaclocal_amflags) |
216 |
@@ -331,7 +351,7 @@ eaclocal() { |
217 |
_elibtoolize() { |
218 |
local LIBTOOLIZE=${LIBTOOLIZE:-$(type -P glibtoolize > /dev/null && echo glibtoolize || echo libtoolize)} |
219 |
|
220 |
- if [[ $1 == "--auto-ltdl" ]] ; then |
221 |
+ if [[ ${1} == "--auto-ltdl" ]] ; then |
222 |
shift |
223 |
_at_uses_libltdl && set -- "$@" --ltdl |
224 |
fi |
225 |
@@ -359,6 +379,7 @@ eautoconf() { |
226 |
echo |
227 |
die "No configure.{ac,in} present!" |
228 |
fi |
229 |
+ |
230 |
if [[ ${WANT_AUTOCONF} != "2.1" && -e configure.in ]] ; then |
231 |
eqawarn "This package has a configure.in file which has long been deprecated. Please" |
232 |
eqawarn "update it to use configure.ac instead as newer versions of autotools will die" |
233 |
@@ -366,7 +387,7 @@ eautoconf() { |
234 |
fi |
235 |
|
236 |
# Install config.guess and config.sub which are required by many macros |
237 |
- # in Autoconf >=2.70. |
238 |
+ # in autoconf >=2.70. |
239 |
local _gnuconfig |
240 |
case ${EAPI:-0} in |
241 |
0|1|2|3|4|5|6) |
242 |
@@ -403,7 +424,7 @@ eautomake() { |
243 |
if [[ -z ${makefile_name} ]] ; then |
244 |
_at_uses_automake || return 0 |
245 |
|
246 |
- elif [[ -z ${FROM_EAUTORECONF} && -f ${makefile_name%.am}.in ]]; then |
247 |
+ elif [[ -z ${FROM_EAUTORECONF} && -f ${makefile_name%.am}.in ]] ; then |
248 |
local used_automake |
249 |
local installed_automake |
250 |
|
251 |
@@ -411,7 +432,7 @@ eautomake() { |
252 |
used_automake=$(head -n 1 < ${makefile_name%.am}.in | \ |
253 |
sed -e 's:.*by automake \(.*\) from .*:\1:') |
254 |
|
255 |
- if [[ ${installed_automake} != ${used_automake} ]]; then |
256 |
+ if [[ ${installed_automake} != ${used_automake} ]] ; then |
257 |
ewarn "Automake used for the package (${used_automake}) differs from" \ |
258 |
"the installed version (${installed_automake})." |
259 |
ewarn "Forcing a full rebuild of the autotools to workaround." |
260 |
@@ -424,10 +445,10 @@ eautomake() { |
261 |
|| extra_opts+=( --foreign ) |
262 |
|
263 |
# Older versions of automake do not support --force-missing. But we want |
264 |
- # to use this whenever possible to update random bundled files #133489. |
265 |
+ # to use this whenever possible to update random bundled files, bug #133489. |
266 |
case $(_automake_version) in |
267 |
- 1.4|1.4[.-]*) ;; |
268 |
- *) extra_opts+=( --force-missing ) ;; |
269 |
+ 1.4|1.4[.-]*) ;; |
270 |
+ *) extra_opts+=( --force-missing ) ;; |
271 |
esac |
272 |
|
273 |
autotools_run_tool automake --add-missing --copy "${extra_opts[@]}" "$@" |
274 |
@@ -475,7 +496,7 @@ config_rpath_update() { |
275 |
autotools_env_setup() { |
276 |
# We do the "latest" → version switch here because it solves |
277 |
# possible order problems, see bug #270010 as an example. |
278 |
- if [[ ${WANT_AUTOMAKE} == "latest" ]]; then |
279 |
+ if [[ ${WANT_AUTOMAKE} == "latest" ]] ; then |
280 |
local pv |
281 |
for pv in ${_LATEST_AUTOMAKE[@]/#*:} ; do |
282 |
# Break on first hit to respect _LATEST_AUTOMAKE order. |
283 |
@@ -505,30 +526,30 @@ autotools_env_setup() { |
284 |
autotools_run_tool() { |
285 |
# Process our own internal flags first |
286 |
local autofail=true m4flags=false missing_ok=false return_output=false |
287 |
- while [[ -n $1 ]] ; do |
288 |
- case $1 in |
289 |
- --at-no-fail) autofail=false;; |
290 |
- --at-m4flags) m4flags=true;; |
291 |
- --at-missing) missing_ok=true;; |
292 |
- --at-output) return_output=true;; |
293 |
- # whatever is left goes to the actual tool |
294 |
- *) break;; |
295 |
+ while [[ -n ${1} ]] ; do |
296 |
+ case ${1} in |
297 |
+ --at-no-fail) autofail=false ;; |
298 |
+ --at-m4flags) m4flags=true ;; |
299 |
+ --at-missing) missing_ok=true ;; |
300 |
+ --at-output) return_output=true ;; |
301 |
+ # whatever is left goes to the actual tool |
302 |
+ *) break ;; |
303 |
esac |
304 |
shift |
305 |
done |
306 |
|
307 |
- if [[ ${EBUILD_PHASE} != "unpack" && ${EBUILD_PHASE} != "prepare" ]]; then |
308 |
- ewarn "QA Warning: running $1 in ${EBUILD_PHASE} phase" |
309 |
+ if [[ ${EBUILD_PHASE_FUNC} != "src_unpack" && ${EBUILD_PHASE_FUNC} != "src_prepare" ]] ; then |
310 |
+ eqawarn "Running '${1}' in ${EBUILD_PHASE_FUNC} phase" |
311 |
fi |
312 |
|
313 |
if ${missing_ok} && ! type -P ${1} >/dev/null ; then |
314 |
- einfo "Skipping '$*' due $1 not installed" |
315 |
+ einfo "Skipping '$*' because '${1}' not installed" |
316 |
return 0 |
317 |
fi |
318 |
|
319 |
autotools_env_setup |
320 |
|
321 |
- # Allow people to pass in full paths. #549268 |
322 |
+ # Allow people to pass in full paths, bug #549268 |
323 |
local STDERR_TARGET="${T}/${1##*/}.out" |
324 |
# most of the time, there will only be one run, but if there are |
325 |
# more, make sure we get unique log filenames |
326 |
@@ -551,19 +572,19 @@ autotools_run_tool() { |
327 |
return |
328 |
fi |
329 |
|
330 |
- printf "***** $1 *****\n***** PWD: ${PWD}\n***** $*\n\n" > "${STDERR_TARGET}" |
331 |
+ printf "***** ${1} *****\n***** PWD: ${PWD}\n***** $*\n\n" > "${STDERR_TARGET}" |
332 |
|
333 |
- ebegin "Running $@" |
334 |
+ ebegin "Running '$@'" |
335 |
"$@" >> "${STDERR_TARGET}" 2>&1 |
336 |
if ! eend $? && ${autofail} ; then |
337 |
echo |
338 |
- eerror "Failed Running $1 !" |
339 |
+ eerror "Failed running '${1}'!" |
340 |
eerror |
341 |
- eerror "Include in your bugreport the contents of:" |
342 |
+ eerror "Include in your bug report the contents of:" |
343 |
eerror |
344 |
eerror " ${STDERR_TARGET}" |
345 |
echo |
346 |
- die "Failed Running $1 !" |
347 |
+ die "Failed running '${1}'!" |
348 |
fi |
349 |
} |
350 |
|
351 |
@@ -636,7 +657,7 @@ _autotools_m4dir_include() { |
352 |
# We handle it below |
353 |
-${flag}) ;; |
354 |
*) |
355 |
- [[ ! -d ${x} ]] && ewarn "autotools.eclass: '${x}' does not exist" |
356 |
+ [[ ! -d ${x} ]] && ewarn "${ECLASS}: '${x}' does not exist" |
357 |
include_opts+=" -${flag} ${x}" |
358 |
;; |
359 |
esac |
360 |
-- |
361 |
2.31.1 |