Files
chromebrew/packages/mold.rb
Satadru Pramanik, DO, MPH, MEng ddd99a6e58 Update some packages with incomplete binary hash sections. — alive → 2.0.5,core,mold → 2.40.4,pkg_7_zip → 25.01,py3_asciidoc → 10.2.1,ruby → 3.4.5-07f783 (#12726)
* Update some packages with incomplete binary hash sections.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add mold to anitya set.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* mold => 2.40.4

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add 7z update.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* py3_cleanup: Build Run on linux/arm/v7.

* py3_cleanup: Build Run on linux/amd64.

* py3_cleanup: Build Run on linux/386.

* py3_cleanup: Package File Update Run on linux/386 container.

* py3_cleanup: Package File Update Run on linux/amd64 container.

* py3_cleanup: Package File Update Run on linux/arm/v7 container.

* revert py3_zcmd changes

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Print directory contents if not empty during install.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Bump version.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* lint

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust crew-mvdir logic to be verbose if erroring.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust debugging code, and fixup color in outputs.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Do not update gems on every crew update.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* last_update_check => @last_update_check

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Handle crew-mvdir errors with rsync fallback.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add message if crew-mvdir errors with rsync fallback.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add more reporting for broken installs.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Use verbose output if rsync fails.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Use rsync force as fallback.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Move workflows to use M139-based container images.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add workaround for ruby install race condition.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* lint

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: satmandu <satmandu@users.noreply.github.com>
Co-authored-by: chromebrew-actions[bot] <chromebrew-actions[bot]@users.noreply.github.com>
2025-09-11 18:00:18 +00:00

50 lines
1.5 KiB
Ruby

# Adapted from Arch Linux mold PKGBUILD at:
# https://github.com/archlinux/svntogit-community/raw/packages/mold/trunk/PKGBUILD
require 'buildsystems/cmake'
class Mold < CMake
description 'A Modern Linker'
homepage 'https://github.com/rui314/mold'
version '2.40.4'
license 'MIT'
compatibility 'all'
source_url 'https://github.com/rui314/mold.git'
git_hashtag "v#{version}"
binary_compression 'tar.zst'
binary_sha256({
aarch64: '4a5f55f801de04d8339258b6d8af6a9b73b9714c8ed68722ea33b750271bf318',
armv7l: '4a5f55f801de04d8339258b6d8af6a9b73b9714c8ed68722ea33b750271bf318',
i686: '2716eee84ed34d89bedd5e6e2ade684afb1062ae11730305503a9b21a79a4920',
x86_64: '242683345b0f34efca645d37989bc903db613029082b8a70fc145ff79adfcf6f'
})
depends_on 'gcc_lib' # R
depends_on 'glibc' # R
depends_on 'xxhash' => :build
depends_on 'zlib' # R
depends_on 'zstd' # R
no_env_options
print_source_bashrc
cmake_options "-DBUILD_TESTING=OFF \
-DMOLD_LTO=ON \
-DMOLD_USE_MOLD=ON \
-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
unset MOLD_JOBS
else
MOLD_JOBS=1
fi
MOLD_ENV_EOF
FileUtils.install 'moldenv', "#{CREW_DEST_PREFIX}/etc/env.d/mold", mode: 0o644
end
end