toolchain.eclass: make toolchain_src_unpack() a default_src_unpack()
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 1 Feb 2020 12:31:21 +0000 (12:31 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 1 Feb 2020 12:35:46 +0000 (12:35 +0000)
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@gentoo.org>
eclass/toolchain.eclass

index 9538fd20a39bf6395485adf6f2d58b422fddc021..03e335dac5c53b8d02c7c2a85b30b1f225242211 100644 (file)
@@ -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