commit:     9b68e919265c0faa088b7582fd7febff9fb9915f
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Thu Feb  2 09:13:07 2023 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Thu Feb  2 09:20:34 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b68e919

ada.eclass: add ada_target_gcc_12 USE flag

Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 eclass/ada.eclass | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 58 insertions(+), 2 deletions(-)

diff --git a/eclass/ada.eclass b/eclass/ada.eclass
index 98f00972c54c..39f76854e4fc 100644
--- a/eclass/ada.eclass
+++ b/eclass/ada.eclass
@@ -1,4 +1,4 @@
-# Copyright 2019-2022 Gentoo Authors
+# Copyright 2019-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: ada.eclass
@@ -45,16 +45,58 @@ EXPORT_FUNCTIONS pkg_setup
 # DEPEND="${RDEPEND}"
 # @CODE
 #
+# Example value:
+# @CODE
+# ada_target_gcc_12? ( sys-devel/gcc:12[ada] )
+# ada_target_gnat_2021? ( dev-lang/gnat-gps:2021[ada] )
+# @CODE
 
 # @ECLASS_VARIABLE: _ADA_ALL_IMPLS
 # @INTERNAL
 # @DESCRIPTION:
 # All supported Ada implementations, most preferred last.
 _ADA_ALL_IMPLS=(
-       gnat_2021 gcc_12_2_0
+       gnat_2021 gcc_12_2_0 gcc_12
 )
 readonly _ADA_ALL_IMPLS
 
+# @ECLASS_VARIABLE: ADA_REQUIRED_USE
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# This is an eclass-generated required-use expression which ensures
+# that exactly one ADA_TARGET value has been enabled.
+#
+# This expression should be utilized in an ebuild by including it in
+# REQUIRED_USE, optionally behind a use flag.
+#
+# Example use:
+# @CODE
+# REQUIRED_USE="ada? ( ${ADA_REQUIRED_USE} )"
+# @CODE
+#
+# Example value:
+# @CODE
+# ^^ ( ada_target_gnat_2021 ada_target_gcc_12 )
+# @CODE
+
+# @ECLASS_VARIABLE: ADA_USEDEP
+# @OUTPUT_VARIABLE
+# @DESCRIPTION:
+# This is a placeholder variable,
+# in order to depend on ada packages built for the same ada
+# implementations.
+#
+# Example use:
+# @CODE
+# RDEPEND="$(ada_gen_cond_dep '
+#     dev-ada/foo[${ADA_USEDEP}]
+#   ')"
+# @CODE
+#
+# Example value:
+# @CODE
+# ada_targets_gcc_12(-)
+# @CODE
 
 # @FUNCTION: _ada_impl_supported
 # @USAGE: <impl>
@@ -82,6 +124,9 @@ _ada_impl_supported() {
                gcc_12_2_0)
                        return 0
                        ;;
+               gcc_12)
+                       return 0
+                       ;;
                *)
                        [[ ${ADA_COMPAT_NO_STRICT} ]] && return 1
                        die "Invalid implementation in ADA_COMPAT: ${impl}"
@@ -181,6 +226,10 @@ ada_export() {
                        impl=${1}
                        shift
                        ;;
+               gcc_12)
+                       impl=${1}
+                       shift
+                       ;;
                *)
                        impl=${EADA}
                        if [[ -z ${impl} ]]; then
@@ -201,6 +250,10 @@ ada_export() {
                        gcc_pv=12.2.0
                        slot=12
                        ;;
+               gcc_12)
+                       gcc_pv=12
+                       slot=12
+                       ;;
                *)
                        gcc_pv="9.9.9"
                        slot=9.9.9
@@ -250,6 +303,9 @@ ada_export() {
                                        gnat_2021)
                                                
ADA_PKG_DEP="dev-lang/gnat-gpl:${slot}[ada]"
                                                ;;
+                                       gcc_12)
+                                               
ADA_PKG_DEP="sys-devel/gcc:${slot}[ada]"
+                                               ;;
                                        *)
                                                
ADA_PKG_DEP="=sys-devel/gcc-${gcc_pv}*[ada]"
                                                ;;

Reply via email to