1 |
commit: 4495b033019972f827a3a7ddbb7a78d7ab2ca22d |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 16 13:50:17 2019 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 16 14:52:35 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4495b033 |
7 |
|
8 |
sys-libs/libcxxabi: Add a live ebuild for 8.* branch |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-libs/libcxxabi/libcxxabi-8.0.9999.ebuild | 122 +++++++++++++++++++++++++++ |
13 |
1 file changed, 122 insertions(+) |
14 |
|
15 |
diff --git a/sys-libs/libcxxabi/libcxxabi-8.0.9999.ebuild b/sys-libs/libcxxabi/libcxxabi-8.0.9999.ebuild |
16 |
new file mode 100644 |
17 |
index 00000000000..d97e01f1e82 |
18 |
--- /dev/null |
19 |
+++ b/sys-libs/libcxxabi/libcxxabi-8.0.9999.ebuild |
20 |
@@ -0,0 +1,122 @@ |
21 |
+# Copyright 1999-2019 Gentoo Authors |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+ |
24 |
+EAPI=6 |
25 |
+ |
26 |
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja} |
27 |
+# (needed due to CMAKE_BUILD_TYPE != Gentoo) |
28 |
+CMAKE_MIN_VERSION=3.7.0-r1 |
29 |
+PYTHON_COMPAT=( python2_7 ) |
30 |
+ |
31 |
+inherit cmake-multilib git-r3 llvm multiprocessing python-any-r1 |
32 |
+ |
33 |
+DESCRIPTION="Low level support for a standard C++ library" |
34 |
+HOMEPAGE="https://libcxxabi.llvm.org/" |
35 |
+SRC_URI="" |
36 |
+EGIT_REPO_URI="https://git.llvm.org/git/libcxxabi.git |
37 |
+ https://github.com/llvm-mirror/libcxxabi.git" |
38 |
+EGIT_BRANCH="release_80" |
39 |
+ |
40 |
+LICENSE="|| ( UoI-NCSA MIT )" |
41 |
+SLOT="0" |
42 |
+KEYWORDS="" |
43 |
+IUSE="+libunwind +static-libs test elibc_musl" |
44 |
+RESTRICT="!test? ( test )" |
45 |
+ |
46 |
+RDEPEND=" |
47 |
+ libunwind? ( |
48 |
+ || ( |
49 |
+ >=sys-libs/libunwind-1.0.1-r1[static-libs?,${MULTILIB_USEDEP}] |
50 |
+ >=sys-libs/llvm-libunwind-3.9.0-r1[static-libs?,${MULTILIB_USEDEP}] |
51 |
+ ) |
52 |
+ )" |
53 |
+# llvm-6 for new lit options |
54 |
+DEPEND="${RDEPEND} |
55 |
+ >=sys-devel/llvm-6 |
56 |
+ test? ( >=sys-devel/clang-3.9.0 |
57 |
+ $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )" |
58 |
+ |
59 |
+# least intrusive of all |
60 |
+CMAKE_BUILD_TYPE=RelWithDebInfo |
61 |
+ |
62 |
+python_check_deps() { |
63 |
+ has_version "dev-python/lit[${PYTHON_USEDEP}]" |
64 |
+} |
65 |
+ |
66 |
+pkg_setup() { |
67 |
+ llvm_pkg_setup |
68 |
+ use test && python-any-r1_pkg_setup |
69 |
+} |
70 |
+ |
71 |
+src_unpack() { |
72 |
+ # we need the headers |
73 |
+ git-r3_fetch "https://git.llvm.org/git/libcxx.git |
74 |
+ https://github.com/llvm-mirror/libcxx.git" |
75 |
+ git-r3_fetch |
76 |
+ |
77 |
+ git-r3_checkout https://llvm.org/git/libcxx.git \ |
78 |
+ "${WORKDIR}"/libcxx '' |
79 |
+ git-r3_checkout |
80 |
+} |
81 |
+ |
82 |
+multilib_src_configure() { |
83 |
+ local libdir=$(get_libdir) |
84 |
+ local mycmakeargs=( |
85 |
+ -DLIBCXXABI_LIBDIR_SUFFIX=${libdir#lib} |
86 |
+ -DLIBCXXABI_ENABLE_SHARED=ON |
87 |
+ -DLIBCXXABI_ENABLE_STATIC=$(usex static-libs) |
88 |
+ -DLIBCXXABI_USE_LLVM_UNWINDER=$(usex libunwind) |
89 |
+ -DLIBCXXABI_INCLUDE_TESTS=$(usex test) |
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 |
+ local jobs=${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")} |
99 |
+ |
100 |
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" |
101 |
+ |
102 |
+ mycmakeargs+=( |
103 |
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" |
104 |
+ -DLLVM_LIT_ARGS="-vv;-j;${jobs};--param=cxx_under_test=${clang_path}" |
105 |
+ ) |
106 |
+ fi |
107 |
+ cmake-utils_src_configure |
108 |
+} |
109 |
+ |
110 |
+build_libcxx() { |
111 |
+ local -x LDFLAGS="${LDFLAGS} -L${BUILD_DIR}/$(get_libdir)" |
112 |
+ local CMAKE_USE_DIR=${WORKDIR}/libcxx |
113 |
+ local BUILD_DIR=${BUILD_DIR}/libcxx |
114 |
+ local mycmakeargs=( |
115 |
+ -DLIBCXX_LIBDIR_SUFFIX= |
116 |
+ -DLIBCXX_ENABLE_SHARED=ON |
117 |
+ -DLIBCXX_ENABLE_STATIC=OFF |
118 |
+ -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF |
119 |
+ -DLIBCXX_CXX_ABI=libcxxabi |
120 |
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS="${S}"/include |
121 |
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF |
122 |
+ -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) |
123 |
+ -DLIBCXX_HAS_GCC_S_LIB=OFF |
124 |
+ -DLIBCXX_INCLUDE_TESTS=OFF |
125 |
+ ) |
126 |
+ |
127 |
+ cmake-utils_src_configure |
128 |
+ cmake-utils_src_compile |
129 |
+} |
130 |
+ |
131 |
+multilib_src_test() { |
132 |
+ # build a local copy of libc++ for testing to avoid circular dep |
133 |
+ build_libcxx |
134 |
+ mv "${BUILD_DIR}"/libcxx/lib/libc++* "${BUILD_DIR}/$(get_libdir)/" || die |
135 |
+ |
136 |
+ cmake-utils_src_make check-libcxxabi |
137 |
+} |
138 |
+ |
139 |
+multilib_src_install_all() { |
140 |
+ insinto /usr/include/libcxxabi |
141 |
+ doins -r include/. |
142 |
+} |