# -*- 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           muniversal 1.1

github.setup        dlang dub 1.43.0 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
categories          devel
license             GPL-3
maintainers         {gmail.com:ppadil @papadil}  openmaintainer
description         Package and build management system for D
long_description    Package and build manager for D applications and libraries.

depends_lib         port:ldc

checksums           rmd160  dcaa128f24ee9da346a4d8f1987e1affdb2f2a9d \
                    sha256  44bc2371ce27079f39b3c02932946184291f2094c48a1fa90b0452b8e8738084 \
                    size    1571055

use_configure       no
build.cmd           ldmd2
build.args          -run build.d -O -inline
build.env           DMD=ldmd2
build.target

if {${muniversal.build_arch} eq "i386"} {
    build.pre_args -O -inline -m32
} elseif {${muniversal.build_arch} eq "ppc"} {
    build.pre_args -O -inline -m32
} else {
    # arm64, x86_64, ppc64
    build.pre_args -O -inline -m64
}

destroot {
    xinstall -d -m 0755 ${destroot}${prefix}/share/bash-completion/completions
    xinstall -m 0644 ${worksrcpath}/scripts/bash-completion/dub.bash ${destroot}${prefix}/share/bash-completion/completions

    xinstall -m 0755 ${worksrcpath}/bin/dub ${destroot}${prefix}/bin

    xinstall -d -m 0755 ${destroot}${prefix}/share/${name}
    copy ${worksrcpath}/examples ${destroot}${prefix}/share/dub
}

github.livecheck.regex  {([^"rba]+)}
