# -*- 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           github 1.0
PortGroup           cmake 1.1

github.setup        ldc-developers ldc 1.43.0 v
revision            0
categories          lang
supported_archs     arm64 x86_64
license             BSD
maintainers         {makr @mohd-akram} openmaintainer

description         LLVM-based D Compiler

long_description    The LDC project provides a portable D programming language \
                    compiler with modern optimization and code generation \
                    capabilities.

distname            ${distname}-src

set bootstrap       ldc2-${version}-osx-universal
distfiles-append    ${bootstrap}.tar.xz

checksums           ${distname}${extract.suffix} \
                    rmd160  aa885c3681655d8ac0d8c181f9411f04c87ac46f \
                    sha256  d655aad0daf0ce9a17b2ffffb947bb79ec6968bc7fb88bc918316dbe78c616e7 \
                    size    9185104 \
                    ${bootstrap}.tar.xz \
                    rmd160  7763a83f26d3409c2ebddd32eb208fca2ddcd6b6 \
                    sha256  2ad786f17e0a31b985c362980762a17ef143101488cacf4a253612bff40a72d2 \
                    size    171966180

depends_lib         port:llvm-22

compiler.limit_flags    yes

cmake.prefix_path   ${prefix}/libexec/llvm-22

configure.env       DMD=${workpath}/${bootstrap}/bin/ldmd2
configure.args      -DLDC_WITH_LLD=OFF

github.livecheck.regex  {([0-9.]+)}
