commit:     1488b03bb6af0289f69ef4244ef79ed3225a10db
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  1 12:31:21 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Feb  1 12:35:46 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1488b03b

toolchain.eclass: make toolchain_src_unpack() a default_src_unpack()

Before tha change toolchain_src_unpack() did not unpack every SRC_URI
entry and instead relied on toolchain_src_unpack() to unpack only
needed tarballs. Any special handling was only needed for old USE=d
versions of gcc.

This change moves all source code mangling to src_prepare() and makes
toolchain_src_unpack() a default_src_unpack().

The only exception is ebuild users of 'GCC_A_FAKEIT' (dev-lang/gnat-gpl)
who have to use it to workaround non-standard behaviour of 
toolchain_src_unpack()

The change will allow dev-lang/gnat-gpl to migrate to default_src_unpack().

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

 eclass/toolchain.eclass | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 9538fd20a39..03e335dac5c 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -445,7 +445,13 @@ toolchain_src_unpack() {
                git-r3_src_unpack
        fi
 
-       gcc_quick_unpack
+       if [[ -n ${GCC_A_FAKEIT} ]] ; then
+               eerror "Please migrate from 'GCC_A_FAKEIT' to 
'default_src_unpack()'"
+               gcc_quick_unpack
+       else
+               # Just unpack every tarball from SRC_URI
+               default_src_unpack
+       fi
 }
 
 gcc_quick_unpack() {
@@ -472,21 +478,6 @@ gcc_quick_unpack() {
                fi
        fi
 
-       if [[ -n ${D_VER} ]] && use d ; then
-               pushd "${S}"/gcc > /dev/null
-               unpack gdc-${D_VER}-src.tar.bz2
-               cd ..
-               ebegin "Adding support for the D language"
-               ./gcc/d/setup-gcc.sh >& "${T}"/dgcc.log
-               if ! eend $? ; then
-                       eerror "The D GCC package failed to apply"
-                       eerror "Please include this log file when posting a bug 
report:"
-                       eerror "  ${T}/dgcc.log"
-                       die "failed to include the D language"
-               fi
-               popd > /dev/null
-       fi
-
        [[ -n ${PATCH_VER} ]] && \
                unpack gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2
 
@@ -532,6 +523,18 @@ toolchain_src_prepare() {
        export BRANDING_GCC_PKGVERSION="Gentoo ${GCC_PVR}"
        cd "${S}"
 
+       if [[ -n ${D_VER} ]] && use d ; then
+               mv "${WORKDIR}"/d gcc/d || die
+               ebegin "Adding support for the D language"
+               ./gcc/d/setup-gcc.sh >& "${T}"/dgcc.log
+               if ! eend $? ; then
+                       eerror "The D GCC package failed to apply"
+                       eerror "Please include this log file when posting a bug 
report:"
+                       eerror "  ${T}/dgcc.log"
+                       die "failed to include the D language"
+               fi
+       fi
+
        do_gcc_gentoo_patches
        do_gcc_HTB_patches
        do_gcc_PIE_patches

Reply via email to