diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-03-15 22:11:44 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-03-15 22:12:43 +0100 |
commit | 1b84f21fdb4a5598f44052a91932eab4b4276caf (patch) | |
tree | 6a0ed1b46540887d15b0b205e1b262b690a4adaa /sys-libs | |
parent | sys-libs/libcxx: Fix calling lit with llvm-6+ (diff) | |
download | gentoo-1b84f21fdb4a5598f44052a91932eab4b4276caf.tar.gz gentoo-1b84f21fdb4a5598f44052a91932eab4b4276caf.tar.bz2 gentoo-1b84f21fdb4a5598f44052a91932eab4b4276caf.zip |
sys-libs/libcxxabi: Build local copy of libc++ for tests
Build a local copy of libc++ when performing tests instead of depending
on system instance. This avoids a circular dependency, and also makes
it possible to build & test libcxxabi independently of the installed
libc++ variant.
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/libcxxabi/libcxxabi-4.0.1.ebuild | 29 | ||||
-rw-r--r-- | sys-libs/libcxxabi/libcxxabi-5.0.1.ebuild | 34 | ||||
-rw-r--r-- | sys-libs/libcxxabi/libcxxabi-6.0.0.ebuild | 34 | ||||
-rw-r--r-- | sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild | 29 | ||||
-rw-r--r-- | sys-libs/libcxxabi/libcxxabi-9999.ebuild | 29 |
5 files changed, 130 insertions, 25 deletions
diff --git a/sys-libs/libcxxabi/libcxxabi-4.0.1.ebuild b/sys-libs/libcxxabi/libcxxabi-4.0.1.ebuild index 23c9c3a7137d..4d088216ab02 100644 --- a/sys-libs/libcxxabi/libcxxabi-4.0.1.ebuild +++ b/sys-libs/libcxxabi/libcxxabi-4.0.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 @@ -18,7 +18,7 @@ SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz LICENSE="|| ( UoI-NCSA MIT )" SLOT="0" KEYWORDS="amd64 ~arm64 x86" -IUSE="+libunwind +static-libs test" +IUSE="+libunwind +static-libs test elibc_musl" RDEPEND=" libunwind? ( @@ -31,7 +31,6 @@ RDEPEND=" DEPEND="${RDEPEND} >=sys-devel/llvm-4 test? ( >=sys-devel/clang-3.9.0 - ~sys-libs/libcxx-${PV}[libcxxabi(-)] $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )" S=${WORKDIR}/${P/_/}.src @@ -85,12 +84,36 @@ multilib_src_configure() { cmake-utils_src_configure } +build_libcxx() { + local CMAKE_USE_DIR=${WORKDIR}/libcxx + local BUILD_DIR=${BUILD_DIR}/libcxx + local mycmakeargs=( + -DLIBCXX_LIBDIR_SUFFIX= + -DLIBCXX_ENABLE_SHARED=ON + -DLIBCXX_ENABLE_STATIC=OFF + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF + -DLIBCXX_CXX_ABI=libcxxabi + -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${S}"/include + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) + -DLIBCXX_HAS_GCC_S_LIB=OFF + -DLIBCXX_INCLUDE_TESTS=OFF + ) + + cmake-utils_src_configure + cmake-utils_src_compile +} + multilib_src_test() { local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die + # build a local copy of libc++ for testing to avoid circular dep + build_libcxx + cp "${BUILD_DIR}"/libcxx/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die + cmake-utils_src_make check-libcxxabi } diff --git a/sys-libs/libcxxabi/libcxxabi-5.0.1.ebuild b/sys-libs/libcxxabi/libcxxabi-5.0.1.ebuild index 9af30980d38c..af214b9a8917 100644 --- a/sys-libs/libcxxabi/libcxxabi-5.0.1.ebuild +++ b/sys-libs/libcxxabi/libcxxabi-5.0.1.ebuild @@ -21,7 +21,7 @@ SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz LICENSE="|| ( UoI-NCSA MIT )" SLOT="0" KEYWORDS="amd64 ~arm64 x86" -IUSE="+libunwind +static-libs test" +IUSE="+libunwind +static-libs test elibc_musl" RDEPEND=" libunwind? ( @@ -34,7 +34,6 @@ RDEPEND=" DEPEND="${RDEPEND} >=sys-devel/llvm-4 test? ( >=sys-devel/clang-3.9.0 - ~sys-libs/libcxx-${PV}[libcxxabi(-)] $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )" S=${WORKDIR}/${MY_P} @@ -52,12 +51,7 @@ pkg_setup() { } src_unpack() { - einfo "Unpacking ${MY_P}.tar.xz ..." - tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die - - einfo "Unpacking parts of ${LIBCXX_P}.tar.xz ..." - tar -xf "${DISTDIR}/${LIBCXX_P}.tar.xz" \ - "${LIBCXX_P}"/{include,utils/libcxx} || die + default mv "${LIBCXX_P}" libcxx || die } @@ -89,12 +83,36 @@ multilib_src_configure() { cmake-utils_src_configure } +build_libcxx() { + local CMAKE_USE_DIR=${WORKDIR}/libcxx + local BUILD_DIR=${BUILD_DIR}/libcxx + local mycmakeargs=( + -DLIBCXX_LIBDIR_SUFFIX= + -DLIBCXX_ENABLE_SHARED=ON + -DLIBCXX_ENABLE_STATIC=OFF + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF + -DLIBCXX_CXX_ABI=libcxxabi + -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${S}"/include + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) + -DLIBCXX_HAS_GCC_S_LIB=OFF + -DLIBCXX_INCLUDE_TESTS=OFF + ) + + cmake-utils_src_configure + cmake-utils_src_compile +} + multilib_src_test() { local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die + # build a local copy of libc++ for testing to avoid circular dep + build_libcxx + cp "${BUILD_DIR}"/libcxx/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die + cmake-utils_src_make check-libcxxabi } diff --git a/sys-libs/libcxxabi/libcxxabi-6.0.0.ebuild b/sys-libs/libcxxabi/libcxxabi-6.0.0.ebuild index 19a29e9bd26e..633da4c093d0 100644 --- a/sys-libs/libcxxabi/libcxxabi-6.0.0.ebuild +++ b/sys-libs/libcxxabi/libcxxabi-6.0.0.ebuild @@ -21,7 +21,7 @@ SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz LICENSE="|| ( UoI-NCSA MIT )" SLOT="0" KEYWORDS="~amd64 ~arm64 ~x86 ~amd64-fbsd" -IUSE="+libunwind +static-libs test" +IUSE="+libunwind +static-libs test elibc_musl" RESTRICT="!test? ( test )" RDEPEND=" @@ -35,7 +35,6 @@ RDEPEND=" DEPEND="${RDEPEND} >=sys-devel/llvm-6 test? ( >=sys-devel/clang-3.9.0 - ~sys-libs/libcxx-${PV}[libcxxabi(-)] $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )" S=${WORKDIR}/${MY_P} @@ -53,12 +52,7 @@ pkg_setup() { } src_unpack() { - einfo "Unpacking ${MY_P}.tar.xz ..." - tar -xf "${DISTDIR}/${MY_P}.tar.xz" || die - - einfo "Unpacking parts of ${LIBCXX_P}.tar.xz ..." - tar -xf "${DISTDIR}/${LIBCXX_P}.tar.xz" \ - "${LIBCXX_P}"/{include,utils/libcxx} || die + default mv "${LIBCXX_P}" libcxx || die } @@ -85,12 +79,36 @@ multilib_src_configure() { cmake-utils_src_configure } +build_libcxx() { + local CMAKE_USE_DIR=${WORKDIR}/libcxx + local BUILD_DIR=${BUILD_DIR}/libcxx + local mycmakeargs=( + -DLIBCXX_LIBDIR_SUFFIX= + -DLIBCXX_ENABLE_SHARED=ON + -DLIBCXX_ENABLE_STATIC=OFF + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF + -DLIBCXX_CXX_ABI=libcxxabi + -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${S}"/include + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) + -DLIBCXX_HAS_GCC_S_LIB=OFF + -DLIBCXX_INCLUDE_TESTS=OFF + ) + + cmake-utils_src_configure + cmake-utils_src_compile +} + multilib_src_test() { local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die + # build a local copy of libc++ for testing to avoid circular dep + build_libcxx + cp "${BUILD_DIR}"/libcxx/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die + cmake-utils_src_make check-libcxxabi } diff --git a/sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild b/sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild index b9675a9e147f..63e42c376c3d 100644 --- a/sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild +++ b/sys-libs/libcxxabi/libcxxabi-6.0.9999.ebuild @@ -20,7 +20,7 @@ EGIT_BRANCH="release_60" LICENSE="|| ( UoI-NCSA MIT )" SLOT="0" KEYWORDS="" -IUSE="+libunwind +static-libs test" +IUSE="+libunwind +static-libs test elibc_musl" RESTRICT="!test? ( test )" RDEPEND=" @@ -34,7 +34,6 @@ RDEPEND=" DEPEND="${RDEPEND} >=sys-devel/llvm-6 test? ( >=sys-devel/clang-3.9.0 - ~sys-libs/libcxx-${PV}[libcxxabi(-)] $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )" # least intrusive of all @@ -56,7 +55,7 @@ src_unpack() { git-r3_fetch git-r3_checkout https://llvm.org/git/libcxx.git \ - "${WORKDIR}"/libcxx '' include utils/libcxx + "${WORKDIR}"/libcxx '' git-r3_checkout } @@ -83,12 +82,36 @@ multilib_src_configure() { cmake-utils_src_configure } +build_libcxx() { + local CMAKE_USE_DIR=${WORKDIR}/libcxx + local BUILD_DIR=${BUILD_DIR}/libcxx + local mycmakeargs=( + -DLIBCXX_LIBDIR_SUFFIX= + -DLIBCXX_ENABLE_SHARED=ON + -DLIBCXX_ENABLE_STATIC=OFF + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF + -DLIBCXX_CXX_ABI=libcxxabi + -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${S}"/include + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) + -DLIBCXX_HAS_GCC_S_LIB=OFF + -DLIBCXX_INCLUDE_TESTS=OFF + ) + + cmake-utils_src_configure + cmake-utils_src_compile +} + multilib_src_test() { local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die + # build a local copy of libc++ for testing to avoid circular dep + build_libcxx + cp "${BUILD_DIR}"/libcxx/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die + cmake-utils_src_make check-libcxxabi } diff --git a/sys-libs/libcxxabi/libcxxabi-9999.ebuild b/sys-libs/libcxxabi/libcxxabi-9999.ebuild index 9cf976d80c3f..d6752dc12631 100644 --- a/sys-libs/libcxxabi/libcxxabi-9999.ebuild +++ b/sys-libs/libcxxabi/libcxxabi-9999.ebuild @@ -19,7 +19,7 @@ EGIT_REPO_URI="https://git.llvm.org/git/libcxxabi.git LICENSE="|| ( UoI-NCSA MIT )" SLOT="0" KEYWORDS="" -IUSE="+libunwind +static-libs test" +IUSE="+libunwind +static-libs test elibc_musl" RESTRICT="!test? ( test )" RDEPEND=" @@ -33,7 +33,6 @@ RDEPEND=" DEPEND="${RDEPEND} >=sys-devel/llvm-6 test? ( >=sys-devel/clang-3.9.0 - ~sys-libs/libcxx-${PV}[libcxxabi(-)] $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )" # least intrusive of all @@ -55,7 +54,7 @@ src_unpack() { git-r3_fetch git-r3_checkout https://llvm.org/git/libcxx.git \ - "${WORKDIR}"/libcxx '' include utils/libcxx + "${WORKDIR}"/libcxx '' git-r3_checkout } @@ -82,12 +81,36 @@ multilib_src_configure() { cmake-utils_src_configure } +build_libcxx() { + local CMAKE_USE_DIR=${WORKDIR}/libcxx + local BUILD_DIR=${BUILD_DIR}/libcxx + local mycmakeargs=( + -DLIBCXX_LIBDIR_SUFFIX= + -DLIBCXX_ENABLE_SHARED=ON + -DLIBCXX_ENABLE_STATIC=OFF + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF + -DLIBCXX_CXX_ABI=libcxxabi + -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${S}"/include + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) + -DLIBCXX_HAS_GCC_S_LIB=OFF + -DLIBCXX_INCLUDE_TESTS=OFF + ) + + cmake-utils_src_configure + cmake-utils_src_compile +} + multilib_src_test() { local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die + # build a local copy of libc++ for testing to avoid circular dep + build_libcxx + cp "${BUILD_DIR}"/libcxx/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die + cmake-utils_src_make check-libcxxabi } |