* [gentoo-dev] Ada eclass support for gcc_12.2.0
@ 2022-09-15 7:07 Alfredo Tupone
0 siblings, 0 replies; only message in thread
From: Alfredo Tupone @ 2022-09-15 7:07 UTC (permalink / raw
To: gentoo-dev
I would like to share the incoming changes to ada eclass to add support
to sys-devel/gcc-12.2.0
One change is to not depend on gcc SLOT like for gnat the dependency in
on dev-lang/gnat-gpl SLOT, as gcc slot is 12 but the eclass need to
point to (eg.) gnatbind-12.2.0. Maybe in the future we could add
SUBSLOT to gcc.
So the dependency now is against gcc-12.2.0*
The other changes are trivial
Alfredo
diff --git a/eclass/ada.eclass b/eclass/ada.eclass
index 0bf3dcfe41cc..e6027e38393b 100644
--- a/eclass/ada.eclass
+++ b/eclass/ada.eclass
@@ -46,58 +46,61 @@ EXPORT_FUNCTIONS pkg_setup
# The dependency string is conditional on ADA_TARGET.
#
# Example use:
# @CODE
# RDEPEND="${ADA_DEPS}
# dev-foo/mydep"
# DEPEND="${RDEPEND}"
# @CODE
#
# @ECLASS_VARIABLE: _ADA_ALL_IMPLS
# @INTERNAL
# @DESCRIPTION:
# All supported Ada implementations, most preferred last.
_ADA_ALL_IMPLS=(
- gnat_2020 gnat_2021
+ gnat_2020 gnat_2021 gcc_12_2_0
)
readonly _ADA_ALL_IMPLS
# @FUNCTION: _ada_impl_supported
# @USAGE: <impl>
# @INTERNAL
# @DESCRIPTION:
# Check whether the implementation <impl> (ADA_COMPAT-form)
# is still supported.
#
# Returns 0 if the implementation is valid and supported. If it is
# unsupported, returns 1 -- and the caller should ignore the entry.
# If it is invalid, dies with an appopriate error messages.
_ada_impl_supported() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${#} -eq 1 ]] || die "${FUNCNAME}: takes exactly 1 argument (impl)."
local impl=${1}
# keep in sync with _ADA_ALL_IMPLS!
# (not using that list because inline patterns shall be faster)
case "${impl}" in
gnat_202[01])
return 0
;;
+ gcc_12_2_0)
+ return 0
+ ;;
*)
[[ ${ADA_COMPAT_NO_STRICT} ]] && return 1
die "Invalid implementation in ADA_COMPAT: ${impl}"
esac
}
# @FUNCTION: _ada_set_impls
# @INTERNAL
# @DESCRIPTION:
# Check ADA_COMPAT for well-formedness and validity, then set
# two global variables:
#
# - _ADA_SUPPORTED_IMPLS containing valid implementations supported
# by the ebuild (ADA_COMPAT - dead implementations),
#
@@ -169,50 +172,58 @@ _ada_set_impls() {
# the current one will be obtained from ${EADA}.
#
# The variables which can be exported are: GCC, EADA, GNATMAKE.
# They are described more completely in the eclass
# variable documentation.
ada_export() {
debug-print-function ${FUNCNAME} "${@}"
local impl var
case "${1}" in
gnat_202[01])
impl=${1}
shift
;;
+ gcc_12_2_0)
+ impl=${1}
+ shift
+ ;;
*)
impl=${EADA}
if [[ -z ${impl} ]]; then
die "ada_export called without a ada implementation and EADA is unset"
fi
;;
esac
debug-print "${FUNCNAME}: implementation: ${impl}"
local gcc_pv
local slot
case "${impl}" in
gnat_2020)
gcc_pv=9.3.1
slot=9.3.1
;;
gnat_2021)
gcc_pv=10.3.1
slot=10
;;
+ gcc_12_2_0)
+ gcc_pv=12.2.0
+ slot=12
+ ;;
*)
gcc_pv="9.9.9"
slot=9.9.9
;;
esac
for var; do
case "${var}" in
EADA)
export EADA=${impl}
debug-print "${FUNCNAME}: EADA = ${EADA}"
;;
GCC)
export GCC=${EPREFIX}/usr/bin/gcc-${gcc_pv}
debug-print "${FUNCNAME}: GCC = ${GCC}"
@@ -234,31 +245,38 @@ ada_export() {
debug-print "${FUNCNAME}: GNATMAKE = ${GNATMAKE}"
;;
GNATLS)
export GNATLS=${EPREFIX}/usr/bin/gnatls-${gcc_pv}
debug-print "${FUNCNAME}: GNATLS = ${GNATLS}"
;;
GNATPREP)
export GNATPREP=${EPREFIX}/usr/bin/gnatprep-${gcc_pv}
debug-print "${FUNCNAME}: GNATPREP = ${GNATPREP}"
;;
GNATCHOP)
export GNATCHOP=${EPREFIX}/usr/bin/gnatchop-${gcc_pv}
debug-print "${FUNCNAME}: GNATCHOP = ${GNATCHOP}"
;;
ADA_PKG_DEP)
- ADA_PKG_DEP="dev-lang/gnat-gpl:${slot}[ada]"
+ case "${impl}" in
+ gnat_202[01])
+ ADA_PKG_DEP="dev-lang/gnat-gpl:${slot}[ada]"
+ ;;
+ *)
+ ADA_PKG_DEP="=sys-devel/gcc-${gcc_pv}*[ada]"
+ ;;
+ esac
# use-dep
if [[ ${ADA_REQ_USE} ]]; then
ADA_PKG_DEP+=[${ADA_REQ_USE}]
fi
export ADA_PKG_DEP
debug-print "${FUNCNAME}: ADA_PKG_DEP = ${ADA_PKG_DEP}"
;;
*)
die "ada_export: unknown variable ${var}"
esac
done
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-09-15 7:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-15 7:07 [gentoo-dev] Ada eclass support for gcc_12.2.0 Alfredo Tupone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox