From 8f2b809efdd701d2a7929b77a9c5f91ff71923a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sat, 11 Jun 2022 10:35:27 +0200 Subject: [PATCH] llvm.org.eclass: Switch to upstream tarballs in 14.0.5+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch from the autogenerated GitHub tarballs to the official tarballs published upstream. Signed-off-by: Michał Górny --- 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 8b37ca73dbc40..a6f9ca3084e20 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