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

index 2edd3ca69fd17ff8909503b927f971738b46ca29..29ee7839931610df6172655521311e2a5c09fd98 100644 (file)
@@ -4,13 +4,13 @@
 EAPI=7
 
 PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
-inherit cmake-multilib git-r3 llvm multiprocessing python-any-r1
+inherit cmake-multilib llvm llvm.org multiprocessing python-any-r1
 
 DESCRIPTION="C++ runtime stack unwinder from LLVM"
 HOMEPAGE="https://github.com/llvm-mirror/libunwind"
-SRC_URI=""
-EGIT_REPO_URI="https://github.com/llvm/llvm-project.git"
-S=${WORKDIR}/${P}/libunwind
+LLVM_COMPONENTS=( libunwind )
+LLVM_TEST_COMPONENTS=( libcxx{,abi} )
+llvm.org_set_globals
 
 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="0"
@@ -29,13 +29,6 @@ BDEPEND="
 # least intrusive of all
 CMAKE_BUILD_TYPE=RelWithDebInfo
 
-src_unpack() {
-       local dirs=( libunwind )
-       use test && dirs+=( libcxx{,abi} )
-       git-r3_fetch
-       git-r3_checkout '' '' '' "${dirs[@]}"
-}
-
 python_check_deps() {
        has_version "dev-python/lit[${PYTHON_USEDEP}]"
 }
