sys-devel/clang: Switch live to monorepo
authorMichał Górny <mgorny@gentoo.org>
Fri, 1 Nov 2019 08:34:42 +0000 (09:34 +0100)
committerMichał Górny <mgorny@gentoo.org>
Fri, 1 Nov 2019 13:15:47 +0000 (14:15 +0100)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
sys-devel/clang/clang-10.0.0.9999.ebuild
sys-devel/clang/clang-9.0.1.9999.ebuild

index aa2c3a2ba5d82b55422adb6028ea6204c668ee00..7213d45d1617d527764a487538ee593cffeff8cc 100644 (file)
@@ -14,11 +14,9 @@ inherit cmake-utils git-r3 llvm multilib-minimal multiprocessing \
 DESCRIPTION="C language family frontend for LLVM"
 HOMEPAGE="https://llvm.org/"
 SRC_URI=""
+EGIT_REPO_URI="https://github.com/llvm/llvm-project.git"
 # We need extra level of indirection for CLANG_RESOURCE_DIR
-S=${WORKDIR}/x/y/${P}
-
-EGIT_REPO_URI="https://git.llvm.org/git/clang.git
-       https://github.com/llvm-mirror/clang.git"
+S=${WORKDIR}/x/${P}/clang
 
 # Keep in sync with sys-devel/llvm
 ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC AVR )
@@ -82,26 +80,16 @@ pkg_setup() {
 
 src_unpack() {
        # create extra parent dir for CLANG_RESOURCE_DIR
-       mkdir -p x/y || die
-       cd x/y || die
-
-       git-r3_fetch "https://git.llvm.org/git/clang-tools-extra.git
-               https://github.com/llvm-mirror/clang-tools-extra.git"
-       if use test; then
-               # needed for patched gtest
-               git-r3_fetch "https://git.llvm.org/git/llvm.git
-                       https://github.com/llvm-mirror/llvm.git"
-       fi
-       git-r3_fetch
+       mkdir -p x || die
 
-       git-r3_checkout https://llvm.org/git/clang-tools-extra.git \
-               "${S}"/tools/extra
-       if use test; then
-               git-r3_checkout https://llvm.org/git/llvm.git \
-                       "${WORKDIR}"/llvm '' \
-                       lib/Testing/Support utils/{lit,llvm-lit,unittest}
-       fi
-       git-r3_checkout "${EGIT_REPO_URI}" "${S}"
+       local dirs=( clang clang-tools-extra )
+       use test && dirs+=(
+               llvm/lib/Testing/Support llvm/utils/{lit,llvm-lit,unittest}
+       )
+       git-r3_fetch
+       git-r3_checkout "${EGIT_REPO_URI}" "${WORKDIR}/x/${P}" '' "${dirs[@]}"
+       mv "${WORKDIR}/x/${P}/clang-tools-extra" \
+               "${WORKDIR}/x/${P}/clang/tools/extra" || die
 }
 
 check_distribution_components() {
@@ -258,7 +246,7 @@ multilib_src_configure() {
                -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
        )
        use test && mycmakeargs+=(
-               -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+               -DLLVM_MAIN_SRC_DIR="${WORKDIR}/x/${P}/llvm"
                -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
        )
 
index 848de712e2414d3454b8745a1b6dd0631ee533d3..788ba009941a6bc569191d69e574b9b836453b11 100644 (file)
@@ -14,12 +14,10 @@ inherit cmake-utils git-r3 llvm multilib-minimal multiprocessing \
 DESCRIPTION="C language family frontend for LLVM"
 HOMEPAGE="https://llvm.org/"
 SRC_URI=""
+EGIT_REPO_URI="https://github.com/llvm/llvm-project.git"
+EGIT_BRANCH="release/9.x"
 # We need extra level of indirection for CLANG_RESOURCE_DIR
-S=${WORKDIR}/x/y/${P}
-
-EGIT_REPO_URI="https://git.llvm.org/git/clang.git
-       https://github.com/llvm-mirror/clang.git"
-EGIT_BRANCH="release_90"
+S=${WORKDIR}/x/${P}/clang
 
 # Keep in sync with sys-devel/llvm
 ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
@@ -90,26 +88,16 @@ pkg_setup() {
 
 src_unpack() {
        # create extra parent dir for CLANG_RESOURCE_DIR
-       mkdir -p x/y || die
-       cd x/y || die
-
-       git-r3_fetch "https://git.llvm.org/git/clang-tools-extra.git
-               https://github.com/llvm-mirror/clang-tools-extra.git"
-       if use test; then
-               # needed for patched gtest
-               git-r3_fetch "https://git.llvm.org/git/llvm.git
-                       https://github.com/llvm-mirror/llvm.git"
-       fi
-       git-r3_fetch
+       mkdir -p x || die
 
-       git-r3_checkout https://llvm.org/git/clang-tools-extra.git \
-               "${S}"/tools/extra
-       if use test; then
-               git-r3_checkout https://llvm.org/git/llvm.git \
-                       "${WORKDIR}"/llvm '' \
-                       lib/Testing/Support utils/{lit,llvm-lit,unittest}
-       fi
-       git-r3_checkout "${EGIT_REPO_URI}" "${S}"
+       local dirs=( clang clang-tools-extra )
+       use test && dirs+=(
+               llvm/lib/Testing/Support llvm/utils/{lit,llvm-lit,unittest}
+       )
+       git-r3_fetch
+       git-r3_checkout "${EGIT_REPO_URI}" "${WORKDIR}/x/${P}" '' "${dirs[@]}"
+       mv "${WORKDIR}/x/${P}/clang-tools-extra" \
+               "${WORKDIR}/x/${P}/clang/tools/extra" || die
 }
 
 multilib_src_configure() {
@@ -143,7 +131,7 @@ multilib_src_configure() {
                -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
        )
        use test && mycmakeargs+=(
-               -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+               -DLLVM_MAIN_SRC_DIR="${WORKDIR}/x/${P}/llvm"
                -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
        )