1 |
commit: 5983d5a7f7dc72f345af2575639d2f4b1dacd3f6 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 4 17:12:29 2021 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 4 17:12:29 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5983d5a7 |
7 |
|
8 |
eclass/autotools: sync with gx86 |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
eclass/autotools.eclass | 110 +++++++++++++++++++++++------------------------- |
13 |
1 file changed, 53 insertions(+), 57 deletions(-) |
14 |
|
15 |
diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass |
16 |
index ded5436a45..196d5075f4 100644 |
17 |
--- a/eclass/autotools.eclass |
18 |
+++ b/eclass/autotools.eclass |
19 |
@@ -4,7 +4,7 @@ |
20 |
# @ECLASS: autotools.eclass |
21 |
# @MAINTAINER: |
22 |
# base-system@g.o |
23 |
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7 |
24 |
+# @SUPPORTED_EAPIS: 5 6 7 |
25 |
# @BLURB: Regenerates auto* build scripts |
26 |
# @DESCRIPTION: |
27 |
# This eclass is for safely handling autotooled software packages that need to |
28 |
@@ -19,19 +19,23 @@ if [[ ${__AUTOTOOLS_AUTO_DEPEND+set} == "set" ]] ; then |
29 |
# eclass at that point, but that adds overhead, and it's trivial |
30 |
# to re-order inherit in eclasses/ebuilds instead. #409611 |
31 |
if [[ ${__AUTOTOOLS_AUTO_DEPEND} != ${AUTOTOOLS_AUTO_DEPEND} ]] ; then |
32 |
- die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; please inherit autotools.eclass first! ${__AUTOTOOLS_AUTO_DEPEND} -> ${AUTOTOOLS_AUTO_DEPEND}" |
33 |
+ die "AUTOTOOLS_AUTO_DEPEND changed value between inherits; please inherit ${ECLASS} first! ${__AUTOTOOLS_AUTO_DEPEND} -> ${AUTOTOOLS_AUTO_DEPEND}" |
34 |
fi |
35 |
fi |
36 |
|
37 |
-if [[ -z ${_AUTOTOOLS_ECLASS} ]]; then |
38 |
+if [[ -z ${_AUTOTOOLS_ECLASS} ]] ; then |
39 |
_AUTOTOOLS_ECLASS=1 |
40 |
|
41 |
-case ${EAPI:-0} in |
42 |
- 0|1|2|3|4|5|6|7) ;; |
43 |
+case ${EAPI} in |
44 |
+ 5|6) |
45 |
+ # Needed for eqawarn |
46 |
+ inherit eutils |
47 |
+ ;; |
48 |
+ 7) ;; |
49 |
*) die "${ECLASS}: EAPI ${EAPI} not supported" ;; |
50 |
esac |
51 |
|
52 |
-inherit libtool |
53 |
+inherit gnuconfig libtool |
54 |
|
55 |
# @ECLASS-VARIABLE: WANT_AUTOCONF |
56 |
# @PRE_INHERIT |
57 |
@@ -74,21 +78,14 @@ _LATEST_AUTOMAKE=( 1.16.2-r1:1.16 ) |
58 |
|
59 |
_automake_atom="sys-devel/automake" |
60 |
_autoconf_atom="sys-devel/autoconf" |
61 |
-if [[ -n ${WANT_AUTOMAKE} ]]; then |
62 |
+if [[ -n ${WANT_AUTOMAKE} ]] ; then |
63 |
case ${WANT_AUTOMAKE} in |
64 |
# Even if the package doesn't use automake, we still need to depend |
65 |
# on it because we run aclocal to process m4 macros. This matches |
66 |
# the autoreconf tool, so this requirement is correct, bug #401605. |
67 |
none) ;; |
68 |
- latest) |
69 |
- # Use SLOT deps if we can. For EAPI=0, we get pretty close. |
70 |
- if [[ ${EAPI:-0} != 0 ]] ; then |
71 |
- _automake_atom="|| ( `printf '>=sys-devel/automake-%s:%s ' ${_LATEST_AUTOMAKE[@]/:/ }` )" |
72 |
- else |
73 |
- _automake_atom="|| ( `printf '>=sys-devel/automake-%s ' ${_LATEST_AUTOMAKE[@]/%:*}` )" |
74 |
- fi |
75 |
- ;; |
76 |
- *) _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*" ;; |
77 |
+ latest) _automake_atom="|| ( `printf '>=sys-devel/automake-%s:%s ' ${_LATEST_AUTOMAKE[@]/:/ }` )" ;; |
78 |
+ *) _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*";; |
79 |
esac |
80 |
export WANT_AUTOMAKE |
81 |
fi |
82 |
@@ -114,10 +111,12 @@ if [[ -n ${WANT_LIBTOOL} ]] ; then |
83 |
export WANT_LIBTOOL |
84 |
fi |
85 |
|
86 |
-# Force people (nicely) to upgrade to a newer version of gettext as |
87 |
-# older ones are known to be crappy. #496454 |
88 |
-AUTOTOOLS_DEPEND="!<sys-devel/gettext-0.18.1.1-r3 |
89 |
- ${_automake_atom} |
90 |
+# @ECLASS-VARIABLE: AUTOTOOLS_DEPEND |
91 |
+# @INTERNAL |
92 |
+# @DESCRIPTION: |
93 |
+# Contains the combination of requested automake/autoconf/libtool |
94 |
+# versions in *DEPEND format. |
95 |
+AUTOTOOLS_DEPEND="${_automake_atom} |
96 |
${_autoconf_atom} |
97 |
${_libtool_atom}" |
98 |
RDEPEND="" |
99 |
@@ -130,8 +129,8 @@ RDEPEND="" |
100 |
# their own DEPEND string. |
101 |
: ${AUTOTOOLS_AUTO_DEPEND:=yes} |
102 |
if [[ ${AUTOTOOLS_AUTO_DEPEND} != "no" ]] ; then |
103 |
- case ${EAPI:-0} in |
104 |
- 0|1|2|3|4|5|6) DEPEND=${AUTOTOOLS_DEPEND} ;; |
105 |
+ case ${EAPI} in |
106 |
+ 5|6) DEPEND=${AUTOTOOLS_DEPEND} ;; |
107 |
7) BDEPEND=${AUTOTOOLS_DEPEND} ;; |
108 |
esac |
109 |
fi |
110 |
@@ -144,12 +143,14 @@ unset _automake_atom _autoconf_atom |
111 |
# @DESCRIPTION: |
112 |
# Additional options to pass to automake during |
113 |
# eautoreconf call. |
114 |
+: ${AM_OPTS:=} |
115 |
|
116 |
# @ECLASS-VARIABLE: AT_NOEAUTOHEADER |
117 |
# @DEFAULT_UNSET |
118 |
# @DESCRIPTION: |
119 |
# Don't run eautoheader command if set to 'yes'; only used to work around |
120 |
# packages that don't want their headers being modified. |
121 |
+: ${AT_NOEAUTOHEADER:=} |
122 |
|
123 |
# @ECLASS-VARIABLE: AT_NOEAUTOMAKE |
124 |
# @DEFAULT_UNSET |
125 |
@@ -157,6 +158,7 @@ unset _automake_atom _autoconf_atom |
126 |
# Don't run eautomake command if set to 'yes'; only used to workaround |
127 |
# broken packages. Generally you should, instead, fix the package to |
128 |
# not call AM_INIT_AUTOMAKE if it doesn't actually use automake. |
129 |
+: ${AT_NOEAUTOMAKE:=} |
130 |
|
131 |
# @ECLASS-VARIABLE: AT_NOELIBTOOLIZE |
132 |
# @DEFAULT_UNSET |
133 |
@@ -164,6 +166,7 @@ unset _automake_atom _autoconf_atom |
134 |
# Don't run elibtoolize command if set to 'yes', |
135 |
# useful when elibtoolize needs to be ran with |
136 |
# particular options |
137 |
+: ${AT_NOELIBTOOLIZE:=} |
138 |
|
139 |
# @ECLASS-VARIABLE: AT_M4DIR |
140 |
# @DEFAULT_UNSET |
141 |
@@ -248,7 +251,7 @@ eautoreconf() { |
142 |
done |
143 |
${rerun_aclocal} && eaclocal |
144 |
|
145 |
- if [[ ${WANT_AUTOCONF} = 2.1 ]] ; then |
146 |
+ if [[ ${WANT_AUTOCONF} == "2.1" ]] ; then |
147 |
eautoconf |
148 |
else |
149 |
eautoconf --force |
150 |
@@ -268,6 +271,7 @@ eautoreconf() { |
151 |
# @FUNCTION: _at_uses_pkg |
152 |
# @USAGE: <macros> |
153 |
# @INTERNAL |
154 |
+# @DESCRIPTION: |
155 |
# See if the specified macros are enabled. |
156 |
_at_uses_pkg() { |
157 |
if [[ -n $(autotools_check_macro "$@") ]] ; then |
158 |
@@ -340,7 +344,7 @@ eaclocal() { |
159 |
_elibtoolize() { |
160 |
local LIBTOOLIZE=${LIBTOOLIZE:-$(type -P glibtoolize > /dev/null && echo glibtoolize || echo libtoolize)} |
161 |
|
162 |
- if [[ $1 == "--auto-ltdl" ]] ; then |
163 |
+ if [[ ${1} == "--auto-ltdl" ]] ; then |
164 |
shift |
165 |
_at_uses_libltdl && set -- "$@" --ltdl |
166 |
fi |
167 |
@@ -368,6 +372,7 @@ eautoconf() { |
168 |
echo |
169 |
die "No configure.{ac,in} present!" |
170 |
fi |
171 |
+ |
172 |
if [[ ${WANT_AUTOCONF} != "2.1" && -e configure.in ]] ; then |
173 |
eqawarn "This package has a configure.in file which has long been deprecated. Please" |
174 |
eqawarn "update it to use configure.ac instead as newer versions of autotools will die" |
175 |
@@ -376,15 +381,7 @@ eautoconf() { |
176 |
|
177 |
# Install config.guess and config.sub which are required by many macros |
178 |
# in autoconf >=2.70. |
179 |
- local _gnuconfig |
180 |
- case ${EAPI:-0} in |
181 |
- 0|1|2|3|4|5|6) |
182 |
- _gnuconfig="${EPREFIX}/usr/share/gnuconfig" |
183 |
- ;; |
184 |
- *) |
185 |
- _gnuconfig="${BROOT}/usr/share/gnuconfig" |
186 |
- ;; |
187 |
- esac |
188 |
+ local _gnuconfig=$(gnuconfig_findnewest) |
189 |
cp "${_gnuconfig}"/config.{guess,sub} . || die |
190 |
|
191 |
autotools_run_tool --at-m4flags autoconf "$@" |
192 |
@@ -412,7 +409,7 @@ eautomake() { |
193 |
if [[ -z ${makefile_name} ]] ; then |
194 |
_at_uses_automake || return 0 |
195 |
|
196 |
- elif [[ -z ${FROM_EAUTORECONF} && -f ${makefile_name%.am}.in ]]; then |
197 |
+ elif [[ -z ${FROM_EAUTORECONF} && -f ${makefile_name%.am}.in ]] ; then |
198 |
local used_automake |
199 |
local installed_automake |
200 |
|
201 |
@@ -420,7 +417,7 @@ eautomake() { |
202 |
used_automake=$(head -n 1 < ${makefile_name%.am}.in | \ |
203 |
sed -e 's:.*by automake \(.*\) from .*:\1:') |
204 |
|
205 |
- if [[ ${installed_automake} != ${used_automake} ]]; then |
206 |
+ if [[ ${installed_automake} != ${used_automake} ]] ; then |
207 |
ewarn "Automake used for the package (${used_automake}) differs from" \ |
208 |
"the installed version (${installed_automake})." |
209 |
ewarn "Forcing a full rebuild of the autotools to workaround." |
210 |
@@ -435,8 +432,8 @@ eautomake() { |
211 |
# Older versions of automake do not support --force-missing. But we want |
212 |
# to use this whenever possible to update random bundled files, bug #133489. |
213 |
case $(_automake_version) in |
214 |
- 1.4|1.4[.-]*) ;; |
215 |
- *) extra_opts+=( --force-missing ) ;; |
216 |
+ 1.4|1.4[.-]*) ;; |
217 |
+ *) extra_opts+=( --force-missing ) ;; |
218 |
esac |
219 |
|
220 |
autotools_run_tool automake --add-missing --copy "${extra_opts[@]}" "$@" |
221 |
@@ -458,8 +455,8 @@ eautopoint() { |
222 |
config_rpath_update() { |
223 |
local dst src |
224 |
|
225 |
- case ${EAPI:-0} in |
226 |
- 0|1|2|3|4|5|6) |
227 |
+ case ${EAPI} in |
228 |
+ 5|6) |
229 |
src="${EPREFIX}/usr/share/gettext/config.rpath" |
230 |
;; |
231 |
*) |
232 |
@@ -493,7 +490,7 @@ autotools_env_setup() { |
233 |
for pv in ${_LATEST_AUTOMAKE[@]/#*:} ; do |
234 |
# Break on first hit to respect _LATEST_AUTOMAKE order. |
235 |
local hv_args="" |
236 |
- case ${EAPI:-0} in |
237 |
+ case ${EAPI} in |
238 |
5|6) |
239 |
hv_args="--host-root" |
240 |
;; |
241 |
@@ -506,7 +503,6 @@ autotools_env_setup() { |
242 |
[[ ${WANT_AUTOMAKE} == "latest" ]] && \ |
243 |
die "Cannot find the latest automake! Tried ${_LATEST_AUTOMAKE[*]}" |
244 |
fi |
245 |
- [[ ${WANT_AUTOMAKE} == "latest" ]] && export WANT_AUTOMAKE=${_LATEST_AUTOMAKE[0]#*:} |
246 |
[[ ${WANT_AUTOCONF} == "latest" ]] && export WANT_AUTOCONF=2.5 |
247 |
} |
248 |
|
249 |
@@ -519,24 +515,24 @@ autotools_env_setup() { |
250 |
autotools_run_tool() { |
251 |
# Process our own internal flags first |
252 |
local autofail=true m4flags=false missing_ok=false return_output=false |
253 |
- while [[ -n $1 ]] ; do |
254 |
- case $1 in |
255 |
- --at-no-fail) autofail=false;; |
256 |
- --at-m4flags) m4flags=true;; |
257 |
- --at-missing) missing_ok=true;; |
258 |
- --at-output) return_output=true;; |
259 |
- # whatever is left goes to the actual tool |
260 |
- *) break;; |
261 |
+ while [[ -n ${1} ]] ; do |
262 |
+ case ${1} in |
263 |
+ --at-no-fail) autofail=false ;; |
264 |
+ --at-m4flags) m4flags=true ;; |
265 |
+ --at-missing) missing_ok=true ;; |
266 |
+ --at-output) return_output=true ;; |
267 |
+ # whatever is left goes to the actual tool |
268 |
+ *) break ;; |
269 |
esac |
270 |
shift |
271 |
done |
272 |
|
273 |
- if [[ ${EBUILD_PHASE} != "unpack" && ${EBUILD_PHASE} != "prepare" ]]; then |
274 |
- ewarn "QA Warning: running '$1' in ${EBUILD_PHASE} phase" |
275 |
+ if [[ ${EBUILD_PHASE_FUNC} != "src_unpack" && ${EBUILD_PHASE_FUNC} != "src_prepare" ]] ; then |
276 |
+ eqawarn "Running '${1}' in ${EBUILD_PHASE_FUNC} phase" |
277 |
fi |
278 |
|
279 |
if ${missing_ok} && ! type -P ${1} >/dev/null ; then |
280 |
- einfo "Skipping '$*' because '$1' not installed" |
281 |
+ einfo "Skipping '$*' because '${1}' not installed" |
282 |
return 0 |
283 |
fi |
284 |
|
285 |
@@ -565,19 +561,19 @@ autotools_run_tool() { |
286 |
return |
287 |
fi |
288 |
|
289 |
- printf "***** $1 *****\n***** PWD: ${PWD}\n***** $*\n\n" > "${STDERR_TARGET}" |
290 |
+ printf "***** ${1} *****\n***** PWD: ${PWD}\n***** $*\n\n" > "${STDERR_TARGET}" |
291 |
|
292 |
- ebegin "Running $@" |
293 |
+ ebegin "Running '$@'" |
294 |
"$@" >> "${STDERR_TARGET}" 2>&1 |
295 |
if ! eend $? && ${autofail} ; then |
296 |
echo |
297 |
- eerror "Failed running '$1'!" |
298 |
+ eerror "Failed running '${1}'!" |
299 |
eerror |
300 |
eerror "Include in your bug report the contents of:" |
301 |
eerror |
302 |
eerror " ${STDERR_TARGET}" |
303 |
echo |
304 |
- die "Failed running '$1'!" |
305 |
+ die "Failed running '${1}'!" |
306 |
fi |
307 |
} |
308 |
|
309 |
@@ -650,7 +646,7 @@ _autotools_m4dir_include() { |
310 |
# We handle it below |
311 |
-${flag}) ;; |
312 |
*) |
313 |
- [[ ! -d ${x} ]] && ewarn "autotools.eclass: '${x}' does not exist" |
314 |
+ [[ ! -d ${x} ]] && ewarn "${ECLASS}: '${x}' does not exist" |
315 |
include_opts+=" -${flag} ${x}" |
316 |
;; |
317 |
esac |