commit:     c49986f4fd69ee13405ed95c7d351ce9c9931879
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 17 05:27:36 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 17 05:30:30 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c49986f4

toolchain.eclass: simplify dependency specification for USE=ada or USE=d

This ends up both being simpler to read but also helps Portage in two
ways:
1) not wasting backtracking cycles on it, and
2) pulling in unnecessary slots, allowing a shortcut to be taken with
   ada-bootstrap or older gcc.

Bug: https://bugs.gentoo.org/947587
Bug: https://bugs.gentoo.org/950310
Thanks-to: Zac Medico <zmedico <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/toolchain.eclass | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 10e31a202c3a..493712af37f7 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -431,9 +431,8 @@ if [[ ${PN} != gnat-gpl ]] && tc_has_feature ada ; then
                BDEPEND+="
                        ada? (
                                || (
-                                       <sys-devel/gcc-${SLOT}[ada]
+                                       <sys-devel/gcc-$((${SLOT} + 1))[ada]
                                        <dev-lang/ada-bootstrap-$((${SLOT} + 1))
-                                       sys-devel/gcc:${SLOT}[ada]
                                )
                        )
                "
@@ -456,7 +455,7 @@ if tc_has_feature d && tc_version_is_at_least 12.0 ; then
        # D in 12+ is self-hosting and needs D to bootstrap.
        # TODO: package some binary we can use, like for Ada
        # bug #840182
-       BDEPEND+=" d? ( || ( <sys-devel/gcc-${SLOT}[d(-)] 
<sys-devel/gcc-12[d(-)] sys-devel/gcc:${SLOT}[d(-)] ) )"
+       BDEPEND+=" d? ( <sys-devel/gcc-$((${SLOT} + 1))[d(-)] )"
 fi
 
 if tc_has_feature rust && tc_version_is_at_least 14.1 ; then
@@ -473,7 +472,7 @@ PDEPEND=">=sys-devel/gcc-config-2.11"
 # @DESCRIPTION:
 # Used to override compression used for for patchsets.
 # Default is xz for EAPI 8+.
-       : "${TOOLCHAIN_PATCH_SUFFIX:=xz}"
+: "${TOOLCHAIN_PATCH_SUFFIX:=xz}"
 
 # @ECLASS_VARIABLE: TOOLCHAIN_SET_S
 # @DESCRIPTION:

Reply via email to