Gentoo Archives: gentoo-commits

From: Matthew Smith <matthew@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/
Date: Fri, 19 Aug 2022 17:56:05
Message-Id: 1660931718.3ea682897a3b3bd80ebe261170c0fec3ac04e985.matthew@gentoo
1 commit: 3ea682897a3b3bd80ebe261170c0fec3ac04e985
2 Author: Matthew Smith <matthew <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 19 17:54:48 2022 +0000
4 Commit: Matthew Smith <matthew <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 19 17:55:18 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ea68289
7
8 sys-devel/mold: update live ebuild
9
10 Signed-off-by: Matthew Smith <matthew <AT> gentoo.org>
11
12 sys-devel/mold/mold-9999.ebuild | 76 ++++++++++++++++++++---------------------
13 1 file changed, 38 insertions(+), 38 deletions(-)
14
15 diff --git a/sys-devel/mold/mold-9999.ebuild b/sys-devel/mold/mold-9999.ebuild
16 index 2a7faac5052d..b170b570b827 100644
17 --- a/sys-devel/mold/mold-9999.ebuild
18 +++ b/sys-devel/mold/mold-9999.ebuild
19 @@ -3,7 +3,7 @@
20
21 EAPI=8
22
23 -inherit toolchain-funcs
24 +inherit cmake toolchain-funcs
25
26 DESCRIPTION="A Modern Linker"
27 HOMEPAGE="https://github.com/rui314/mold"
28 @@ -12,28 +12,26 @@ if [[ ${PV} == 9999 ]] ; then
29 inherit git-r3
30 else
31 SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
32 - KEYWORDS="~amd64"
33 + KEYWORDS="~amd64 ~riscv"
34 fi
35
36 -LICENSE="AGPL-3"
37 +# mold (AGPL-3)
38 +# - xxhash (BSD-2)
39 +# - tbb (Apache-2.0)
40 +LICENSE="AGPL-3 Apache-2.0 BSD-2"
41 SLOT="0"
42 +IUSE="system-tbb"
43
44 -RDEPEND=">=dev-cpp/tbb-2021.4.0:=
45 +RDEPEND="
46 sys-libs/zlib
47 + system-tbb? ( >=dev-cpp/tbb-2021.4.0:= )
48 !kernel_Darwin? (
49 >=dev-libs/mimalloc-2:=
50 dev-libs/openssl:=
51 - )"
52 -# As of 1.1, xxhash is now a header-only dep, but it's now bundled :(
53 -# TODO: restore SYSTEM_XXHASH upstream?
54 + )
55 +"
56 DEPEND="${RDEPEND}"
57
58 -PATCHES=(
59 - # Bug #841575
60 - "${FILESDIR}"/${PN}-1.2.1-install-nopython.patch
61 - "${FILESDIR}"/${PN}-1.3.0-openssl-pkgconfig.patch
62 -)
63 -
64 pkg_pretend() {
65 # Requires a c++20 compiler, see #831473
66 if [[ ${MERGE_TYPE} != binary ]]; then
67 @@ -46,7 +44,7 @@ pkg_pretend() {
68 }
69
70 src_prepare() {
71 - default
72 + cmake_src_prepare
73
74 # Needs unpackaged dwarfdump
75 rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die
76 @@ -64,34 +62,36 @@ src_prepare() {
77 if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then
78 rm test/elf/{,ifunc-}static-pie.sh || die
79 fi
80 -}
81 -
82 -src_compile() {
83 - tc-export CC CXX
84
85 - emake \
86 - CFLAGS="${CFLAGS}" \
87 - CXXFLAGS="${CXXFLAGS}" \
88 - SYSTEM_TBB=1 \
89 - SYSTEM_MIMALLOC=1 \
90 - STRIP="true" \
91 - LIBDIR="${EPREFIX}/usr/$(get_libdir)"
92 + # Don't require python
93 + sed -i '/find_package(Python3/d' CMakeLists.txt || die
94 + sed -i '/add_dependencies/d' CMakeLists.txt || die
95 + cat <<EOF>git-hash.cc
96 +#include <string>
97 +namespace mold {
98 +std::string mold_git_hash = "gentoo-${PVR}";
99 +}
100 +EOF
101 }
102
103 -src_test() {
104 - emake \
105 - SYSTEM_TBB=1 \
106 - SYSTEM_MIMALLOC=1 \
107 - check
108 +src_configure() {
109 + local mycmakeargs=(
110 + -DMOLD_ENABLE_QEMU_TESTS=OFF
111 + -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS.
112 + -DMOLD_USE_SYSTEM_MIMALLOC=ON
113 + -DMOLD_USE_SYSTEM_TBB=$(usex system-tbb)
114 + )
115 + cmake_src_configure
116 }
117
118 src_install() {
119 - emake \
120 - SYSTEM_TBB=1 \
121 - SYSTEM_MIMALLOC=1 \
122 - DESTDIR="${D}" \
123 - PREFIX="${EPREFIX}/usr" \
124 - LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
125 - STRIP="true" \
126 - install
127 + dobin "${BUILD_DIR}"/${PN}
128 + dolib.so "${BUILD_DIR}"/${PN}-wrapper.so
129 +
130 + dodoc docs/{design,execstack}.md
131 + doman docs/${PN}.1
132 +
133 + dosym ${PN} /usr/bin/ld.${PN}
134 + dosym ${PN} /usr/bin/ld64.${PN}
135 + dosym ../../../usr/bin/${PN} /usr/libexec/${PN}/ld
136 }