1 |
commit: bff583ede76fd4f7ab5b21399ff72bfce15634aa |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 28 23:42:11 2021 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 28 23:49:40 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bff583ed |
7 |
|
8 |
sys-devel/autoconf-wrapper: Bump to version 15 |
9 |
|
10 |
Package-Manager: Portage-3.0.14, Repoman-3.0.2 |
11 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
12 |
|
13 |
.../autoconf-wrapper/autoconf-wrapper-15.ebuild | 29 +++ |
14 |
sys-devel/autoconf-wrapper/files/ac-wrapper-15.sh | 203 +++++++++++++++++++++ |
15 |
2 files changed, 232 insertions(+) |
16 |
|
17 |
diff --git a/sys-devel/autoconf-wrapper/autoconf-wrapper-15.ebuild b/sys-devel/autoconf-wrapper/autoconf-wrapper-15.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..68d956726bb |
20 |
--- /dev/null |
21 |
+++ b/sys-devel/autoconf-wrapper/autoconf-wrapper-15.ebuild |
22 |
@@ -0,0 +1,29 @@ |
23 |
+# Copyright 1999-2021 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=7 |
27 |
+ |
28 |
+inherit multilib |
29 |
+ |
30 |
+DESCRIPTION="wrapper for autoconf to manage multiple autoconf versions" |
31 |
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" |
32 |
+SRC_URI="" |
33 |
+ |
34 |
+LICENSE="GPL-2" |
35 |
+SLOT="0" |
36 |
+[[ "${PV}" == *_pre* ]] || \ |
37 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
38 |
+IUSE="" |
39 |
+ |
40 |
+S="${WORKDIR}" |
41 |
+ |
42 |
+src_install() { |
43 |
+ exeinto /usr/$(get_libdir)/misc |
44 |
+ newexe "${FILESDIR}"/ac-wrapper-${PV}.sh ac-wrapper.sh |
45 |
+ |
46 |
+ dodir /usr/bin |
47 |
+ local x= |
48 |
+ for x in auto{conf,header,m4te,reconf,scan,update} ifnames ; do |
49 |
+ dosym ../$(get_libdir)/misc/ac-wrapper.sh /usr/bin/${x} |
50 |
+ done |
51 |
+} |
52 |
|
53 |
diff --git a/sys-devel/autoconf-wrapper/files/ac-wrapper-15.sh b/sys-devel/autoconf-wrapper/files/ac-wrapper-15.sh |
54 |
new file mode 100644 |
55 |
index 00000000000..e5eda0e53f1 |
56 |
--- /dev/null |
57 |
+++ b/sys-devel/autoconf-wrapper/files/ac-wrapper-15.sh |
58 |
@@ -0,0 +1,203 @@ |
59 |
+#!/bin/sh |
60 |
+# Copyright 1999-2021 Gentoo Authors |
61 |
+# Distributed under the terms of the GNU General Public License v2 |
62 |
+ |
63 |
+# Based on the ac-wrapper.pl script provided by MandrakeSoft |
64 |
+# Rewritten in bash by Gregorio Guidi |
65 |
+# |
66 |
+# Executes the correct autoconf version. |
67 |
+# |
68 |
+# - defaults to newest version available (hopefully autoconf-2.60) |
69 |
+# - runs autoconf 2.13 if: |
70 |
+# - envvar WANT_AUTOCONF is set to `2.1' |
71 |
+# -or- |
72 |
+# - `ac{local,include}.m4' or `configure.{in,ac}' have AC_PREREQ(2.1) (not higher) |
73 |
+# -or- |
74 |
+# - `configure' is already present and was generated by autoconf 2.13 |
75 |
+ |
76 |
+warn() { printf "ac-wrapper: $*\n" 1>&2; } |
77 |
+err() { warn "$@"; exit 1; } |
78 |
+unset IFS |
79 |
+which() { |
80 |
+ local p |
81 |
+ IFS=: # we don't use IFS anywhere, so don't bother saving/restoring |
82 |
+ for p in ${PATH} ; do |
83 |
+ p="${p}/$1" |
84 |
+ [ -e "${p}" ] && echo "${p}" && return 0 |
85 |
+ done |
86 |
+ unset IFS |
87 |
+ return 1 |
88 |
+} |
89 |
+ |
90 |
+# |
91 |
+# Sanitize argv[0] since it isn't always a full path #385201 |
92 |
+# |
93 |
+argv0=${0##*/} |
94 |
+case ${0} in |
95 |
+ ${argv0}) |
96 |
+ # find it in PATH |
97 |
+ if ! full_argv0=$(which "${argv0}") ; then |
98 |
+ err "could not locate ${argv0}; file a bug" |
99 |
+ fi |
100 |
+ ;; |
101 |
+ *) |
102 |
+ # re-use full/relative paths |
103 |
+ full_argv0=$0 |
104 |
+ ;; |
105 |
+esac |
106 |
+ |
107 |
+if [ "${argv0}" = "ac-wrapper.sh" ] ; then |
108 |
+ err "Don't call this script directly" |
109 |
+fi |
110 |
+ |
111 |
+if [ "${WANT_AUTOCONF}" = "2.1" ] && [ "${argv0}" = "autom4te" ] ; then |
112 |
+ err "Autoconf 2.13 doesn't contain autom4te.\n" \ |
113 |
+ " Either unset WANT_AUTOCONF or don't execute anything\n" \ |
114 |
+ " that would use autom4te." |
115 |
+fi |
116 |
+ |
117 |
+if ! seq 0 0 2>/dev/null 1>&2 ; then #338518 |
118 |
+ seq() { |
119 |
+ local f l i |
120 |
+ case $# in |
121 |
+ 1) f=1 i=1 l=$1;; |
122 |
+ 2) f=$1 i=1 l=$2;; |
123 |
+ 3) f=$1 i=$2 l=$3;; |
124 |
+ esac |
125 |
+ while :; do |
126 |
+ [ $l -lt $f -a $i -gt 0 ] && break |
127 |
+ [ $f -lt $l -a $i -lt 0 ] && break |
128 |
+ echo $f |
129 |
+ : $(( f += i )) |
130 |
+ done |
131 |
+ return 0 |
132 |
+ } |
133 |
+fi |
134 |
+ |
135 |
+# |
136 |
+# Set up bindings between actual version and WANT_AUTOCONF; |
137 |
+# Start at last known unstable/stable versions to speed up lookup process. |
138 |
+# |
139 |
+if [ -z "${KNOWN_AUTOCONF}" ] ; then |
140 |
+ KNOWN_AUTOCONF="2.71:2.5 2.70:2.5 2.69:2.5" |
141 |
+fi |
142 |
+vers="${KNOWN_AUTOCONF} 9999:2.5 $(printf '2.%s:2.5 ' `seq 99 -1 59`) 2.13:2.1" |
143 |
+ |
144 |
+binary="" |
145 |
+for v in ${vers} ; do |
146 |
+ auto_ver=${v%:*} |
147 |
+ if [ -z "${binary}" ] && [ -x "${full_argv0}-${auto_ver}" ] ; then |
148 |
+ binary="${full_argv0}-${auto_ver}" |
149 |
+ break |
150 |
+ fi |
151 |
+done |
152 |
+if [ -z "${binary}" ] ; then |
153 |
+ err "Unable to locate any usuable version of autoconf.\n" \ |
154 |
+ "\tI tried these versions: ${vers}\n" \ |
155 |
+ "\tWith a base name of '${full_argv0}'." |
156 |
+fi |
157 |
+ |
158 |
+# |
159 |
+# Check the WANT_AUTOCONF setting. We accept a whitespace delimited |
160 |
+# list of autoconf versions. |
161 |
+# |
162 |
+if [ -n "${WANT_AUTOCONF}" ] ; then |
163 |
+ for v in ${vers} x ; do |
164 |
+ if [ "${v}" = "x" ] ; then |
165 |
+ warn "warning: invalid WANT_AUTOCONF '${WANT_AUTOCONF}'; ignoring." |
166 |
+ unset WANT_AUTOCONF |
167 |
+ break |
168 |
+ fi |
169 |
+ |
170 |
+ auto_ver=${v%:*} |
171 |
+ want_ver=${v#*:} |
172 |
+ for wx in ${WANT_AUTOCONF} ; do |
173 |
+ if [ -x "${full_argv0}-${wx}" ] ; then |
174 |
+ binary="${full_argv0}-${wx}" |
175 |
+ v="x" |
176 |
+ elif [ "${wx}" = "${want_ver}" ] && [ -x "${full_argv0}-${auto_ver}" ] ; then |
177 |
+ binary="${full_argv0}-${auto_ver}" |
178 |
+ v="x" |
179 |
+ fi |
180 |
+ done |
181 |
+ [ "${v}" = "x" ] && break |
182 |
+ done |
183 |
+fi |
184 |
+ |
185 |
+# |
186 |
+# autodetect helpers |
187 |
+# |
188 |
+acprereq_version() { |
189 |
+ sed -n -r \ |
190 |
+ -e '/^\s*(#|dnl)/d' \ |
191 |
+ -e '/AC_PREREQ/s:.*AC_PREREQ\s*\(\[?\s*([0-9.]+)\s*\]?\):\1:p' \ |
192 |
+ "$@" | |
193 |
+ LC_ALL=C sort -n -t . | |
194 |
+ tail -1 |
195 |
+} |
196 |
+ |
197 |
+generated_version() { |
198 |
+ local re='^# Generated (by (GNU )?Autoconf|automatically using autoconf version) ([0-9.]+).*' |
199 |
+ sed -n -r "/${re}/{s:${re}:\3:;p;q}" "$@" |
200 |
+} |
201 |
+ |
202 |
+# |
203 |
+# autodetect routine |
204 |
+# |
205 |
+if [ "${WANT_AUTOCONF}" = "2.1" ] && [ -f "configure.ac" ] ; then |
206 |
+ err "Since configure.ac is present, aclocal always use\n" \ |
207 |
+ "\tautoconf 2.59+, which conflicts with your choice and\n" \ |
208 |
+ "\tcauses error. You have two options:\n" \ |
209 |
+ "\t1. Try execute command again after removing configure.ac\n" \ |
210 |
+ "\t2. Don't set WANT_AUTOCONF" |
211 |
+fi |
212 |
+ |
213 |
+if [ "${WANT_AUTOCONF:-2.1}" = "2.1" ] && [ -n "${WANT_AUTOMAKE}" ] ; then |
214 |
+ # Automake-1.7 and better require autoconf-2.5x so if WANT_AUTOMAKE |
215 |
+ # is set to an older version, let's do some sanity checks. |
216 |
+ case "${WANT_AUTOMAKE}" in |
217 |
+ 1.[456]) |
218 |
+ acfiles=$(ls aclocal.m4 acinclude.m4 configure.in configure.ac 2>/dev/null) |
219 |
+ [ -n "${acfiles}" ] && confversion=$(acprereq_version ${acfiles}) |
220 |
+ |
221 |
+ [ -z "${confversion}" ] && [ -r "configure" ] \ |
222 |
+ && confversion=$(generated_version configure) |
223 |
+ |
224 |
+ if [ "${confversion}" = "2.1" ] && [ ! -f "configure.ac" ] ; then |
225 |
+ binary="${full_argv0}-2.13" |
226 |
+ fi |
227 |
+ esac |
228 |
+fi |
229 |
+ |
230 |
+if [ -n "${WANT_ACWRAPPER_DEBUG}" ] ; then |
231 |
+ if [ -n "${WANT_AUTOCONF}" ] ; then |
232 |
+ warn "DEBUG: WANT_AUTOCONF is set to ${WANT_AUTOCONF}" |
233 |
+ fi |
234 |
+ warn "DEBUG: will execute <${binary}>" |
235 |
+fi |
236 |
+ |
237 |
+# |
238 |
+# for further consistency |
239 |
+# |
240 |
+if [ -z "${WANT_AUTOCONF}" ] ; then |
241 |
+ for v in ${vers} ; do |
242 |
+ auto_ver=${v%:*} |
243 |
+ want_ver=${v#*:} |
244 |
+ if [ "${binary}" = "${full_argv0}-${auto_ver}" ] ; then |
245 |
+ export WANT_AUTOCONF="${want_ver}" |
246 |
+ break |
247 |
+ fi |
248 |
+ done |
249 |
+fi |
250 |
+ |
251 |
+# |
252 |
+# Now try to run the binary |
253 |
+# |
254 |
+if [ ! -x "${binary}" ] ; then |
255 |
+ # this shouldn't happen |
256 |
+ err "${binary} is missing or not executable.\n" \ |
257 |
+ "\tPlease try emerging the correct version of autoconf." |
258 |
+fi |
259 |
+ |
260 |
+exec "${binary}" "$@" |
261 |
+# The shell will error out if `exec` failed. |