# -*- 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
# version should be same as HOST_DMD_VER found in posix.mak from dmd port
license {GPL-1 Artistic-1} Boost-1 Restrictive
maintainers {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
description dmd Digital Mars D bootstrap compiler
This is a package that installs a binary \
homepage http://dlang.org/
master_sites http://downloads.dlang.org/releases/2.x/${version}
# prebuilt binary uses libstdc++
configure.cxx_stdlib libstdc++
distfiles dmd.${version}.osx${extract.suffix}
checksums rmd160 9f8cc6bb1b4171271cd5a8013cdbc85f63ca93cb \
sha256 e0d87d264e06155b695436bfc38df87cf133f2c63c279906ec648f24f6bb2207
xinstall -d -m 0755 ${destroot}${prefix}/libexec/${name}/bin
xinstall -d -m 0755 ${destroot}${prefix}/libexec/${name}/lib
xinstall -d -m 0755 ${destroot}${prefix}/libexec/${name}/include/druntime
xinstall -d -m 0755 ${destroot}${prefix}/libexec/${name}/include/phobos
# only install the one program needed to bootstrap dmd
-W ${worksrcpath}/osx/bin \
${destroot}${prefix}/libexec/${name}/bin
# install runtime environment
file copy ${worksrcpath}/src/druntime/import ${destroot}${prefix}/libexec/${name}/include/druntime
file copy ${worksrcpath}/src/phobos/etc ${destroot}${prefix}/libexec/${name}/include/phobos
file copy ${worksrcpath}/src/phobos/std ${destroot}${prefix}/libexec/${name}/include/phobos
{*}[glob ${worksrcpath}/src/phobos/*.d] ${destroot}${prefix}/libexec/${name}/include/phobos
-W ${worksrcpath}/osx/lib \
${destroot}${prefix}/libexec/${name}/lib
# install configuration file
set conf [open ${destroot}${prefix}/libexec/${name}/bin/dmd.conf w]
puts ${conf} "\[Environment\]