1 |
commit: fdd5c618b5ac3633580b76043cb344e0881ffc6d |
2 |
Author: Tupone Alfredo <tupone <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 5 07:25:56 2019 +0000 |
4 |
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 5 07:26:56 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdd5c618 |
7 |
|
8 |
Revert ada.eclass modification as requested |
9 |
|
10 |
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org> |
11 |
|
12 |
dev-ada/gprbuild/gprbuild-2017-r2.ebuild | 89 ------- |
13 |
dev-ada/gprbuild/gprbuild-2019-r1.ebuild | 81 ------ |
14 |
dev-ada/libgpr/libgpr-2019-r1.ebuild | 60 ----- |
15 |
dev-ada/xmlada/xmlada-2019-r1.ebuild | 80 ------ |
16 |
eclass/ada.eclass | 435 ------------------------------- |
17 |
5 files changed, 745 deletions(-) |
18 |
|
19 |
diff --git a/dev-ada/gprbuild/gprbuild-2017-r2.ebuild b/dev-ada/gprbuild/gprbuild-2017-r2.ebuild |
20 |
deleted file mode 100644 |
21 |
index 79897043cf6..00000000000 |
22 |
--- a/dev-ada/gprbuild/gprbuild-2017-r2.ebuild |
23 |
+++ /dev/null |
24 |
@@ -1,89 +0,0 @@ |
25 |
-# Copyright 1999-2019 Gentoo Authors |
26 |
-# Distributed under the terms of the GNU General Public License v2 |
27 |
- |
28 |
-EAPI=7 |
29 |
- |
30 |
-ADA_COMPAT=( gnat_201{6,7} ) |
31 |
- |
32 |
-inherit ada toolchain-funcs multiprocessing |
33 |
- |
34 |
-MYP=${PN}-gpl-${PV} |
35 |
- |
36 |
-DESCRIPTION="Multi-Language Management" |
37 |
-HOMEPAGE="http://libre.adacore.com/" |
38 |
-SRC_URI=" |
39 |
- http://mirrors.cdn.adacore.com/art/591c45e2c7a447af2deecff7 |
40 |
- -> ${MYP}-src.tar.gz |
41 |
- http://mirrors.cdn.adacore.com/art/591aeb88c7a4473fcbb154f8 |
42 |
- -> xmlada-gpl-${PV}-src.tar.gz" |
43 |
-LICENSE="GPL-3" |
44 |
-SLOT="0" |
45 |
-KEYWORDS="~amd64 ~x86" |
46 |
-IUSE="" |
47 |
- |
48 |
-REQUIRED_USE="${ADA_REQUIRED_USE}" |
49 |
- |
50 |
-DEPEND="${ADA_DEPS}" |
51 |
-RDEPEND="${DEPEND}" |
52 |
- |
53 |
-S="${WORKDIR}"/${MYP}-src |
54 |
- |
55 |
-PATCHES=( |
56 |
- "${FILESDIR}"/${P}-gentoo.patch |
57 |
- "${FILESDIR}"/${P}-config.patch |
58 |
-) |
59 |
- |
60 |
-src_prepare() { |
61 |
- default |
62 |
- sed -i \ |
63 |
- -e "s:@VER@:${GCC_PV}:g" \ |
64 |
- share/gprconfig/compilers.xml \ |
65 |
- share/gprconfig/gnat.xml \ |
66 |
- share/gprconfig/c.xml \ |
67 |
- share/gprconfig/linker.xml \ |
68 |
- || die |
69 |
- sed -i \ |
70 |
- -e "s:@GNATBIND@:${GNATBIND}:g" \ |
71 |
- src/gprlib.adb \ |
72 |
- || die |
73 |
- if use ada_target_gnat_2016; then |
74 |
- sed -i \ |
75 |
- -e 's:"-no-pie", ::g' \ |
76 |
- share/gprconfig/linker.xml \ |
77 |
- || die |
78 |
- fi |
79 |
-} |
80 |
- |
81 |
-src_configure() { |
82 |
- emake prefix="${D}"/usr setup |
83 |
-} |
84 |
- |
85 |
-bin_progs="gprbuild gprconfig gprclean gprinstall gprname gprls" |
86 |
-lib_progs="gprlib gprbind" |
87 |
- |
88 |
-src_compile() { |
89 |
- local xmlada_src="../xmlada-gpl-${PV}-src" |
90 |
- incflags="-Isrc -Igpr/src -I${xmlada_src}/sax -I${xmlada_src}/dom \ |
91 |
- -I${xmlada_src}/schema -I${xmlada_src}/unicode \ |
92 |
- -I${xmlada_src}/input_sources" |
93 |
- ${GCC} -c ${CFLAGS} gpr/src/gpr_imports.c -o gpr_imports.o || die |
94 |
- for bin in ${bin_progs}; do |
95 |
- ${GNATMAKE} -j$(makeopts_jobs) ${incflags} $ADAFLAGS ${bin}-main \ |
96 |
- -o ${bin} -largs gpr_imports.o || die |
97 |
- done |
98 |
- for lib in $lib_progs; do |
99 |
- ${GNATMAKE} -j$(makeopts_jobs) ${incflags} ${lib} $ADAFLAGS \ |
100 |
- -largs gpr_imports.o || die |
101 |
- done |
102 |
-} |
103 |
- |
104 |
-src_install() { |
105 |
- dobin ${bin_progs} |
106 |
- exeinto /usr/libexec/gprbuild |
107 |
- doexe ${lib_progs} |
108 |
- insinto /usr/share/gprconfig |
109 |
- doins share/gprconfig/* |
110 |
- insinto /usr/share/gpr |
111 |
- doins share/_default.gpr |
112 |
- einstalldocs |
113 |
-} |
114 |
|
115 |
diff --git a/dev-ada/gprbuild/gprbuild-2019-r1.ebuild b/dev-ada/gprbuild/gprbuild-2019-r1.ebuild |
116 |
deleted file mode 100644 |
117 |
index 14f410a45c1..00000000000 |
118 |
--- a/dev-ada/gprbuild/gprbuild-2019-r1.ebuild |
119 |
+++ /dev/null |
120 |
@@ -1,81 +0,0 @@ |
121 |
-# Copyright 1999-2019 Gentoo Authors |
122 |
-# Distributed under the terms of the GNU General Public License v2 |
123 |
- |
124 |
-EAPI=7 |
125 |
- |
126 |
-ADA_COMPAT=( gnat_201{7,8,9} ) |
127 |
- |
128 |
-inherit ada toolchain-funcs multiprocessing |
129 |
- |
130 |
-MYP=${P}-20190517-194D8-src |
131 |
-XMLADA=xmlada-${PV}-20190429-19B9D-src |
132 |
- |
133 |
-DESCRIPTION="Multi-Language Management" |
134 |
-HOMEPAGE="http://libre.adacore.com/" |
135 |
-SRC_URI=" |
136 |
- http://mirrors.cdn.adacore.com/art/5cdf8e8031e87a8f1d425093 |
137 |
- -> ${MYP}.tar.gz |
138 |
- http://mirrors.cdn.adacore.com/art/5cdf916831e87a8f1d4250b5 |
139 |
- -> ${XMLADA}.tar.gz" |
140 |
-LICENSE="GPL-3" |
141 |
-SLOT="0" |
142 |
-KEYWORDS="~amd64 ~x86" |
143 |
-IUSE="" |
144 |
- |
145 |
-REQUIRED_USE="${ADA_REQUIRED_USE}" |
146 |
- |
147 |
-DEPEND="${ADA_DEPS}" |
148 |
-RDEPEND="${DEPEND}" |
149 |
- |
150 |
-S="${WORKDIR}"/${MYP} |
151 |
- |
152 |
-PATCHES=( "${FILESDIR}"/${P}-gentoo.patch ) |
153 |
- |
154 |
-src_prepare() { |
155 |
- default |
156 |
- sed -i \ |
157 |
- -e "s:@VER@:${GCC_PV}:g" \ |
158 |
- share/gprconfig/compilers.xml \ |
159 |
- share/gprconfig/gnat.xml \ |
160 |
- share/gprconfig/c.xml \ |
161 |
- share/gprconfig/linker.xml \ |
162 |
- || die |
163 |
- sed -i \ |
164 |
- -e "s:@GNATBIND@:${GNATBIND}:g" \ |
165 |
- src/gprlib.adb \ |
166 |
- || die |
167 |
-} |
168 |
- |
169 |
-src_configure() { |
170 |
- emake prefix="${D}"/usr setup |
171 |
-} |
172 |
- |
173 |
-bin_progs="gprbuild gprconfig gprclean gprinstall gprname gprls" |
174 |
-lib_progs="gprlib gprbind" |
175 |
- |
176 |
-src_compile() { |
177 |
- local xmlada_src="../${XMLADA}" |
178 |
- incflags="-Isrc -Igpr/src -I${xmlada_src}/sax -I${xmlada_src}/dom \ |
179 |
- -I${xmlada_src}/schema -I${xmlada_src}/unicode \ |
180 |
- -I${xmlada_src}/input_sources" |
181 |
- ${GCC} -c ${CFLAGS} gpr/src/gpr_imports.c -o gpr_imports.o || die |
182 |
- for bin in ${bin_progs}; do |
183 |
- ${GNATMAKE} -j$(makeopts_jobs) ${incflags} $ADAFLAGS ${bin}-main \ |
184 |
- -o ${bin} -largs gpr_imports.o || die |
185 |
- done |
186 |
- for lib in $lib_progs; do |
187 |
- ${GNATMAKE} -j$(makeopts_jobs) ${incflags} ${lib} $ADAFLAGS \ |
188 |
- -largs gpr_imports.o || die |
189 |
- done |
190 |
-} |
191 |
- |
192 |
-src_install() { |
193 |
- dobin ${bin_progs} |
194 |
- exeinto /usr/libexec/gprbuild |
195 |
- doexe ${lib_progs} |
196 |
- insinto /usr/share/gprconfig |
197 |
- doins share/gprconfig/* |
198 |
- insinto /usr/share/gpr |
199 |
- doins share/_default.gpr |
200 |
- einstalldocs |
201 |
-} |
202 |
|
203 |
diff --git a/dev-ada/libgpr/libgpr-2019-r1.ebuild b/dev-ada/libgpr/libgpr-2019-r1.ebuild |
204 |
deleted file mode 100644 |
205 |
index 01d8cf7cfbd..00000000000 |
206 |
--- a/dev-ada/libgpr/libgpr-2019-r1.ebuild |
207 |
+++ /dev/null |
208 |
@@ -1,60 +0,0 @@ |
209 |
-# Copyright 1999-2019 Gentoo Authors |
210 |
-# Distributed under the terms of the GNU General Public License v2 |
211 |
- |
212 |
-EAPI=7 |
213 |
- |
214 |
-ADA_COMPAT=( gnat_201{6,7,8,9} ) |
215 |
-inherit ada toolchain-funcs multiprocessing |
216 |
- |
217 |
-MYP=gprbuild-${PV}-20190517-194D8 |
218 |
- |
219 |
-DESCRIPTION="Ada library to handle GPRbuild project files" |
220 |
-HOMEPAGE="http://libre.adacore.com/" |
221 |
-SRC_URI="http://mirrors.cdn.adacore.com/art/5cdf8e8031e87a8f1d425093 |
222 |
- -> ${MYP}-src.tar.gz" |
223 |
-LICENSE="GPL-3" |
224 |
-SLOT="0" |
225 |
-KEYWORDS="~amd64 ~x86" |
226 |
-IUSE="+shared static-libs static-pic" |
227 |
- |
228 |
-RDEPEND="dev-ada/xmlada[shared?,static-libs?,static-pic?,${ADA_USEDEP}] |
229 |
- !net-libs/grpc" |
230 |
-DEPEND="${RDEPEND} |
231 |
- dev-ada/gprbuild[${ADA_USEDEP}]" |
232 |
-REQUIRED_USE="${ADA_REQUIRED_USE}" |
233 |
- |
234 |
-S="${WORKDIR}"/${MYP}-src |
235 |
- |
236 |
-src_configure() { |
237 |
- emake prefix="${D}"/usr setup |
238 |
-} |
239 |
- |
240 |
-src_compile() { |
241 |
- build () { |
242 |
- gprbuild -p -m -j$(makeopts_jobs) -XBUILD=production -v \ |
243 |
- -XLIBRARY_TYPE=$1 -XXMLADA_BUILD=$1 \ |
244 |
- gpr/gpr.gpr -cargs:C ${CFLAGS} -cargs:Ada ${ADAFLAGS} || die |
245 |
- } |
246 |
- if use shared; then |
247 |
- build relocatable |
248 |
- fi |
249 |
- if use static-libs; then |
250 |
- build static |
251 |
- fi |
252 |
- if use static-pic; then |
253 |
- build static-pic |
254 |
- fi |
255 |
-} |
256 |
- |
257 |
-src_install() { |
258 |
- if use static-libs; then |
259 |
- emake DESTDIR="${D}" libgpr.install.static |
260 |
- fi |
261 |
- for kind in shared static-pic; do |
262 |
- if use ${kind}; then |
263 |
- emake DESTDIR="${D}" libgpr.install.${kind} |
264 |
- fi |
265 |
- done |
266 |
- rm -r "${D}"/usr/share/gpr/manifests || die |
267 |
- einstalldocs |
268 |
-} |
269 |
|
270 |
diff --git a/dev-ada/xmlada/xmlada-2019-r1.ebuild b/dev-ada/xmlada/xmlada-2019-r1.ebuild |
271 |
deleted file mode 100644 |
272 |
index 994bc36f6f5..00000000000 |
273 |
--- a/dev-ada/xmlada/xmlada-2019-r1.ebuild |
274 |
+++ /dev/null |
275 |
@@ -1,80 +0,0 @@ |
276 |
-# Copyright 1999-2019 Gentoo Authors |
277 |
-# Distributed under the terms of the GNU General Public License v2 |
278 |
- |
279 |
-EAPI=7 |
280 |
- |
281 |
-ADA_COMPAT=( gnat_201{6,7,8,9} ) |
282 |
-inherit ada multiprocessing |
283 |
- |
284 |
-MYP=${P}-20190429-19B9D |
285 |
- |
286 |
-DESCRIPTION="Set of modules that provide a simple manipulation of XML streams" |
287 |
-HOMEPAGE="http://libre.adacore.com/" |
288 |
-SRC_URI="http://mirrors.cdn.adacore.com/art/5cdf916831e87a8f1d4250b5 |
289 |
- -> ${MYP}-src.tar.gz" |
290 |
- |
291 |
-LICENSE="GPL-3" |
292 |
-SLOT="0" |
293 |
-KEYWORDS="~amd64 ~x86" |
294 |
-IUSE="+shared static-libs static-pic" |
295 |
-REQUIRED_USE="|| ( shared static-libs static-pic ) |
296 |
- ${ADA_REQUIRED_USE}" |
297 |
- |
298 |
-RDEPEND="${ADA_DEPS}" |
299 |
-DEPEND="${RDEPEND} |
300 |
- dev-ada/gprbuild[${ADA_USEDEP}]" |
301 |
- |
302 |
-S="${WORKDIR}"/${MYP}-src |
303 |
- |
304 |
-PATCHES=( "${FILESDIR}"/${P}-gentoo.patch ) |
305 |
- |
306 |
-src_configure () { |
307 |
- econf --prefix="${D}"/usr |
308 |
-} |
309 |
- |
310 |
-src_compile () { |
311 |
- build () { |
312 |
- gprbuild -j$(makeopts_jobs) -m -p -v -XLIBRARY_TYPE=$1 \ |
313 |
- -XBUILD=Production -XPROCESSORS=$(makeopts_jobs) xmlada.gpr \ |
314 |
- -cargs ${ADAFLAGS} || die "gprbuild failed" |
315 |
- } |
316 |
- if use shared; then |
317 |
- build relocatable |
318 |
- fi |
319 |
- if use static-libs; then |
320 |
- build static |
321 |
- fi |
322 |
- if use static-pic; then |
323 |
- build static-pic |
324 |
- fi |
325 |
-} |
326 |
- |
327 |
-src_test() { |
328 |
- emake test |
329 |
- emake run_test | tee xmlada.testLog |
330 |
- grep -q DIFF xmlada.testLog && die |
331 |
-} |
332 |
- |
333 |
-src_install () { |
334 |
- build () { |
335 |
- gprinstall -XLIBRARY_TYPE=$1 -f -p -XBUILD=Production \ |
336 |
- -XPROCESSORS=$(makeopts_jobs) --prefix="${D}"/usr \ |
337 |
- --install-name=xmlada --build-var=LIBRARY_TYPE \ |
338 |
- --build-var=XMLADA_BUILD \ |
339 |
- --build-name=$1 xmlada.gpr || die "gprinstall failed" |
340 |
- } |
341 |
- if use shared; then |
342 |
- build relocatable |
343 |
- fi |
344 |
- if use static-libs; then |
345 |
- build static |
346 |
- fi |
347 |
- if use static-pic; then |
348 |
- build static-pic |
349 |
- fi |
350 |
- |
351 |
- einstalldocs |
352 |
- dodoc xmlada-roadmap.txt |
353 |
- rm -f "${D}"/usr/share/doc/${PN}/.buildinfo |
354 |
- rm -rf "${D}"/usr/share/gpr/manifests |
355 |
-} |
356 |
|
357 |
diff --git a/eclass/ada.eclass b/eclass/ada.eclass |
358 |
deleted file mode 100644 |
359 |
index 338b73bab86..00000000000 |
360 |
--- a/eclass/ada.eclass |
361 |
+++ /dev/null |
362 |
@@ -1,435 +0,0 @@ |
363 |
-# Copyright 2019 Gentoo Authors |
364 |
-# Distributed under the terms of the GNU General Public License v2 |
365 |
- |
366 |
-# @ECLASS: ada.eclass |
367 |
-# @MAINTAINER: |
368 |
-# Ada team <ada@g.o> |
369 |
-# @AUTHOR: |
370 |
-# Tupone Alfredo <tupone@g.o> |
371 |
-# @BLURB: An eclass for Ada packages |
372 |
-# @DESCRIPTION: |
373 |
-# This eclass set the IUSE and REQUIRED_USE to request the ADA_TARGET |
374 |
-# when the inheriting ebuild can be supported by more than one Ada |
375 |
-# implementation. It also set ADA_USEDEP and ADA_DEPS with a suitable form. |
376 |
-# A common eclass providing helper functions to build and install |
377 |
-# packages supporting Ada implementations. |
378 |
-# |
379 |
-# This eclass sets correct IUSE. Modification of REQUIRED_USE has to |
380 |
-# be done by the author of the ebuild (but ADA_REQUIRED_USE is |
381 |
-# provided for convenience, see below). ada exports ADA_DEPS |
382 |
-# and ADA_USEDEP so you can create correct dependencies for your |
383 |
-# package easily. |
384 |
-# |
385 |
-# Mostly copied from python-single-r1.eclass |
386 |
- |
387 |
-case "${EAPI:-0}" in |
388 |
- 0|1|2|3|4) |
389 |
- die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" |
390 |
- ;; |
391 |
- 5|6|7) |
392 |
- # EAPI=5 is required for sane USE_EXPAND dependencies |
393 |
- ;; |
394 |
- *) |
395 |
- die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" |
396 |
- ;; |
397 |
-esac |
398 |
- |
399 |
-EXPORT_FUNCTIONS pkg_setup |
400 |
- |
401 |
-# @ECLASS-VARIABLE: ADA_DEPS |
402 |
-# @DESCRIPTION: |
403 |
-# This is an eclass-generated Ada dependency string for all |
404 |
-# implementations listed in ADA_COMPAT. |
405 |
-# |
406 |
-# The dependency string is conditional on ADA_TARGET. |
407 |
-# |
408 |
-# Example use: |
409 |
-# @CODE |
410 |
-# RDEPEND="${ADA_DEPS} |
411 |
-# dev-foo/mydep" |
412 |
-# DEPEND="${RDEPEND}" |
413 |
-# @CODE |
414 |
-# |
415 |
- |
416 |
-# @ECLASS-VARIABLE: _ADA_ALL_IMPLS |
417 |
-# @INTERNAL |
418 |
-# @DESCRIPTION: |
419 |
-# All supported Ada implementations, most preferred last. |
420 |
-_ADA_ALL_IMPLS=( |
421 |
- gnat_2016 gnat_2017 gnat_2018 gnat_2019 |
422 |
-) |
423 |
-readonly _ADA_ALL_IMPLS |
424 |
- |
425 |
- |
426 |
-# @FUNCTION: _ada_impl_supported |
427 |
-# @USAGE: <impl> |
428 |
-# @INTERNAL |
429 |
-# @DESCRIPTION: |
430 |
-# Check whether the implementation <impl> (ADA_COMPAT-form) |
431 |
-# is still supported. |
432 |
-# |
433 |
-# Returns 0 if the implementation is valid and supported. If it is |
434 |
-# unsupported, returns 1 -- and the caller should ignore the entry. |
435 |
-# If it is invalid, dies with an appopriate error messages. |
436 |
-_ada_impl_supported() { |
437 |
- debug-print-function ${FUNCNAME} "${@}" |
438 |
- |
439 |
- [[ ${#} -eq 1 ]] || die "${FUNCNAME}: takes exactly 1 argument (impl)." |
440 |
- |
441 |
- local impl=${1} |
442 |
- |
443 |
- # keep in sync with _ADA_ALL_IMPLS! |
444 |
- # (not using that list because inline patterns shall be faster) |
445 |
- case "${impl}" in |
446 |
- gnat_201[6789]) |
447 |
- return 0 |
448 |
- ;; |
449 |
- *) |
450 |
- [[ ${ADA_COMPAT_NO_STRICT} ]] && return 1 |
451 |
- die "Invalid implementation in ADA_COMPAT: ${impl}" |
452 |
- esac |
453 |
-} |
454 |
- |
455 |
-# @FUNCTION: _ada_set_impls |
456 |
-# @INTERNAL |
457 |
-# @DESCRIPTION: |
458 |
-# Check ADA_COMPAT for well-formedness and validity, then set |
459 |
-# two global variables: |
460 |
-# |
461 |
-# - _ADA_SUPPORTED_IMPLS containing valid implementations supported |
462 |
-# by the ebuild (ADA_COMPAT - dead implementations), |
463 |
-# |
464 |
-# - and _ADA_UNSUPPORTED_IMPLS containing valid implementations that |
465 |
-# are not supported by the ebuild. |
466 |
-# |
467 |
-# Implementations in both variables are ordered using the pre-defined |
468 |
-# eclass implementation ordering. |
469 |
-# |
470 |
-# This function must be called once in global scope by an eclass |
471 |
-# utilizing ADA_COMPAT. |
472 |
-_ada_set_impls() { |
473 |
- local i |
474 |
- |
475 |
- if ! declare -p ADA_COMPAT &>/dev/null; then |
476 |
- die 'ADA_COMPAT not declared.' |
477 |
- fi |
478 |
- if [[ $(declare -p ADA_COMPAT) != "declare -a"* ]]; then |
479 |
- die 'ADA_COMPAT must be an array.' |
480 |
- fi |
481 |
- for i in "${ADA_COMPAT[@]}"; do |
482 |
- # trigger validity checks |
483 |
- _ada_impl_supported "${i}" |
484 |
- done |
485 |
- |
486 |
- local supp=() unsupp=() |
487 |
- |
488 |
- for i in "${_ADA_ALL_IMPLS[@]}"; do |
489 |
- if has "${i}" "${ADA_COMPAT[@]}"; then |
490 |
- supp+=( "${i}" ) |
491 |
- else |
492 |
- unsupp+=( "${i}" ) |
493 |
- fi |
494 |
- done |
495 |
- if [[ ! ${supp[@]} ]]; then |
496 |
- die "No supported implementation in ADA_COMPAT." |
497 |
- fi |
498 |
- |
499 |
- if [[ ${_ADA_SUPPORTED_IMPLS[@]} ]]; then |
500 |
- # set once already, verify integrity |
501 |
- if [[ ${_ADA_SUPPORTED_IMPLS[@]} != ${supp[@]} ]]; then |
502 |
- eerror "Supported impls (ADA_COMPAT) changed between inherits!" |
503 |
- eerror "Before: ${_ADA_SUPPORTED_IMPLS[*]}" |
504 |
- eerror "Now : ${supp[*]}" |
505 |
- die "_ADA_SUPPORTED_IMPLS integrity check failed" |
506 |
- fi |
507 |
- if [[ ${_ADA_UNSUPPORTED_IMPLS[@]} != ${unsupp[@]} ]]; then |
508 |
- eerror "Unsupported impls changed between inherits!" |
509 |
- eerror "Before: ${_ADA_UNSUPPORTED_IMPLS[*]}" |
510 |
- eerror "Now : ${unsupp[*]}" |
511 |
- die "_ADA_UNSUPPORTED_IMPLS integrity check failed" |
512 |
- fi |
513 |
- else |
514 |
- _ADA_SUPPORTED_IMPLS=( "${supp[@]}" ) |
515 |
- _ADA_UNSUPPORTED_IMPLS=( "${unsupp[@]}" ) |
516 |
- readonly _ADA_SUPPORTED_IMPLS _ADA_UNSUPPORTED_IMPLS |
517 |
- fi |
518 |
-} |
519 |
- |
520 |
-# @FUNCTION: ada_export |
521 |
-# @USAGE: [<impl>] <variables>... |
522 |
-# @DESCRIPTION: |
523 |
-# Set and export the Ada implementation-relevant variables passed |
524 |
-# as parameters. |
525 |
-# |
526 |
-# The optional first parameter may specify the requested Ada |
527 |
-# implementation (either as ADA_TARGETS value, e.g. ada2_7, |
528 |
-# or an EADA one, e.g. ada2.7). If no implementation passed, |
529 |
-# the current one will be obtained from ${EADA}. |
530 |
-# |
531 |
-# The variables which can be exported are: GCC, EADA, GNATMAKE. |
532 |
-# They are described more completely in the eclass |
533 |
-# variable documentation. |
534 |
-ada_export() { |
535 |
- debug-print-function ${FUNCNAME} "${@}" |
536 |
- |
537 |
- local impl var |
538 |
- |
539 |
- case "${1}" in |
540 |
- gnat_201[6789]) |
541 |
- impl=${1} |
542 |
- shift |
543 |
- ;; |
544 |
- *) |
545 |
- impl=${EADA} |
546 |
- if [[ -z ${impl} ]]; then |
547 |
- die "ada_export called without a ada implementation and EADA is unset" |
548 |
- fi |
549 |
- ;; |
550 |
- esac |
551 |
- debug-print "${FUNCNAME}: implementation: ${impl}" |
552 |
- |
553 |
- local gcc_pv |
554 |
- case "${impl}" in |
555 |
- gnat_2016) |
556 |
- gcc_pv=4.9.4 |
557 |
- ;; |
558 |
- gnat_2017) |
559 |
- gcc_pv=6.3.0 |
560 |
- ;; |
561 |
- gnat_2018) |
562 |
- gcc_pv=7.3.1 |
563 |
- ;; |
564 |
- gnat_2019) |
565 |
- gcc_pv=8.3.1 |
566 |
- ;; |
567 |
- *) |
568 |
- gcc_pv="9.9.9" |
569 |
- ;; |
570 |
- esac |
571 |
- |
572 |
- for var; do |
573 |
- case "${var}" in |
574 |
- EADA) |
575 |
- export EADA=${impl} |
576 |
- debug-print "${FUNCNAME}: EADA = ${EADA}" |
577 |
- ;; |
578 |
- GCC) |
579 |
- export GCC=${EPREFIX}/usr/bin/gcc-${gcc_pv} |
580 |
- debug-print "${FUNCNAME}: GCC = ${GCC}" |
581 |
- ;; |
582 |
- GCC_PV) |
583 |
- export GCC_PV=${gcc_pv} |
584 |
- debug-print "${FUNCNAME}: GCC_PV = ${GCC_PV}" |
585 |
- ;; |
586 |
- GNATBIND) |
587 |
- export GNATBIND=${EPREFIX}/usr/bin/gnatbind-${gcc_pv} |
588 |
- debug-print "${FUNCNAME}: GNATBIND = ${GNATBIND}" |
589 |
- ;; |
590 |
- GNATMAKE) |
591 |
- export GNATMAKE=${EPREFIX}/usr/bin/gnatmake-${gcc_pv} |
592 |
- debug-print "${FUNCNAME}: GNATMAKE = ${GNATMAKE}" |
593 |
- ;; |
594 |
- GNATLS) |
595 |
- export GNATLS=${EPREFIX}/usr/bin/gnatls-${gcc_pv} |
596 |
- debug-print "${FUNCNAME}: GNATLS = ${GNATLS}" |
597 |
- ;; |
598 |
- ADA_PKG_DEP) |
599 |
- ADA_PKG_DEP="dev-lang/gnat-gpl:${gcc_pv}" |
600 |
- |
601 |
- # use-dep |
602 |
- if [[ ${ADA_REQ_USE} ]]; then |
603 |
- ADA_PKG_DEP+=[${ADA_REQ_USE}] |
604 |
- fi |
605 |
- |
606 |
- export ADA_PKG_DEP |
607 |
- debug-print "${FUNCNAME}: ADA_PKG_DEP = ${ADA_PKG_DEP}" |
608 |
- ;; |
609 |
- *) |
610 |
- die "ada_export: unknown variable ${var}" |
611 |
- esac |
612 |
- done |
613 |
-} |
614 |
- |
615 |
-_ada_single_set_globals() { |
616 |
- _ada_set_impls |
617 |
- local i ADA_PKG_DEP |
618 |
- |
619 |
- local flags=( "${_ADA_SUPPORTED_IMPLS[@]/#/ada_target_}" ) |
620 |
- local unflags=( "${_ADA_UNSUPPORTED_IMPLS[@]/#/-ada_target_}" ) |
621 |
- local allflags=( ${flags[@]} ${unflags[@]} ) |
622 |
- |
623 |
- local optflags=${flags[@]/%/(-)?} |
624 |
- |
625 |
- IUSE="${allflags[*]}" |
626 |
- |
627 |
- if [[ ${#_ADA_UNSUPPORTED_IMPLS[@]} -gt 0 ]]; then |
628 |
- optflags+=,${unflags[@]/%/(-)} |
629 |
- fi |
630 |
- |
631 |
- local deps requse usedep |
632 |
- if [[ ${#_ADA_SUPPORTED_IMPLS[@]} -eq 1 ]]; then |
633 |
- # There is only one supported implementation; set IUSE and other |
634 |
- # variables without ADA_SINGLE_TARGET. |
635 |
- requse=${flags[*]} |
636 |
- ada_export "${_ADA_SUPPORTED_IMPLS[0]}" ADA_PKG_DEP |
637 |
- deps="${flags[*]}? ( ${ADA_PKG_DEP} ) " |
638 |
- else |
639 |
- # Multiple supported implementations; honor ADA_TARGET. |
640 |
- requse="^^ ( ${flags[*]} )" |
641 |
- |
642 |
- for i in "${_ADA_SUPPORTED_IMPLS[@]}"; do |
643 |
- ada_export "${i}" ADA_PKG_DEP |
644 |
- deps+="ada_target_${i}? ( ${ADA_PKG_DEP} ) " |
645 |
- done |
646 |
- fi |
647 |
- usedep=${optflags// /,} |
648 |
- if [[ ${ADA_DEPS+1} ]]; then |
649 |
- if [[ ${ADA_DEPS} != "${deps}" ]]; then |
650 |
- eerror "ADA_DEPS have changed between inherits (ADA_REQ_USE?)!" |
651 |
- eerror "Before: ${ADA_DEPS}" |
652 |
- eerror "Now : ${deps}" |
653 |
- die "ADA_DEPS integrity check failed" |
654 |
- fi |
655 |
- |
656 |
- # these two are formality -- they depend on ADA_COMPAT only |
657 |
- if [[ ${ADA_REQUIRED_USE} != ${requse} ]]; then |
658 |
- eerror "ADA_REQUIRED_USE have changed between inherits!" |
659 |
- eerror "Before: ${ADA_REQUIRED_USE}" |
660 |
- eerror "Now : ${requse}" |
661 |
- die "ADA_REQUIRED_USE integrity check failed" |
662 |
- fi |
663 |
- |
664 |
- if [[ ${ADA_USEDEP} != "${usedep}" ]]; then |
665 |
- eerror "ADA_USEDEP have changed between inherits!" |
666 |
- eerror "Before: ${ADA_USEDEP}" |
667 |
- eerror "Now : ${usedep}" |
668 |
- die "ADA_USEDEP integrity check failed" |
669 |
- fi |
670 |
- else |
671 |
- ADA_DEPS=${deps} |
672 |
- ADA_REQUIRED_USE=${requse} |
673 |
- ADA_USEDEP=${usedep} |
674 |
- readonly ADA_DEPS ADA_REQUIRED_USE ADA_USEDEP |
675 |
- fi |
676 |
-} |
677 |
-_ada_single_set_globals |
678 |
-unset -f _ada_single_set_globals |
679 |
- |
680 |
-# @FUNCTION: ada_wrapper_setup |
681 |
-# @USAGE: [<path> [<impl>]] |
682 |
-# @DESCRIPTION: |
683 |
-# Create proper 'ada' executable wrappers |
684 |
-# in the directory named by <path>. Set up PATH |
685 |
-# appropriately. <path> defaults to ${T}/${EADA}. |
686 |
-# |
687 |
-# The wrappers will be created for implementation named by <impl>, |
688 |
-# or for one named by ${EADA} if no <impl> passed. |
689 |
-# |
690 |
-# If the named directory contains a ada symlink already, it will |
691 |
-# be assumed to contain proper wrappers already and only environment |
692 |
-# setup will be done. If wrapper update is requested, the directory |
693 |
-# shall be removed first. |
694 |
-ada_wrapper_setup() { |
695 |
- debug-print-function ${FUNCNAME} "${@}" |
696 |
- |
697 |
- local workdir=${1:-${T}/${EADA}} |
698 |
- local impl=${2:-${EADA}} |
699 |
- |
700 |
- [[ ${workdir} ]] || die "${FUNCNAME}: no workdir specified." |
701 |
- [[ ${impl} ]] || die "${FUNCNAME}: no impl nor EADA specified." |
702 |
- |
703 |
- if [[ ! -x ${workdir}/bin/gnatmake ]]; then |
704 |
- mkdir -p "${workdir}"/bin || die |
705 |
- |
706 |
- local GCC GNATMAKE GNATLS GNATBIND |
707 |
- ada_export "${impl}" GCC GNATMAKE GNATLS GNATBIND |
708 |
- |
709 |
- # Ada compiler |
710 |
- cat > "${workdir}/bin/gcc" <<-_EOF_ || die |
711 |
- #!/bin/sh |
712 |
- exec "${GCC}" "\${@}" |
713 |
- _EOF_ |
714 |
- chmod a+x "${workdir}/bin/gcc" |
715 |
- cat > "${workdir}/bin/gnatmake" <<-_EOF_ || die |
716 |
- #!/bin/sh |
717 |
- exec "${GNATMAKE}" "\${@}" |
718 |
- _EOF_ |
719 |
- chmod a+x "${workdir}/bin/gnatmake" |
720 |
- cat > "${workdir}/bin/gnatls" <<-_EOF_ || die |
721 |
- #!/bin/sh |
722 |
- exec "${GNATLS}" "\${@}" |
723 |
- _EOF_ |
724 |
- chmod a+x "${workdir}/bin/gnatls" |
725 |
- cat > "${workdir}/bin/gnatbind" <<-_EOF_ || die |
726 |
- #!/bin/sh |
727 |
- exec "${GNATBIND}" "\${@}" |
728 |
- _EOF_ |
729 |
- chmod a+x "${workdir}/bin/gnatbind" |
730 |
- fi |
731 |
- |
732 |
- # Now, set the environment. |
733 |
- # But note that ${workdir} may be shared with something else, |
734 |
- # and thus already on top of PATH. |
735 |
- if [[ ${PATH##:*} != ${workdir}/bin ]]; then |
736 |
- PATH=${workdir}/bin${PATH:+:${PATH}} |
737 |
- fi |
738 |
- export PATH |
739 |
-} |
740 |
- |
741 |
-# @FUNCTION: ada_setup |
742 |
-# @DESCRIPTION: |
743 |
-# Determine what the selected Ada implementation is and set |
744 |
-# the Ada build environment up for it. |
745 |
-ada_setup() { |
746 |
- debug-print-function ${FUNCNAME} "${@}" |
747 |
- |
748 |
- unset EADA |
749 |
- |
750 |
- if [[ ${#_ADA_SUPPORTED_IMPLS[@]} -eq 1 ]]; then |
751 |
- if use "ada_targets_${_ADA_SUPPORTED_IMPLS[0]}"; then |
752 |
- # Only one supported implementation, enable it explicitly |
753 |
- ada_export "${_ADA_SUPPORTED_IMPLS[0]}" EADA GCC GCC_PV GNATMAKE |
754 |
- ada_wrapper_setup |
755 |
- fi |
756 |
- else |
757 |
- local impl |
758 |
- for impl in "${_ADA_SUPPORTED_IMPLS[@]}"; do |
759 |
- if use "ada_target_${impl}"; then |
760 |
- if [[ ${EADA} ]]; then |
761 |
- eerror "Your ADA_TARGET setting lists more than a single Ada" |
762 |
- eerror "implementation. Please set it to just one value. If you need" |
763 |
- eerror "to override the value for a single package, please use package.env" |
764 |
- eerror "or an equivalent solution (man 5 portage)." |
765 |
- echo |
766 |
- die "More than one implementation in ADA_TARGET." |
767 |
- fi |
768 |
- |
769 |
- ada_export "${impl}" EADA GCC GCC_PV GNATMAKE |
770 |
- ada_wrapper_setup |
771 |
- fi |
772 |
- done |
773 |
- fi |
774 |
- |
775 |
- if [[ ! ${EADA} ]]; then |
776 |
- eerror "No Ada implementation selected for the build. Please set" |
777 |
- if [[ ${#_ADA_SUPPORTED_IMPLS[@]} -eq 1 ]]; then |
778 |
- eerror "the ADA_TARGETS variable in your make.conf to include one" |
779 |
- else |
780 |
- eerror "the ADA_SINGLE_TARGET variable in your make.conf to one" |
781 |
- fi |
782 |
- eerror "of the following values:" |
783 |
- eerror |
784 |
- eerror "${_ADA_SUPPORTED_IMPLS[@]}" |
785 |
- echo |
786 |
- die "No supported Ada implementation in ADA_SINGLE_TARGET/ADA_TARGETS." |
787 |
- fi |
788 |
-} |
789 |
- |
790 |
-# @FUNCTION: ada_pkg_setup |
791 |
-# @DESCRIPTION: |
792 |
-# Runs ada_setup. |
793 |
-ada_pkg_setup() { |
794 |
- debug-print-function ${FUNCNAME} "${@}" |
795 |
- |
796 |
- [[ ${MERGE_TYPE} != binary ]] && ada_setup |
797 |
-} |