commit:     f8e669b811c76e3754fe8dc22094bcf0998f78e7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 23 07:42:30 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Nov 23 07:42:30 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8e669b8

llvm.org.eclass: Support 9.0.1+ RCs

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

 eclass/llvm.org.eclass | 77 ++++++++++++++++++++++++++++++++------------------
 1 file changed, 49 insertions(+), 28 deletions(-)

diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 5a704c1d980..f07441e863c 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -124,12 +124,18 @@ llvm.org_set_globals() {
                [[ ${PV} != ${_LLVM_MASTER_MAJOR}.* ]] &&
                        EGIT_BRANCH="release/${PV%%.*}.x"
        elif [[ ${_LLVM_SOURCE_TYPE} == tar ]]; then
-               local a archives=()
-               _llvm.org_get_archives "${LLVM_COMPONENTS[@]}"
-               for a in "${archives[@]}"; do
-                       SRC_URI+="
-                               https://releases.llvm.org/${PV}/${a}";
-               done
+               if ver_test -ge 9.0.1_rc1; then
+                       # 9.0.1 RCs as GitHub archive
+                       SRC_URI="
+                               
https://github.com/llvm/llvm-project/archive/llvmorg-${PV/_/-}.tar.gz";
+               else
+                       local a archives=()
+                       _llvm.org_get_archives "${LLVM_COMPONENTS[@]}"
+                       for a in "${archives[@]}"; do
+                               SRC_URI+="
+                                       https://releases.llvm.org/${PV}/${a}";
+                       done
+               fi
        else
                die "Invalid _LLVM_SOURCE_TYPE: ${LLVM_SOURCE_TYPE}"
        fi
@@ -141,17 +147,23 @@ llvm.org_set_globals() {
                RESTRICT+=" !test? ( test )"
 
                if [[ ${_LLVM_SOURCE_TYPE} == tar ]]; then
-                       SRC_URI+="
-                               test? ("
-
-                       _llvm.org_get_archives "${LLVM_TEST_COMPONENTS[@]}"
-                       for a in "${archives[@]}"; do
+                       if ver_test -ge 9.0.1_rc1; then
+                               # everything already fetched
+                               :
+                       else
+                               # split 9.0.0 release and older
                                SRC_URI+="
-                                       https://releases.llvm.org/${PV}/${a}";
-                       done
+                                       test? ("
+
+                               _llvm.org_get_archives 
"${LLVM_TEST_COMPONENTS[@]}"
+                               for a in "${archives[@]}"; do
+                                       SRC_URI+="
+                                               
https://releases.llvm.org/${PV}/${a}";
+                               done
 
-                       SRC_URI+="
-                               )"
+                               SRC_URI+="
+                                       )"
+                       fi
                fi
        fi
 
@@ -180,19 +192,28 @@ llvm.org_src_unpack() {
                git-r3_fetch
                git-r3_checkout '' . '' "${components[@]}"
        else
-               local c archives
-               # TODO: optimize this
-               for c in "${components[@]}"; do
-                       local top_dir=${c%%/*}
-                       _llvm.org_get_archives "${c}"
-                       local sub_path=${archives[0]%.tar.xz}
-                       [[ ${c} == */* ]] && sub_path+=/${c#*/}
-
-                       ebegin "Unpacking ${sub_path} from ${archives[0]}"
-                       mkdir -p "${top_dir}" || die
-                       tar -C "${top_dir}" -x -J -o --strip-components 1 \
-                               -f "${DISTDIR}/${archives[0]}" "${sub_path}" || 
die
+               if ver_test -ge 9.0.1_rc1; then
+                       local archive=llvmorg-${PV/_/-}.tar.gz
+                       ebegin "Unpacking from ${archive}"
+                       tar -x -z -o --strip-components 1 \
+                               -f "${DISTDIR}/${archive}" \
+                               
"${components[@]/#/llvm-project-${archive%.tar*}/}" || die
                        eend
-               done
+               else
+                       local c archives
+                       # TODO: optimize this
+                       for c in "${components[@]}"; do
+                               local top_dir=${c%%/*}
+                               _llvm.org_get_archives "${c}"
+                               local sub_path=${archives[0]%.tar.xz}
+                               [[ ${c} == */* ]] && sub_path+=/${c#*/}
+
+                               ebegin "Unpacking ${sub_path} from 
${archives[0]}"
+                               mkdir -p "${top_dir}" || die
+                               tar -C "${top_dir}" -x -J -o --strip-components 
1 \
+                                       -f "${DISTDIR}/${archives[0]}" 
"${sub_path}" || die
+                               eend
+                       done
+               fi
        fi
 }

Reply via email to