summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-05-22 19:11:56 +0100
committerSam James <sam@gentoo.org>2022-05-22 19:38:10 +0100
commita079e35c763407ba7f28c3186c0044f8284b312a (patch)
treef1fbf73ffd92ea24724d337598771f10f3c3b6f7 /eclass
parenttoolchain.eclass: simplify logic for GCC 9 (diff)
downloadgentoo-a079e35c763407ba7f28c3186c0044f8284b312a.tar.gz
gentoo-a079e35c763407ba7f28c3186c0044f8284b312a.tar.bz2
gentoo-a079e35c763407ba7f28c3186c0044f8284b312a.zip
toolchain.eclass: introduce TOOLCHAIN_PATCH_SUFFIX
Apologies for the churn here. It's turned out to be easier to just do this based on EAPI and override in ebuilds if needed. I won't plan to change this again. Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/toolchain.eclass26
1 files changed, 15 insertions, 11 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 9e543b9c1b98..c421001209ca 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -316,6 +316,17 @@ PDEPEND=">=sys-devel/gcc-config-2.3"
#---->> S + SRC_URI essentials <<----
+# @ECLASS_VARIABLE: TOOLCHAIN_PATCH_SUFFIX
+# @DESCRIPTION:
+# Used to override compression used for for patchsets.
+# Default is xz for EAPI 8+ and bz2 for older EAPIs.
+if [[ ${EAPI} == 8 ]] ; then
+ : ${TOOLCHAIN_PATCH_SUFFIX:=xz}
+else
+ # Older EAPIs
+ : ${TOOLCHAIN_PATCH_SUFFIX:=bz2}
+fi
+
# @ECLASS_VARIABLE: TOOLCHAIN_SET_S
# @DESCRIPTION:
# Used to override value of S for snapshots and such. Mainly useful
@@ -428,25 +439,18 @@ get_gcc_src_uri() {
fi
fi
- local PATCH_SUFFIX="xz"
- if ! tc_version_is_at_least 10 || tc_version_is_between 10 10.4 \
- || tc_version_is_between 11 11.4 || tc_version_is_between 12 12.0.1_pre20220424 ; then
- # These are versions before we started to use .xz
- PATCH_SUFFIX="bz2"
- fi
-
[[ -n ${PATCH_VER} ]] && \
- GCC_SRC_URI+=" $(gentoo_urls gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.${PATCH_SUFFIX})"
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.${TOOLCHAIN_PATCH_SUFFIX})"
[[ -n ${MUSL_VER} ]] && \
- GCC_SRC_URI+=" $(gentoo_urls gcc-${MUSL_GCC_VER}-musl-patches-${MUSL_VER}.tar.${PATCH_SUFFIX})"
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${MUSL_GCC_VER}-musl-patches-${MUSL_VER}.tar.${TOOLCHAIN_PATCH_SUFFIX})"
[[ -n ${PIE_VER} ]] && \
- PIE_CORE=${PIE_CORE:-gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.${PATCH_SUFFIX}} && \
+ PIE_CORE=${PIE_CORE:-gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.${TOOLCHAIN_PATCH_SUFFIX}} && \
GCC_SRC_URI+=" $(gentoo_urls ${PIE_CORE})"
# gcc minispec for the hardened gcc 4 compiler
[[ -n ${SPECS_VER} ]] && \
- GCC_SRC_URI+=" $(gentoo_urls gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.${PATCH_SUFFIX})"
+ GCC_SRC_URI+=" $(gentoo_urls gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.${TOOLCHAIN_PATCH_SUFFIX})"
if tc_has_feature gcj ; then
if tc_version_is_at_least 4.5 ; then