# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           cmake 1.1
PortGroup           github 1.0
PortGroup           legacysupport 1.1

# Systems before Big Sur have no support for std::endian
legacysupport.newest_darwin_requires_legacy 19
legacysupport.use_mp_libcxx yes

github.setup        rui314 mold 1.7.1 v
github.tarball_from archive
revision            0

license             AGPL-3
categories          devel
maintainers         {@crowell crowell.biz:jeff} openmaintainer
description         A modern linker.
long_description    ${name} is a faster drop-in replacement for existing \
                    Unix linkers. It is several times faster than the LLVM \
                    lld linker, the second-fastest open-source linker which \
                    ${name} is designed to increase developer productivity \
                    by reducing build time, especially in rapid \
                    debug-edit-rebuild cycles.
checksums           rmd160  bc942fd6cc81158fd46af3918ad1819ee41a84fc \
                    sha256  fa2558664db79a1e20f09162578632fa856b3cde966fbcb23084c352b827dfa9 \
                    size    8381932

compiler.cxx_standard \
                    2020
# fails on Mojave/Catalina
compiler.blacklist-append \
                    {clang < 1300}

# _task.h:216:13: error: aligned deallocation function
# of type 'void (void *, std::align_val_t) noexcept'
# is only available on macOS 10.13 or newer
if {${os.platform} eq "darwin" && ${os.major} <= 16} {
    configure.cxxflags-append -fno-aligned-allocation
}

# macOS support and its codebase has been moved
# to the commercial version.
# https://github.com/rui314/mold/releases/tag/v1.8.0
livecheck.type          none
