#!/bin/mkpkg
# description: A modern parallel linker
# url: https://github.com/rui314/mold

name=mold
version=2.41.0
release=1
depends=(zlib zstd libressl)
makedeps=(cmake ninja python3)
source=(https://github.com/rui314/mold/archive/refs/tags/v$version.tar.gz)
renames=(${name}-${version}.tar.gz)
sha256sums=(
    "0a61abac85d818437b425df856822e9d6e9982baeae5a93bcb02fe6c0060c61a"
)

build() {
    cd $name-$version
    
    cmake -B build -G Ninja -Wno-dev \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_C_COMPILER=clang \
        -DCMAKE_CXX_COMPILER=clang++ \
        -DMOLD_TARGETS="X86_64" \
        -DMOLD_USE_MIMALLOC=OFF \
        -DMOLD_USE_SYSTEM_TBB=OFF \
        -DMOLD_LTO=OFF
    
    ninja -C build
    DESTDIR=$PKG ninja -C build install
    
    rm -rf $PKG/usr/share/doc
}

signify() {
    untrusted comment: public key
    RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
}

# vim: filetype=sh
