commit:     8f2b809efdd701d2a7929b77a9c5f91ff71923a7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 11 08:35:27 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jun 11 11:07:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f2b809e

llvm.org.eclass: Switch to upstream tarballs in 14.0.5+

Switch from the autogenerated GitHub tarballs to the official tarballs
published upstream.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/llvm.org.eclass | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 8b37ca73dbc4..a6f9ca3084e2 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -193,8 +193,15 @@ llvm.org_set_globals() {
                [[ ${PV} != ${_LLVM_MASTER_MAJOR}.* ]] &&
                        EGIT_BRANCH="release/${PV%%.*}.x"
        elif [[ ${_LLVM_SOURCE_TYPE} == tar ]]; then
-               SRC_URI+="
-                       
https://github.com/llvm/llvm-project/archive/llvmorg-${PV/_/-}.tar.gz";
+               if ver_test -ge 14.0.5; then
+                       SRC_URI+="
+                               
https://github.com/llvm/llvm-project/releases/download/llvmorg-${PV}/llvm-project-${PV}.src.tar.xz
+                       "
+               else
+                       SRC_URI+="
+                               
https://github.com/llvm/llvm-project/archive/llvmorg-${PV/_/-}.tar.gz
+                       "
+               fi
        else
                die "Invalid _LLVM_SOURCE_TYPE: ${LLVM_SOURCE_TYPE}"
        fi
@@ -281,10 +288,20 @@ llvm.org_src_unpack() {
                default_src_unpack
        else
                local archive=llvmorg-${PV/_/-}.tar.gz
+               if ver_test -ge 14.0.5; then
+                       archive=llvm-project-${PV/_/-}.src.tar.xz
+               fi
+
                ebegin "Unpacking from ${archive}"
-               tar -x -z -o --strip-components 1 \
-                       -f "${DISTDIR}/${archive}" \
-                       "${components[@]/#/llvm-project-${archive%.tar*}/}" || 
die
+               if ver_test -ge 14.0.5; then
+                       tar -x -J -o --strip-components 1 \
+                               -f "${DISTDIR}/${archive}" \
+                               "${components[@]/#/${archive%.tar*}/}" || die
+               else
+                       tar -x -z -o --strip-components 1 \
+                               -f "${DISTDIR}/${archive}" \
+                               
"${components[@]/#/llvm-project-${archive%.tar*}/}" || die
+               fi
                eend ${?}
 
                # unpack all remaining distfiles

Reply via email to