1 |
commit: cd6a484e3523acf8573fa4d496cc705e0e87e2df |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 30 11:16:42 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 30 18:13:58 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd6a484e |
7 |
|
8 |
sys-libs/libcxxabi: Bump live to 14* |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-libs/libcxxabi/libcxxabi-14.0.0.9999.ebuild | 122 ++++++++++++++++++++++++ |
13 |
1 file changed, 122 insertions(+) |
14 |
|
15 |
diff --git a/sys-libs/libcxxabi/libcxxabi-14.0.0.9999.ebuild b/sys-libs/libcxxabi/libcxxabi-14.0.0.9999.ebuild |
16 |
new file mode 100644 |
17 |
index 00000000000..5df21898489 |
18 |
--- /dev/null |
19 |
+++ b/sys-libs/libcxxabi/libcxxabi-14.0.0.9999.ebuild |
20 |
@@ -0,0 +1,122 @@ |
21 |
+# Copyright 1999-2021 Gentoo Authors |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+ |
24 |
+EAPI=7 |
25 |
+ |
26 |
+CMAKE_ECLASS=cmake |
27 |
+PYTHON_COMPAT=( python3_{8..10} ) |
28 |
+inherit cmake-multilib llvm llvm.org python-any-r1 toolchain-funcs |
29 |
+ |
30 |
+DESCRIPTION="Low level support for a standard C++ library" |
31 |
+HOMEPAGE="https://libcxxabi.llvm.org/" |
32 |
+ |
33 |
+LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" |
34 |
+SLOT="0" |
35 |
+KEYWORDS="" |
36 |
+IUSE="+libunwind static-libs test elibc_musl" |
37 |
+RESTRICT="!test? ( test )" |
38 |
+ |
39 |
+RDEPEND=" |
40 |
+ libunwind? ( |
41 |
+ || ( |
42 |
+ >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}] |
43 |
+ >=sys-libs/llvm-libunwind-3.9.0-r1[static-libs?,${MULTILIB_USEDEP}] |
44 |
+ ) |
45 |
+ )" |
46 |
+# llvm-6 for new lit options |
47 |
+DEPEND="${RDEPEND} |
48 |
+ >=sys-devel/llvm-6" |
49 |
+BDEPEND=" |
50 |
+ test? ( >=sys-devel/clang-3.9.0 |
51 |
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') |
52 |
+ )" |
53 |
+ |
54 |
+# libcxx is needed uncondtionally for the headers |
55 |
+LLVM_COMPONENTS=( libcxx{abi,} llvm/cmake/modules ) |
56 |
+llvm.org_set_globals |
57 |
+ |
58 |
+python_check_deps() { |
59 |
+ has_version "dev-python/lit[${PYTHON_USEDEP}]" |
60 |
+} |
61 |
+ |
62 |
+pkg_setup() { |
63 |
+ # darwin prefix builds do not have llvm installed yet, so rely on bootstrap-prefix |
64 |
+ # to set the appropriate path vars to LLVM instead of using llvm_pkg_setup. |
65 |
+ if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then |
66 |
+ llvm_pkg_setup |
67 |
+ fi |
68 |
+ use test && python-any-r1_pkg_setup |
69 |
+} |
70 |
+ |
71 |
+multilib_src_configure() { |
72 |
+ # link against compiler-rt instead of libgcc if we are using clang with libunwind |
73 |
+ local want_compiler_rt=OFF |
74 |
+ if use libunwind && tc-is-clang; then |
75 |
+ local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ |
76 |
+ ${LDFLAGS} -print-libgcc-file-name) |
77 |
+ if [[ ${compiler_rt} == *libclang_rt* ]]; then |
78 |
+ want_compiler_rt=ON |
79 |
+ fi |
80 |
+ fi |
81 |
+ |
82 |
+ local libdir=$(get_libdir) |
83 |
+ local mycmakeargs=( |
84 |
+ -DLIBCXXABI_LIBDIR_SUFFIX=${libdir#lib} |
85 |
+ -DLIBCXXABI_ENABLE_SHARED=ON |
86 |
+ -DLIBCXXABI_ENABLE_STATIC=$(usex static-libs) |
87 |
+ -DLIBCXXABI_USE_LLVM_UNWINDER=$(usex libunwind) |
88 |
+ -DLIBCXXABI_INCLUDE_TESTS=$(usex test) |
89 |
+ -DLIBCXXABI_USE_COMPILER_RT=${want_compiler_rt} |
90 |
+ |
91 |
+ -DLIBCXXABI_LIBCXX_INCLUDES="${WORKDIR}"/libcxx/include |
92 |
+ # upstream is omitting standard search path for this |
93 |
+ # probably because gcc & clang are bundling their own unwind.h |
94 |
+ -DLIBCXXABI_LIBUNWIND_INCLUDES="${EPREFIX}"/usr/include |
95 |
+ ) |
96 |
+ if use test; then |
97 |
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) |
98 |
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" |
99 |
+ |
100 |
+ mycmakeargs+=( |
101 |
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
102 |
+ -DLLVM_LIT_ARGS="$(get_lit_flags);--param=cxx_under_test=${clang_path}" |
103 |
+ -DPython3_EXECUTABLE="${PYTHON}" |
104 |
+ ) |
105 |
+ fi |
106 |
+ cmake_src_configure |
107 |
+} |
108 |
+ |
109 |
+build_libcxx() { |
110 |
+ local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/$(get_libdir)" |
111 |
+ local CMAKE_USE_DIR=${WORKDIR}/libcxx |
112 |
+ local BUILD_DIR=${BUILD_DIR}/libcxx |
113 |
+ local mycmakeargs=( |
114 |
+ -DLIBCXX_LIBDIR_SUFFIX= |
115 |
+ -DLIBCXX_ENABLE_SHARED=OFF |
116 |
+ -DLIBCXX_ENABLE_STATIC=ON |
117 |
+ -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF |
118 |
+ -DLIBCXX_CXX_ABI=libcxxabi |
119 |
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${S}"/include |
120 |
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF |
121 |
+ -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) |
122 |
+ -DLIBCXX_HAS_GCC_S_LIB=OFF |
123 |
+ -DLIBCXX_INCLUDE_TESTS=OFF |
124 |
+ ) |
125 |
+ |
126 |
+ cmake_src_configure |
127 |
+ cmake_src_compile |
128 |
+} |
129 |
+ |
130 |
+multilib_src_test() { |
131 |
+ # build a local copy of libc++ for testing to avoid circular dep |
132 |
+ build_libcxx |
133 |
+ mv "${BUILD_DIR}"/libcxx/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die |
134 |
+ |
135 |
+ local -x LIT_PRESERVES_TMP=1 |
136 |
+ cmake_build check-cxxabi |
137 |
+} |
138 |
+ |
139 |
+multilib_src_install_all() { |
140 |
+ insinto /usr/include/libcxxabi |
141 |
+ doins -r include/. |
142 |
+} |