mold => 2.32 (#9937)

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
Satadru Pramanik, DO, MPH, MEng
2024-06-09 21:14:50 -04:00
committed by GitHub
parent fa87366619
commit fe15672037

View File

@@ -1,12 +1,12 @@
# Adapted from Arch Linux mold PKGBUILD at:
# https://github.com/archlinux/svntogit-community/raw/packages/mold/trunk/PKGBUILD
require 'package'
require 'buildsystems/cmake'
class Mold < Package
class Mold < CMake
description 'A Modern Linker'
homepage 'https://github.com/rui314/mold'
version '2.31.0'
version '2.32.0'
license 'MIT'
compatibility 'all'
source_url 'https://github.com/rui314/mold.git'
@@ -14,10 +14,10 @@ class Mold < Package
binary_compression 'tar.zst'
binary_sha256({
aarch64: '677813fbb16364c9c199dfe9923f94fce929492cd713c13d03ec75e169224b7a',
armv7l: '677813fbb16364c9c199dfe9923f94fce929492cd713c13d03ec75e169224b7a',
i686: 'bdc22bd3b22f84fbd622a7cb006d76052b9b03e03f7a7c3cffce092d284b8ff7',
x86_64: '3fb317bfa36dacfca24d1670e8fc66aed3828738b4c6da276075b8ea9e83a6cf'
aarch64: '44c82428bcf5b1d900c110650d41ccf562d3abfe486b68859cc96a386f511e05',
armv7l: '44c82428bcf5b1d900c110650d41ccf562d3abfe486b68859cc96a386f511e05',
i686: '50a97904e5db1d857f4390506ddfcf875c9699879ac2fbaeb55154a26e90dbe8',
x86_64: 'ba8e8d65a0e65debac4a122ab25ea64619958a34ebed361d9073a0da0c74dff6'
})
depends_on 'gcc_lib' # R
@@ -30,17 +30,13 @@ class Mold < Package
no_env_options
print_source_bashrc
def self.build
# TBB build option due to
# https://github.com/oneapi-src/oneTBB/issues/843#issuecomment-1152646035
system "cmake -B builddir #{CREW_CMAKE_OPTIONS} \
-DBUILD_TESTING=OFF \
cmake_options "-DBUILD_TESTING=OFF \
-DMOLD_LTO=ON \
-DMOLD_USE_MOLD=ON \
-DTBB_WARNING_LEVEL='-Wno-error=stringop-overflow' \
-Wno-dev \
-G Ninja"
system "#{CREW_NINJA} -C builddir"
-DTBB_WARNING_LEVEL='-Wno-error=stringop-overflow'"
def self.install
system "DESTDIR=#{CREW_DEST_DIR} #{CREW_NINJA} -C builddir install"
File.write 'moldenv', <<~MOLD_ENV_EOF
# See https://github.com/rui314/mold/commit/36fc0655489eb96e1be15b03b3f5e227cd97a22e
if [[ $(free | head -n 2 | tail -n 1 | awk '{print $4}') -gt '4096000' ]]; then
@@ -49,10 +45,6 @@ class Mold < Package
MOLD_JOBS=1
fi
MOLD_ENV_EOF
end
def self.install
system "DESTDIR=#{CREW_DEST_DIR} #{CREW_NINJA} -C builddir install"
FileUtils.install 'moldenv', "#{CREW_DEST_PREFIX}/etc/env.d/mold", mode: 0o644
end
end