sys-libs/compiler-rt-sanitizers: Port to llvm.org eclass
authorMichał Górny <mgorny@gentoo.org>
Fri, 1 Nov 2019 17:58:06 +0000 (18:58 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sun, 3 Nov 2019 11:46:19 +0000 (12:46 +0100)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-10.0.0.9999.ebuild
sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.0.ebuild
sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-9.0.1.9999.ebuild

index 1cc96771caec6b51b71c8eca1379bb6cca9410ea..85a0884b7a92379ee5dfaa656b98920c01f119fd 100644 (file)
@@ -4,14 +4,14 @@
 EAPI=7
 
 PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
-inherit check-reqs cmake-utils flag-o-matic git-r3 llvm \
+inherit check-reqs cmake-utils flag-o-matic llvm llvm.org \
        multiprocessing python-any-r1
 
 DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
 HOMEPAGE="https://llvm.org/"
-SRC_URI=""
-EGIT_REPO_URI="https://github.com/llvm/llvm-project.git"
-S=${WORKDIR}/${P}/compiler-rt
+LLVM_COMPONENTS=( compiler-rt )
+LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest )
+llvm.org_set_globals
 
 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="$(ver_cut 1-3)"
@@ -55,13 +55,6 @@ pkg_setup() {
        python-any-r1_pkg_setup
 }
 
-src_unpack() {
-       local dirs=( compiler-rt )
-       use test && dirs+=( llvm/lib/Testing/Support llvm/utils/unittest )
-       git-r3_fetch
-       git-r3_checkout '' '' '' "${dirs[@]}"
-}
-
 src_prepare() {
        cmake-utils_src_prepare
 
@@ -76,7 +69,7 @@ src_prepare() {
 
 src_configure() {
        # pre-set since we need to pass it to cmake
-       BUILD_DIR=${WORKDIR}/${P}/compiler-rt_build
+       BUILD_DIR=${WORKDIR}/compiler-rt_build
 
        if use clang; then
                local -x CC=${CHOST}-clang
@@ -101,7 +94,7 @@ src_configure() {
        )
        if use test; then
                mycmakeargs+=(
-                       -DLLVM_MAIN_SRC_DIR="${WORKDIR}/${P}/llvm"
+                       -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
                        -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
                        -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
 
index 9ee7e14a6b3f1b9c48c133f992b07f64a58bd9dc..1ced0d08037984d0fc844df567b948a8b0fda7d4 100644 (file)
@@ -4,17 +4,14 @@
 EAPI=7
 
 PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
-inherit check-reqs cmake-utils flag-o-matic llvm \
+inherit check-reqs cmake-utils flag-o-matic llvm llvm.org \
        multiprocessing python-any-r1
 
-MY_P=compiler-rt-${PV/_/}.src
-LLVM_P=llvm-${PV/_/}.src
-
 DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
 HOMEPAGE="https://llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV}/${MY_P}.tar.xz
-       test? ( https://releases.llvm.org/${PV}/${LLVM_P}.tar.xz )"
-S=${WORKDIR}/${MY_P}
+LLVM_COMPONENTS=( compiler-rt )
+LLVM_TEST_COMPONENTS=( llvm/utils/unittest )
+llvm.org_set_globals
 
 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="$(ver_cut 1-3)"
@@ -58,18 +55,6 @@ pkg_setup() {
        python-any-r1_pkg_setup
 }
 
-src_unpack() {
-       einfo "Unpacking ${MY_P}.tar.xz ..."
-       tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die
-
-       if use test; then
-               einfo "Unpacking parts of ${LLVM_P}.tar.xz ..."
-               tar -xf "${DISTDIR}/${LLVM_P}.tar.xz" \
-                       "${LLVM_P}"/utils/unittest || die
-               mv "${LLVM_P}" llvm || die
-       fi
-}
-
 src_prepare() {
        cmake-utils_src_prepare
 
@@ -84,7 +69,7 @@ src_prepare() {
 
 src_configure() {
        # pre-set since we need to pass it to cmake
-       BUILD_DIR=${WORKDIR}/${P}_build
+       BUILD_DIR=${WORKDIR}/compiler-rt_build
 
        if use clang; then
                local -x CC=${CHOST}-clang
index 832207f6714e3bdb455d3c31ec4dbb9303378328..f28bb313413d46148f352338aba7b3d40a68c4be 100644 (file)
@@ -4,15 +4,14 @@
 EAPI=7
 
 PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
-inherit check-reqs cmake-utils flag-o-matic git-r3 llvm \
+inherit check-reqs cmake-utils flag-o-matic llvm llvm.org \
        multiprocessing python-any-r1
 
 DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)"
 HOMEPAGE="https://llvm.org/"
-SRC_URI=""
-EGIT_REPO_URI="https://github.com/llvm/llvm-project.git"
-EGIT_BRANCH="release/9.x"
-S=${WORKDIR}/${P}/compiler-rt
+LLVM_COMPONENTS=( compiler-rt )
+LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest )
+llvm.org_set_globals
 
 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="$(ver_cut 1-3)"
@@ -56,13 +55,6 @@ pkg_setup() {
        python-any-r1_pkg_setup
 }
 
-src_unpack() {
-       local dirs=( compiler-rt )
-       use test && dirs+=( llvm/utils/unittest )
-       git-r3_fetch
-       git-r3_checkout '' '' '' "${dirs[@]}"
-}
-
 src_prepare() {
        cmake-utils_src_prepare
 
@@ -77,7 +69,7 @@ src_prepare() {
 
 src_configure() {
        # pre-set since we need to pass it to cmake
-       BUILD_DIR=${WORKDIR}/${P}/compiler-rt_build
+       BUILD_DIR=${WORKDIR}/compiler-rt_build
 
        if use clang; then
                local -x CC=${CHOST}-clang
@@ -102,7 +94,7 @@ src_configure() {
        )
        if use test; then
                mycmakeargs+=(
-                       -DLLVM_MAIN_SRC_DIR="${WORKDIR}/${P}/llvm"
+                       -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
                        -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
                        -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"