commit:     10ddac7e8fde4c3f9cbf7bd4faf2c79f3b7b7101
Author:     Brett A C Sheffield <bacs <AT> librecast <DOT> net>
AuthorDate: Thu Mar  5 09:21:24 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar  8 04:16:29 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10ddac7e

sys-devel/mold: update live ebuild

Bring live ebuild into line with 2.40.4-r2 changes.

Signed-off-by: Brett A C Sheffield <bacs <AT> librecast.net>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/219
Merges: https://codeberg.org/gentoo/gentoo/pulls/219
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/mold/mold-9999.ebuild | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/sys-devel/mold/mold-9999.ebuild b/sys-devel/mold/mold-9999.ebuild
index b4b96bcd6507..b62fb065db83 100644
--- a/sys-devel/mold/mold-9999.ebuild
+++ b/sys-devel/mold/mold-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2021-2025 Gentoo Authors
+# Copyright 2021-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -12,7 +12,8 @@ if [[ ${PV} == 9999 ]] ; then
        inherit git-r3
 else
        SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz"
-       # -alpha: 
https://github.com/rui314/mold/commit/3711ddb95e23c12991f6b8c7bfeba4f1421d19d4
+       # -alpha: alpha support was dropped upstream:
+       # 
https://github.com/rui314/mold/commit/3711ddb95e23c12991f6b8c7bfeba4f1421d19d4
        KEYWORDS="-alpha ~amd64 ~arm ~arm64 ~loong ~ppc ~riscv ~sparc ~x86"
 fi
 
@@ -21,20 +22,24 @@ fi
 #  - siphash ( MIT CC0-1.0 )
 LICENSE="MIT BSD-2 CC0-1.0"
 SLOT="0"
-IUSE="debug test"
+IUSE="debug mimalloc test"
+
 RESTRICT="!test? ( test )"
 
 RDEPEND="
        app-arch/zstd:=
        >=dev-cpp/tbb-2021.7.0-r1:=
        dev-libs/blake3:=
+       dev-libs/xxhash:=
        virtual/zlib:=
-       !kernel_Darwin? (
-               >=dev-libs/mimalloc-2:=
-       )
+       mimalloc? ( >=dev-libs/mimalloc-2:= )
 "
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.40.4-as-needed-group.patch
+)
+
 pkg_pretend() {
        # Requires a c++20 compiler, see #831473
        if [[ ${MERGE_TYPE} != binary ]]; then
@@ -47,8 +52,17 @@ pkg_pretend() {
 }
 
 src_prepare() {
+       # remove unused vendored deps to be sure we don't use them
+       # do this before running cmake_src_prepare to avoid warnings
+       # being picked up by tinderbox etc. (#964723)
+       # we keep rust-demangle for now as this isn't packaged in gentoo
+       rm -rf third-party/{blake3,mimalloc,tbb,xxhash,zlib,zstd} || die
+
        cmake_src_prepare
 
+       # use dev-libs/xxhash instead of vendored lib
+       sed -i 's#../third-party/xxhash/##' lib/lib.h || die
+
        # Needs unpackaged dwarfdump
        rm test/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die
 
@@ -81,8 +95,8 @@ src_configure() {
        local mycmakeargs=(
                -DBUILD_TESTING=$(usex test)
                -DMOLD_LTO=OFF # Should be up to the user to decide this with 
CXXFLAGS.
-               -DMOLD_USE_MIMALLOC=$(usex !kernel_Darwin)
-               -DMOLD_USE_SYSTEM_MIMALLOC=ON
+               -DMOLD_USE_MIMALLOC=$(usex mimalloc)
+               -DMOLD_USE_SYSTEM_MIMALLOC=$(usex mimalloc)
                -DMOLD_USE_SYSTEM_TBB=ON
        )
 

Reply via email to