Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcxxabi/
Date: Fri, 05 Aug 2022 19:50:14
Message-Id: 1659728999.8cf12cc8b41e5dd6e96c0942f2c6f626ffb424fe.mgorny@gentoo
1 commit: 8cf12cc8b41e5dd6e96c0942f2c6f626ffb424fe
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 5 19:48:44 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 5 19:49:59 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8cf12cc8
7
8 sys-libs/libcxxabi: Add 16.* live ebuilds
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 sys-libs/libcxxabi/libcxxabi-16.0.0.9999.ebuild | 129 ++++++++++++++++++++++++
13 1 file changed, 129 insertions(+)
14
15 diff --git a/sys-libs/libcxxabi/libcxxabi-16.0.0.9999.ebuild b/sys-libs/libcxxabi/libcxxabi-16.0.0.9999.ebuild
16 new file mode 100644
17 index 000000000000..308024bf9d49
18 --- /dev/null
19 +++ b/sys-libs/libcxxabi/libcxxabi-16.0.0.9999.ebuild
20 @@ -0,0 +1,129 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=8
25 +
26 +CMAKE_ECLASS=cmake
27 +PYTHON_COMPAT=( python3_{8..11} )
28 +inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \
29 + toolchain-funcs
30 +
31 +DESCRIPTION="Low level support for a standard C++ library"
32 +HOMEPAGE="https://libcxxabi.llvm.org/"
33 +
34 +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
35 +SLOT="0"
36 +KEYWORDS=""
37 +IUSE="+clang static-libs test"
38 +REQUIRED_USE="test? ( clang )"
39 +RESTRICT="!test? ( test )"
40 +
41 +# in 15.x, cxxabi.h is moving from libcxx to libcxxabi
42 +RDEPEND+="
43 + !<sys-libs/libcxx-15
44 +"
45 +# llvm-6 for new lit options
46 +DEPEND="
47 + ${RDEPEND}
48 + >=sys-devel/llvm-6
49 +"
50 +BDEPEND="
51 + clang? (
52 + sys-devel/clang
53 + )
54 + !test? (
55 + ${PYTHON_DEPS}
56 + )
57 + test? (
58 + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]')
59 + )
60 +"
61 +
62 +LLVM_COMPONENTS=( runtimes libcxx{abi,} llvm/cmake cmake )
63 +LLVM_TEST_COMPONENTS=( llvm/utils/llvm-lit )
64 +llvm.org_set_globals
65 +
66 +python_check_deps() {
67 + use test || return 0
68 + has_version "dev-python/lit[${PYTHON_USEDEP}]"
69 +}
70 +
71 +pkg_setup() {
72 + # darwin prefix builds do not have llvm installed yet, so rely on bootstrap-prefix
73 + # to set the appropriate path vars to LLVM instead of using llvm_pkg_setup.
74 + if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then
75 + llvm_pkg_setup
76 + fi
77 + python-any-r1_pkg_setup
78 +}
79 +
80 +multilib_src_configure() {
81 + if use clang && ! tc-is-clang; then
82 + # Only do this conditionally to allow overriding with
83 + # e.g. CC=clang-13 in case of breakage
84 + local -x CC=${CHOST}-clang
85 + local -x CXX=${CHOST}-clang++
86 + strip-unsupported-flags
87 + fi
88 +
89 + # link against compiler-rt instead of libgcc if this is what clang does
90 + local want_compiler_rt=OFF
91 + if tc-is-clang; then
92 + local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
93 + ${LDFLAGS} -print-libgcc-file-name)
94 + if [[ ${compiler_rt} == *libclang_rt* ]]; then
95 + want_compiler_rt=ON
96 + fi
97 + fi
98 +
99 + local libdir=$(get_libdir)
100 + local mycmakeargs=(
101 + -DCMAKE_CXX_COMPILER_TARGET="${CHOST}"
102 + -DPython3_EXECUTABLE="${PYTHON}"
103 + -DLLVM_ENABLE_RUNTIMES="libcxxabi;libcxx"
104 + -DLLVM_INCLUDE_TESTS=OFF
105 + -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
106 + -DLIBCXXABI_ENABLE_SHARED=ON
107 + -DLIBCXXABI_ENABLE_STATIC=$(usex static-libs)
108 + -DLIBCXXABI_INCLUDE_TESTS=$(usex test)
109 + -DLIBCXXABI_USE_COMPILER_RT=${want_compiler_rt}
110 +
111 + # upstream is omitting standard search path for this
112 + # probably because gcc & clang are bundling their own unwind.h
113 + -DLIBCXXABI_LIBUNWIND_INCLUDES="${EPREFIX}"/usr/include
114 +
115 + -DLIBCXX_LIBDIR_SUFFIX=
116 + -DLIBCXX_ENABLE_SHARED=ON
117 + -DLIBCXX_ENABLE_STATIC=OFF
118 + -DLIBCXX_CXX_ABI=libcxxabi
119 + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
120 + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
121 + -DLIBCXX_HAS_GCC_S_LIB=OFF
122 + -DLIBCXX_INCLUDE_BENCHMARKS=OFF
123 + -DLIBCXX_INCLUDE_TESTS=OFF
124 + )
125 + if use test; then
126 + local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
127 + [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
128 +
129 + mycmakeargs+=(
130 + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
131 + -DLLVM_LIT_ARGS="$(get_lit_flags)"
132 + -DPython3_EXECUTABLE="${PYTHON}"
133 + )
134 + fi
135 + cmake_src_configure
136 +}
137 +
138 +multilib_src_compile() {
139 + cmake_build cxxabi
140 +}
141 +
142 +multilib_src_test() {
143 + local -x LIT_PRESERVES_TMP=1
144 + cmake_build check-cxxabi
145 +}
146 +
147 +multilib_src_install() {
148 + DESTDIR="${D}" cmake_build install-cxxabi
149 +}