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-devel/lld/
Date: Sun, 06 Feb 2022 15:35:12
Message-Id: 1644161663.bad28a1b9180133a6f6a64227ba57ec5ba4b356a.mgorny@gentoo
1 commit: bad28a1b9180133a6f6a64227ba57ec5ba4b356a
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 6 15:16:45 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 6 15:34:23 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bad28a1b
7
8 sys-devel/lld: Add 15.x live ebuild
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 sys-devel/lld/lld-15.0.0.9999.ebuild | 73 ++++++++++++++++++++++++++++++++++++
13 1 file changed, 73 insertions(+)
14
15 diff --git a/sys-devel/lld/lld-15.0.0.9999.ebuild b/sys-devel/lld/lld-15.0.0.9999.ebuild
16 new file mode 100644
17 index 000000000000..b57382fbf22d
18 --- /dev/null
19 +++ b/sys-devel/lld/lld-15.0.0.9999.ebuild
20 @@ -0,0 +1,73 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=7
25 +
26 +PYTHON_COMPAT=( python3_{8..10} )
27 +inherit cmake flag-o-matic llvm llvm.org python-any-r1
28 +
29 +DESCRIPTION="The LLVM linker (link editor)"
30 +HOMEPAGE="https://llvm.org/"
31 +
32 +LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
33 +SLOT="0"
34 +KEYWORDS=""
35 +IUSE="debug test"
36 +RESTRICT="!test? ( test )"
37 +
38 +RDEPEND="~sys-devel/llvm-${PV}"
39 +DEPEND="${RDEPEND}"
40 +BDEPEND="
41 + test? (
42 + >=dev-util/cmake-3.16
43 + $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
44 + )"
45 +
46 +LLVM_COMPONENTS=( lld cmake libunwind/include/mach-o )
47 +LLVM_TEST_COMPONENTS=( llvm/utils/{lit,unittest} )
48 +llvm.org_set_globals
49 +
50 +python_check_deps() {
51 + has_version -b "dev-python/lit[${PYTHON_USEDEP}]"
52 +}
53 +
54 +pkg_setup() {
55 + LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
56 + use test && python-any-r1_pkg_setup
57 +}
58 +
59 +src_unpack() {
60 + llvm.org_src_unpack
61 +
62 + # Directory ${WORKDIR}/llvm does not exist with USE="-test",
63 + # but LLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" is set below,
64 + # and ${LLVM_MAIN_SRC_DIR}/../libunwind/include is used by build system
65 + # (lld/MachO/CMakeLists.txt) and is expected to be resolvable
66 + # to existent directory ${WORKDIR}/libunwind/include.
67 + mkdir -p "${WORKDIR}/llvm" || die
68 +}
69 +
70 +src_configure() {
71 + # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
72 + use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
73 +
74 + use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
75 +
76 + local mycmakeargs=(
77 + -DBUILD_SHARED_LIBS=ON
78 + -DLLVM_INCLUDE_TESTS=$(usex test)
79 + -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
80 + )
81 + use test && mycmakeargs+=(
82 + -DLLVM_BUILD_TESTS=ON
83 + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
84 + -DLLVM_LIT_ARGS="$(get_lit_flags)"
85 + -DPython3_EXECUTABLE="${PYTHON}"
86 + )
87 + cmake_src_configure
88 +}
89 +
90 +src_test() {
91 + local -x LIT_PRESERVES_TMP=1
92 + cmake_build check-lld
93 +}