1 |
commit: 9b68e919265c0faa088b7582fd7febff9fb9915f |
2 |
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Feb 2 09:13:07 2023 +0000 |
4 |
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Feb 2 09:20:34 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b68e919 |
7 |
|
8 |
ada.eclass: add ada_target_gcc_12 USE flag |
9 |
|
10 |
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org> |
11 |
|
12 |
eclass/ada.eclass | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- |
13 |
1 file changed, 58 insertions(+), 2 deletions(-) |
14 |
|
15 |
diff --git a/eclass/ada.eclass b/eclass/ada.eclass |
16 |
index 98f00972c54c..39f76854e4fc 100644 |
17 |
--- a/eclass/ada.eclass |
18 |
+++ b/eclass/ada.eclass |
19 |
@@ -1,4 +1,4 @@ |
20 |
-# Copyright 2019-2022 Gentoo Authors |
21 |
+# Copyright 2019-2023 Gentoo Authors |
22 |
# Distributed under the terms of the GNU General Public License v2 |
23 |
|
24 |
# @ECLASS: ada.eclass |
25 |
@@ -45,16 +45,58 @@ EXPORT_FUNCTIONS pkg_setup |
26 |
# DEPEND="${RDEPEND}" |
27 |
# @CODE |
28 |
# |
29 |
+# Example value: |
30 |
+# @CODE |
31 |
+# ada_target_gcc_12? ( sys-devel/gcc:12[ada] ) |
32 |
+# ada_target_gnat_2021? ( dev-lang/gnat-gps:2021[ada] ) |
33 |
+# @CODE |
34 |
|
35 |
# @ECLASS_VARIABLE: _ADA_ALL_IMPLS |
36 |
# @INTERNAL |
37 |
# @DESCRIPTION: |
38 |
# All supported Ada implementations, most preferred last. |
39 |
_ADA_ALL_IMPLS=( |
40 |
- gnat_2021 gcc_12_2_0 |
41 |
+ gnat_2021 gcc_12_2_0 gcc_12 |
42 |
) |
43 |
readonly _ADA_ALL_IMPLS |
44 |
|
45 |
+# @ECLASS_VARIABLE: ADA_REQUIRED_USE |
46 |
+# @OUTPUT_VARIABLE |
47 |
+# @DESCRIPTION: |
48 |
+# This is an eclass-generated required-use expression which ensures |
49 |
+# that exactly one ADA_TARGET value has been enabled. |
50 |
+# |
51 |
+# This expression should be utilized in an ebuild by including it in |
52 |
+# REQUIRED_USE, optionally behind a use flag. |
53 |
+# |
54 |
+# Example use: |
55 |
+# @CODE |
56 |
+# REQUIRED_USE="ada? ( ${ADA_REQUIRED_USE} )" |
57 |
+# @CODE |
58 |
+# |
59 |
+# Example value: |
60 |
+# @CODE |
61 |
+# ^^ ( ada_target_gnat_2021 ada_target_gcc_12 ) |
62 |
+# @CODE |
63 |
+ |
64 |
+# @ECLASS_VARIABLE: ADA_USEDEP |
65 |
+# @OUTPUT_VARIABLE |
66 |
+# @DESCRIPTION: |
67 |
+# This is a placeholder variable, |
68 |
+# in order to depend on ada packages built for the same ada |
69 |
+# implementations. |
70 |
+# |
71 |
+# Example use: |
72 |
+# @CODE |
73 |
+# RDEPEND="$(ada_gen_cond_dep ' |
74 |
+# dev-ada/foo[${ADA_USEDEP}] |
75 |
+# ')" |
76 |
+# @CODE |
77 |
+# |
78 |
+# Example value: |
79 |
+# @CODE |
80 |
+# ada_targets_gcc_12(-) |
81 |
+# @CODE |
82 |
|
83 |
# @FUNCTION: _ada_impl_supported |
84 |
# @USAGE: <impl> |
85 |
@@ -82,6 +124,9 @@ _ada_impl_supported() { |
86 |
gcc_12_2_0) |
87 |
return 0 |
88 |
;; |
89 |
+ gcc_12) |
90 |
+ return 0 |
91 |
+ ;; |
92 |
*) |
93 |
[[ ${ADA_COMPAT_NO_STRICT} ]] && return 1 |
94 |
die "Invalid implementation in ADA_COMPAT: ${impl}" |
95 |
@@ -181,6 +226,10 @@ ada_export() { |
96 |
impl=${1} |
97 |
shift |
98 |
;; |
99 |
+ gcc_12) |
100 |
+ impl=${1} |
101 |
+ shift |
102 |
+ ;; |
103 |
*) |
104 |
impl=${EADA} |
105 |
if [[ -z ${impl} ]]; then |
106 |
@@ -201,6 +250,10 @@ ada_export() { |
107 |
gcc_pv=12.2.0 |
108 |
slot=12 |
109 |
;; |
110 |
+ gcc_12) |
111 |
+ gcc_pv=12 |
112 |
+ slot=12 |
113 |
+ ;; |
114 |
*) |
115 |
gcc_pv="9.9.9" |
116 |
slot=9.9.9 |
117 |
@@ -250,6 +303,9 @@ ada_export() { |
118 |
gnat_2021) |
119 |
ADA_PKG_DEP="dev-lang/gnat-gpl:${slot}[ada]" |
120 |
;; |
121 |
+ gcc_12) |
122 |
+ ADA_PKG_DEP="sys-devel/gcc:${slot}[ada]" |
123 |
+ ;; |
124 |
*) |
125 |
ADA_PKG_DEP="=sys-devel/gcc-${gcc_pv}*[ada]" |
126 |
;; |