@@ -66,7 +59,7 @@ multilib_src_configure() {
                mycmakeargs+=(
                        -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
                        -DLLVM_LIT_ARGS="-vv;-j;${jobs};--param=cxx_under_test=${clang_path}"
-                       -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/${P}/libcxx"
+                       -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/libcxx"
                )
        fi
 
@@ -75,7 +68,7 @@ multilib_src_configure() {
 
 build_libcxxabi() {
        local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/$(get_libdir)"
-       local CMAKE_USE_DIR=${WORKDIR}/${P}/libcxxabi
+       local CMAKE_USE_DIR=${WORKDIR}/libcxxabi
        local BUILD_DIR=${BUILD_DIR}/libcxxabi
        local mycmakeargs=(
                -DLIBCXXABI_LIBDIR_SUFFIX=
@@ -84,7 +77,7 @@ build_libcxxabi() {
                -DLIBCXXABI_USE_LLVM_UNWINDER=ON
                -DLIBCXXABI_INCLUDE_TESTS=OFF
 
-               -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}/${P}"/libcxx/include
+               -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx/include
                -DLIBCXXABI_LIBUNWIND_INCLUDES="${S}"/include
        )
 
@@ -94,7 +87,7 @@ build_libcxxabi() {
 
 build_libcxx() {
        local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/libcxxabi/lib -L${BUILD_DIR}/$(get_libdir)"
-       local CMAKE_USE_DIR=${WORKDIR}/${P}/libcxx
+       local CMAKE_USE_DIR=${WORKDIR}/libcxx
        local BUILD_DIR=${BUILD_DIR}/libcxx
        local mycmakeargs=(
                -DLIBCXX_LIBDIR_SUFFIX=
@@ -103,7 +96,7 @@ build_libcxx() {
                -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
                -DLIBCXXABI_USE_LLVM_UNWINDER=ON
                -DLIBCXX_CXX_ABI=libcxxabi
-               -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${WORKDIR}/${P}"/libcxxabi/include
+               -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${WORKDIR}"/libcxxabi/include
                -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
                -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
                -DLIBCXX_HAS_GCC_S_LIB=OFF
index 3cdeb8d20c268c6b35a6cc340e78541e774e8af4..373f7d8c03ae7be91cf9668a43fc9c19b9572a3b 100644 (file)
@@ -4,19 +4,13 @@
 EAPI=7
 
 PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
-inherit cmake-multilib llvm multiprocessing python-any-r1
-
-MY_P=libunwind-${PV/_/}.src
-LIBCXX_P=libcxx-${PV/_/}.src
-LIBCXXABI_P=libcxxabi-${PV/_/}.src
+inherit cmake-multilib llvm llvm.org multiprocessing python-any-r1
 
 DESCRIPTION="C++ runtime stack unwinder from LLVM"
 HOMEPAGE="https://github.com/llvm-mirror/libunwind"
-SRC_URI="https://releases.llvm.org/${PV}/${MY_P}.tar.xz
-       test? (
-               https://releases.llvm.org/${PV}/${LIBCXX_P}.tar.xz
-               https://releases.llvm.org/${PV}/${LIBCXXABI_P}.tar.xz )"
-S=${WORKDIR}/${MY_P}
+LLVM_COMPONENTS=( libunwind )
+LLVM_TEST_COMPONENTS=( libcxx{,abi} )
+llvm.org_set_globals
 
 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="0"
@@ -43,15 +37,6 @@ pkg_setup() {
        use test && python-any-r1_pkg_setup
 }
 
-src_unpack() {
-       default
-
-       if use test; then
-               mv "${LIBCXX_P}" libcxx || die
-               mv "${LIBCXXABI_P}" libcxxabi || die
-       fi
-}
-
 multilib_src_configure() {
        local libdir=$(get_libdir)
 
@@ -74,7 +59,7 @@ multilib_src_configure() {
                mycmakeargs+=(
                        -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
                        -DLLVM_LIT_ARGS="-vv;-j;${jobs};--param=cxx_under_test=${clang_path}"
-                       -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}"/libcxx
+                       -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/libcxx"
                )
        fi
 
index 91a1c4334596c683d3e7a991f4b0a4984d41df17..29ee7839931610df6172655521311e2a5c09fd98 100644 (file)
@@ -4,14 +4,13 @@
 EAPI=7
 
 PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
-inherit cmake-multilib git-r3 llvm multiprocessing python-any-r1
+inherit cmake-multilib llvm llvm.org multiprocessing python-any-r1
 
 DESCRIPTION="C++ runtime stack unwinder from LLVM"
 HOMEPAGE="https://github.com/llvm-mirror/libunwind"
-SRC_URI=""
-EGIT_REPO_URI="https://github.com/llvm/llvm-project.git"
-EGIT_BRANCH="release/9.x"
-S=${WORKDIR}/${P}/libunwind
+LLVM_COMPONENTS=( libunwind )
+LLVM_TEST_COMPONENTS=( libcxx{,abi} )
+llvm.org_set_globals
 
 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
 SLOT="0"
@@ -30,13 +29,6 @@ BDEPEND="
 # least intrusive of all
 CMAKE_BUILD_TYPE=RelWithDebInfo
 
-src_unpack() {
-       local dirs=( libunwind )
-       use test && dirs+=( libcxx{,abi} )
-       git-r3_fetch
-       git-r3_checkout '' '' '' "${dirs[@]}"
-}
-
 python_check_deps() {
        has_version "dev-python/lit[${PYTHON_USEDEP}]"
 }
@@ -67,7 +59,7 @@ multilib_src_configure() {
                mycmakeargs+=(
                        -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
                        -DLLVM_LIT_ARGS="-vv;-j;${jobs};--param=cxx_under_test=${clang_path}"
-                       -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/${P}/libcxx"
+                       -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/libcxx"
                )
        fi
 
@@ -76,7 +68,7 @@ multilib_src_configure() {
 
 build_libcxxabi() {
        local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/$(get_libdir)"
-       local CMAKE_USE_DIR=${WORKDIR}/${P}/libcxxabi
+       local CMAKE_USE_DIR=${WORKDIR}/libcxxabi
        local BUILD_DIR=${BUILD_DIR}/libcxxabi
        local mycmakeargs=(
                -DLIBCXXABI_LIBDIR_SUFFIX=
@@ -85,7 +77,7 @@ build_libcxxabi() {
                -DLIBCXXABI_USE_LLVM_UNWINDER=ON
                -DLIBCXXABI_INCLUDE_TESTS=OFF
 
-               -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}/${P}"/libcxx/include
+               -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx/include
                -DLIBCXXABI_LIBUNWIND_INCLUDES="${S}"/include
        )
 
@@ -95,7 +87,7 @@ build_libcxxabi() {
 
 build_libcxx() {
        local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/libcxxabi/lib -L${BUILD_DIR}/$(get_libdir)"
-       local CMAKE_USE_DIR=${WORKDIR}/${P}/libcxx
+       local CMAKE_USE_DIR=${WORKDIR}/libcxx
        local BUILD_DIR=${BUILD_DIR}/libcxx
        local mycmakeargs=(
                -DLIBCXX_LIBDIR_SUFFIX=
@@ -104,7 +96,7 @@ build_libcxx() {
                -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
                -DLIBCXXABI_USE_LLVM_UNWINDER=ON
                -DLIBCXX_CXX_ABI=libcxxabi
-               -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${WORKDIR}/${P}"/libcxxabi/include
+               -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${WORKDIR}"/libcxxabi/include
                -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
                -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
                -DLIBCXX_HAS_GCC_S_LIB=OFF