1 |
|
# Copyright 1999-2024 Gentoo Authors
|
|
1 |
# Copyright 1999-2025 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
PYTHON_COMPAT=( python3_{10..11} )
|
7 |
|
inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \
|
8 |
|
toolchain-funcs
|
|
6 |
PYTHON_COMPAT=( python3_{10..13} )
|
|
7 |
inherit cmake-multilib flag-o-matic llvm.org llvm-utils python-any-r1
|
|
8 |
inherit toolchain-funcs
|
9 |
9 |
|
10 |
10 |
DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
|
11 |
11 |
HOMEPAGE="https://libcxx.llvm.org/"
|
12 |
12 |
|
13 |
13 |
LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
|
14 |
14 |
SLOT="0"
|
15 |
|
KEYWORDS="amd64 arm arm64 ~riscv sparc x86 ~x64-macos"
|
|
15 |
KEYWORDS="amd64 arm arm64 ~loong ~riscv sparc x86 ~arm64-macos ~x64-macos"
|
16 |
16 |
IUSE="+clang +libcxxabi +static-libs test"
|
17 |
17 |
REQUIRED_USE="test? ( clang )"
|
18 |
18 |
RESTRICT="!test? ( test )"
|
... | ... | |
41 |
41 |
"
|
42 |
42 |
|
43 |
43 |
LLVM_COMPONENTS=( runtimes libcxx{,abi} llvm/{cmake,utils/llvm-lit} cmake )
|
44 |
|
LLVM_PATCHSET=${PV}-r1
|
45 |
44 |
llvm.org_set_globals
|
46 |
45 |
|
47 |
46 |
python_check_deps() {
|
... | ... | |
50 |
49 |
}
|
51 |
50 |
|
52 |
51 |
pkg_setup() {
|
53 |
|
# Darwin Prefix builds do not have llvm installed yet, so rely on
|
54 |
|
# bootstrap-prefix to set the appropriate path vars to LLVM instead
|
55 |
|
# of using llvm_pkg_setup.
|
56 |
|
if [[ ${CHOST} != *-darwin* ]] || has_version llvm-core/llvm; then
|
57 |
|
LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
|
58 |
|
fi
|
59 |
52 |
python-any-r1_pkg_setup
|
60 |
53 |
|
61 |
54 |
if ! use libcxxabi && ! tc-is-gcc ; then
|
... | ... | |
72 |
65 |
}
|
73 |
66 |
|
74 |
67 |
src_configure() {
|
|
68 |
llvm_prepend_path "${LLVM_MAJOR}"
|
|
69 |
|
75 |
70 |
# note: we need to do this before multilib kicks in since it will
|
76 |
71 |
# alter the CHOST
|
77 |
72 |
local cxxabi cxxabi_incs
|
... | ... | |
121 |
116 |
-DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
|
122 |
117 |
# we're using our own mechanism for generating linker scripts
|
123 |
118 |
-DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
|
124 |
|
-DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
|
|
119 |
-DLIBCXX_HAS_MUSL_LIBC=$(llvm_cmake_use_musl)
|
125 |
120 |
-DLIBCXX_INCLUDE_BENCHMARKS=OFF
|
126 |
121 |
-DLIBCXX_INCLUDE_TESTS=$(usex test)
|
|
122 |
-DLIBCXX_INSTALL_MODULES=ON
|
127 |
123 |
-DLIBCXX_USE_COMPILER_RT=${use_compiler_rt}
|
|
124 |
# this is broken with standalone builds, and also meaningless
|
|
125 |
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF
|
128 |
126 |
)
|
129 |
127 |
|
130 |
128 |
if use test; then
|