toolchain.eclass: provide a way to override gcc tarball path
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 1 Feb 2020 11:09:02 +0000 (11:09 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 1 Feb 2020 11:28:24 +0000 (11:28 +0000)
To ease gnal-gpl packaging allow external user to override SRC_URI
for main gcc tarball. gnal-gpl uses gcc small fork, but otherwise
looks like a gcc tarball.

Bug: https://bugs.gentoo.org/706588
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/toolchain.eclass

index 8796ff10e8ee997ccaef417f169267a63ed7694f..9538fd20a39bf6395485adf6f2d58b422fddc021 100644 (file)
@@ -286,6 +286,10 @@ gentoo_urls() {
 # Other than the variables normally set by portage, this function's behavior
 # can be altered by setting the following:
 #
+#      GCC_TARBALL_SRC_URI
+#                      Override link to main tarball into SRC_URI. Used by dev-lang/gnat-gpl
+#                      to provide gcc tarball snapshots. Patches are usually reused as-is.
+#
 #      SNAPSHOT
 #                      If set, this variable signals that we should be using a snapshot of
 #                      gcc. It is expected to be in the format "YYYY-MM-DD". Note that if
@@ -347,6 +351,9 @@ get_gcc_src_uri() {
        # live git tree, snapshot, or release tarball.
        if tc_is_live ; then
                : # Nothing to do w/git snapshots.
+       elif [[ -n ${GCC_TARBALL_SRC_URI} ]] ; then
+               # pull gcc tarball from another location. Frequently used by gnat-gpl.
+               GCC_SRC_URI="${GCC_TARBALL_SRC_URI}"
        elif [[ -n ${SNAPSHOT} ]] ; then
                GCC_SRC_URI="ftp://gcc.gnu.org/pub/gcc/snapshots/${SNAPSHOT}/gcc-${SNAPSHOT}.tar.xz"
        else