summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-06-02 08:36:32 +0100
committerSam James <sam@gentoo.org>2022-06-02 08:37:37 +0100
commit8e58d2aed3a7f368d881727bef854a22ff7c18af (patch)
tree903077a16ec6f8df28fda4612772716b5d3affad /eclass/toolchain.eclass
parentapp-text/recode: Stabilize 3.7.12 hppa, #849194 (diff)
downloadgentoo-8e58d2aed3a7f368d881727bef854a22ff7c18af.tar.gz
gentoo-8e58d2aed3a7f368d881727bef854a22ff7c18af.tar.bz2
gentoo-8e58d2aed3a7f368d881727bef854a22ff7c18af.zip
toolchain.eclass: add variable to force fetching patches from git
Useful for pre-release snapshots of a new release series. Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r--eclass/toolchain.eclass52
1 files changed, 37 insertions, 15 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 90e596f94561..4db0acd592a5 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -35,6 +35,8 @@ if tc_is_live ; then
EGIT_BRANCH="releases/${PN}-${PV%.?.?_pre9999}"
EGIT_BRANCH=${EGIT_BRANCH//./_}
inherit git-r3
+elif [[ -n ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ inherit git-r3
fi
FEATURES=${FEATURES/multilib-strict/}
@@ -79,6 +81,15 @@ tc_version_is_between() {
# Used to override GCC version. Useful for e.g. live ebuilds or snapshots.
# Defaults to ${PV}.
+# @ECLASS_VARIABLE: TOOLCHAIN_USE_GIT_PATCHES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Used to force fetching patches from git. Useful for non-released versions
+# of GCC where we don't want to keep creating patchset tarballs for a new
+# release series (e.g. suppose 12.0 just got released, then adding snapshots
+# for 13.0, we don't want to create new patchsets for every single 13.0 snapshot,
+# so just grab patches from git each time if this variable is set).
+
# @ECLASS_VARIABLE: GCC_PV
# @INTERNAL
# @DESCRIPTION:
@@ -502,29 +513,40 @@ toolchain_pkg_setup() {
#---->> src_unpack <<----
+# @FUNCTION: toolchain_fetch_git_patches
+# @INTERNAL
+# @DESCRIPTION:
+# Fetch patches from Gentoo's gcc-patches repository.
+toolchain_fetch_git_patches() {
+ local gcc_patches_repo="https://anongit.gentoo.org/git/proj/gcc-patches.git https://github.com/gentoo/gcc-patches"
+
+ # If we weren't given a patchset number, pull it from git too.
+ einfo "Fetching patchset from git as PATCH_VER is unset"
+ EGIT_REPO_URI=${gcc_patches_repo} EGIT_BRANCH="master" \
+ EGIT_CHECKOUT_DIR="${WORKDIR}"/patch.tmp \
+ git-r3_src_unpack
+
+ mkdir "${WORKDIR}"/patch || die
+ mv "${WORKDIR}"/patch.tmp/${PATCH_GCC_VER}/gentoo/* "${WORKDIR}"/patch || die
+
+ if [[ -n ${MUSL_VER} || -d "${WORKDIR}"/musl ]] && [[ ${CTARGET} == *musl* ]] ; then
+ mkdir "${WORKDIR}"/musl || die
+ mv "${WORKDIR}"/patch.tmp/${PATCH_GCC_VER}/musl/* "${WORKDIR}"/musl || die
+ fi
+}
+
toolchain_src_unpack() {
if tc_is_live ; then
git-r3_src_unpack
if [[ -z ${PATCH_VER} ]] && ! use vanilla ; then
- local gcc_patches_repo="https://anongit.gentoo.org/git/proj/gcc-patches.git https://github.com/gentoo/gcc-patches"
- # If we weren't given a patchset number, pull it from git too.
- einfo "Fetching patchset from git as PATCH_VER is unset"
- EGIT_REPO_URI=${gcc_patches_repo} EGIT_BRANCH="master" \
- EGIT_CHECKOUT_DIR="${WORKDIR}"/patch.tmp \
- git-r3_src_unpack
-
- mkdir "${WORKDIR}"/patch || die
- mv "${WORKDIR}"/patch.tmp/${PATCH_GCC_VER}/gentoo/* "${WORKDIR}"/patch || die
-
- if [[ -n ${MUSL_VER} || -d "${WORKDIR}"/musl ]] && [[ ${CTARGET} == *musl* ]] ; then
- mkdir "${WORKDIR}"/musl || die
- mv "${WORKDIR}"/patch.tmp/${PATCH_GCC_VER}/musl/* "${WORKDIR}"/musl || die
- fi
+ toolchain_fetch_git_patches
fi
+ elif [[ -z ${PATCH_VER} && -n ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ toolchain_fetch_git_patches
fi
- default_src_unpack
+ default
}
#---->> src_prepare <<----