[92688] trunk/dports/lang

takeshi at macports.org takeshi at macports.org
Thu May 3 15:51:31 PDT 2012


Revision: 92688
          https://trac.macports.org/changeset/92688
Author:   takeshi at macports.org
Date:     2012-05-03 15:51:31 -0700 (Thu, 03 May 2012)
Log Message:
-----------
dmd, druntime phobos, dmd-tools: adding Digital Mars D compiler

Added Paths:
-----------
    trunk/dports/lang/dmd/
    trunk/dports/lang/dmd/Portfile
    trunk/dports/lang/dmd/files/
    trunk/dports/lang/dmd/files/patch-mars.c.diff
    trunk/dports/lang/dmd-tools/
    trunk/dports/lang/dmd-tools/Portfile
    trunk/dports/lang/druntime/
    trunk/dports/lang/druntime/Portfile
    trunk/dports/lang/phobos/
    trunk/dports/lang/phobos/Portfile

Added: trunk/dports/lang/dmd/Portfile
===================================================================
--- trunk/dports/lang/dmd/Portfile	                        (rev 0)
+++ trunk/dports/lang/dmd/Portfile	2012-05-03 22:51:31 UTC (rev 92688)
@@ -0,0 +1,84 @@
+# -*- 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
+# $Id$
+
+PortSystem          1.0
+PortGroup           github 1.0
+
+set dlang           D-Programming-Language
+github.setup        ${dlang} dmd 2.059 v
+categories          lang
+platforms           darwin
+supported_archs     i386 x86_64
+license             {GPL-1 Artistic DMD}
+maintainers         takeshi openmaintainer
+description         dmd Digital Mars D compiler
+long_description \
+    D is a language with C-like syntax and static typing. \
+    It pragmatically combines efficiency, control, \
+    and modeling power, with safety and programmer productivity.
+homepage            http://dlang.org/
+set dbranch         3987c7
+distname            ${dlang}-${name}-v${version}-0-g${dbranch}
+checksums           rmd160  04e7f0cfa07e94e9ca567d5276d3c633d614f08c \
+                    sha256  ea6aa0f5f5428a9e36b18569a6948a85cfec8295b2a1947637f8449835a82eff
+
+worksrcdir          ${name}
+
+patchfiles          patch-mars.c.diff
+
+post-patch {
+    reinplace "s|gcc|${configure.cc}|" ${worksrcpath}/src/posix.mak
+    reinplace "s|gcc|${configure.cc}|" ${worksrcpath}/src/link.c
+    reinplace "s|-m\$(MODEL)||" ${worksrcpath}/src/posix.mak
+    reinplace "s|/etc|${prefix}/etc/${name}|" ${worksrcpath}/src/inifile.c
+    reinplace "s|/etc|${prefix}/etc/${name}|" ${worksrcpath}/docs/man/man1/${name}.1
+    reinplace "s|/etc|${prefix}/etc/${name}|" ${worksrcpath}/docs/man/man1/${name}.conf.5
+}
+
+use_configure       no
+
+configure.cppflags-append \
+                    -Wno-deprecated -Wstrict-aliasing
+configure.cxxflags-append \
+                    -Iroot -fno-exceptions -x c++\
+                    -D__pascal= -DMARS=1 -DTARGET_OSX=1
+
+pre-build {
+    worksrcdir      ${name}/src
+}
+build.args          -f posix.mak \
+                    HOST_CC=${configure.cxx} \
+                    CC=\"${configure.cxx}\" \
+                    CFLAGS=\"${configure.cxxflags}\" \
+                    MFLAGS=\"${configure.cxxflags} -Ibackend -Itk\" \
+                    LDFLAGS=\"${configure.ldflags} -lstdc++ -framework CoreServices\" \
+                    ENVP=\"MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target}\"
+
+destroot {
+    worksrcdir      ${name}/src
+# man
+    xinstall -m 644 -W ${workpath}/dmd/docs/man/man1 \
+        dmd.1 dumpobj.1 obj2asm.1 rdmd.1 \
+        ${destroot}${prefix}/share/man/man1
+    xinstall -m 644 ${workpath}/dmd/docs/man/man1/dmd.conf.5 \
+        ${destroot}${prefix}/share/man/man5
+# bin
+    xinstall -d -m 755 ${destroot}${prefix}/lib/${name}
+    xinstall -d -m 755 ${destroot}${prefix}/lib/${name}/bin
+    xinstall -m 755 -W ${worksrcpath} \
+        dmd idgen impcnvgen optabgen \
+        ${destroot}${prefix}/lib/${name}/bin
+    ln -s ${prefix}/lib/${name}/bin/dmd ${destroot}${prefix}/bin
+# samples
+    xinstall -d -m 755 ${destroot}${prefix}/share/${name}
+    xinstall -d -m 755 ${destroot}${prefix}/share/${name}/samples
+    foreach f [glob ${workpath}/dmd/samples/*.d] {
+        xinstall -m 644 ${f} ${destroot}${prefix}/share/${name}/samples
+    }
+# conf
+    xinstall -d -m 755 ${destroot}${prefix}/etc/${name}
+    set conf [open ${destroot}${prefix}/etc/${name}/${name}.conf w]
+    puts $conf "\[Environment\]
+DFLAGS=-I${prefix}/include/druntime -I${prefix}/include/phobos -L${prefix}/lib"
+    close $conf
+}

Added: trunk/dports/lang/dmd/files/patch-mars.c.diff
===================================================================
--- trunk/dports/lang/dmd/files/patch-mars.c.diff	                        (rev 0)
+++ trunk/dports/lang/dmd/files/patch-mars.c.diff	2012-05-03 22:51:31 UTC (rev 92688)
@@ -0,0 +1,11 @@
+--- src/mars.c.orig	2012-05-03 05:41:09.000000000 +0900
++++ src/mars.c	2012-05-03 05:41:23.000000000 +0900
+@@ -775,7 +775,7 @@
+                 global.params.debugy = 1;
+             else if (p[1] == 'L')
+             {
+-                global.params.linkswitches->push(p + 2);
++                global.params.linkswitches->push(p);
+             }
+             else if (memcmp(p + 1, "defaultlib=", 11) == 0)
+             {

Added: trunk/dports/lang/dmd-tools/Portfile
===================================================================
--- trunk/dports/lang/dmd-tools/Portfile	                        (rev 0)
+++ trunk/dports/lang/dmd-tools/Portfile	2012-05-03 22:51:31 UTC (rev 92688)
@@ -0,0 +1,70 @@
+# -*- 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
+# $Id$
+
+PortSystem          1.0
+
+set realname        tools
+name                dmd-${realname}
+version             2.059
+categories          lang
+platforms           darwin
+license             DMD
+maintainers         takeshi openmaintainer
+description         Ancilliary tools for the D programming language compiler
+long_description \
+    D is a language with C-like syntax and static typing. \
+    It pragmatically combines efficiency, control, \
+    and modeling power, with safety and programmer productivity.
+homepage            http://dlang.org/
+set dlang           D-Programming-Language
+set site            d-programming-language.org
+master_sites        https://github.com/${dlang}/${realname}/tarball/v${version}:src \
+                    https://github.com/${dlang}/${site}/tarball/v${version}:doc
+set dbranch-src     940730
+set dbranch-doc     948c9b
+distname            ${dlang}-${realname}-v${version}-0-g${dbranch-src}
+set src             ${distname}${extract.suffix}
+set doc             ${dlang}-${site}-v${version}-0-g${dbranch-doc}${extract.suffix}
+distfiles           ${src}:src \
+                    ${doc}:doc
+checksums           ${src} \
+                    rmd160  14b939b7e2eb02b874c7994af9c57cb29f20e951 \
+                    sha256  d978c9fffd4cdd6731973e5a8d04683d6cfc8ad94cb66c3d5a9712f2dd0955ec \
+                    ${doc} \
+                    rmd160  9307a7b95442353843796fd0b4ba39305d3659bc \
+                    sha256  a49cc52b5e2c0f0c0a641f054fec71cdecfca248c6bcfcfccadb0b331f9cae4e
+
+depends_lib         port:phobos
+worksrcdir          ${dlang}-${realname}-42d349f/
+
+use_configure       no
+
+set bin "catdoc ddemangle detab findtags rdmd tolf"
+set dmd ${prefix}/lib/dmd/bin/dmd
+set dflags "-O -d"
+set ddocflags " -c -o- -Df"
+set ddoc "macros.ddoc doc.ddoc"
+build {
+    system "mv ${workpath}/${dlang}-${site}-* ${workpath}/doc; 
+        cd ${workpath}/doc;
+        ${dmd} ${ddocflags}expression.html ${ddoc} expression.dd
+        ${dmd} ${ddocflags}statement.html ${ddoc} statement.dd
+        cd ${worksrcpath};
+        for f in ${bin}; do
+            ${dmd} ${dflags} \$f.d
+        done
+        ./findtags ../doc/expression.html > expression.tag
+        ./findtags ../doc/statement.html > statement.tag
+        ${dmd} ${dflags} -J. dman.d
+    "
+}
+
+destroot {
+    xinstall -d -m 755 ${destroot}${prefix}/lib/${name}
+    xinstall -d -m 755 ${destroot}${prefix}/lib/${name}/bin
+    foreach f "${bin} dman" {
+        xinstall -m 755 ${worksrcpath}/${f} \
+            ${destroot}${prefix}/lib/${name}/bin
+    }
+    ln -s ${prefix}/lib/${name}/bin/rdmd ${destroot}${prefix}/bin
+}

Added: trunk/dports/lang/druntime/Portfile
===================================================================
--- trunk/dports/lang/druntime/Portfile	                        (rev 0)
+++ trunk/dports/lang/druntime/Portfile	2012-05-03 22:51:31 UTC (rev 92688)
@@ -0,0 +1,57 @@
+# -*- 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
+# $Id$
+
+PortSystem          1.0
+PortGroup           github 1.0
+
+set dlang           D-Programming-Language
+github.setup        ${dlang} druntime 2.059 v
+categories          lang
+platforms           darwin
+license             Boost-1.0
+maintainers         takeshi openmaintainer
+description         Low level runtime library for the D programming language
+long_description \
+    Druntime is the minimum library required to support the D programming \
+    language. It includes the system code required to support the garbage \
+    collector, associative arrays, exception handling, array vector operations, \
+    startup/shutdown, etc.
+homepage            http://dlang.org/
+set dbranch         3987c7
+distname            ${dlang}-${name}-v${version}-0-g${dbranch}
+checksums           rmd160  8754f330b0583060d65c2e37c8d931252132f50d \
+                    sha256  055d6559edf98a1478a819897150d15cd691843dbca78cdd4d80082cc939100d \
+
+worksrcdir          ${name}
+
+depends_lib         port:dmd
+
+post-patch {
+    if {${configure.compiler}=="clang"} {
+        reinplace "s|-Wa,-noexecstack||" ${worksrcpath}/posix.mak
+    }
+}
+
+use_configure       no
+
+if {${build_arch}=="x86_64"} {
+    set model 64
+} else {
+    set model 32
+}
+
+build.args          -f posix.mak \
+                    CC=${configure.cc} \
+                    DMD=${prefix}/lib/dmd/bin/dmd \
+                    MODEL=${model} \
+                    CFLAGS=\"${configure.cflags}\"
+build.target        ""
+
+destroot {
+    xinstall -m 644 ${worksrcpath}/lib/libdruntime-osx${model}.a \
+        ${destroot}${prefix}/lib/libdruntime.a
+    xinstall -m 755 -d ${destroot}${prefix}/include/${name}
+    system "cd ${worksrcpath};
+        cp -r import/* ${destroot}${prefix}/include/${name}
+    "
+}

Added: trunk/dports/lang/phobos/Portfile
===================================================================
--- trunk/dports/lang/phobos/Portfile	                        (rev 0)
+++ trunk/dports/lang/phobos/Portfile	2012-05-03 22:51:31 UTC (rev 92688)
@@ -0,0 +1,66 @@
+# -*- 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
+# $Id$
+
+PortSystem          1.0
+PortGroup           github 1.0
+
+set dlang           D-Programming-Language
+github.setup        ${dlang} phobos 2.059 v
+categories          lang
+platforms           darwin
+license             Boost-1.0
+maintainers         takeshi openmaintainer
+description         Runtime library for the D programming language
+long_description \
+    Phobos is the standard runtime library that comes with the D language compiler.
+homepage            http://dlang.org/
+set dbranch         d862f1
+distname            ${dlang}-${name}-v${version}-0-g${dbranch}
+checksums           rmd160  9acbe4960c57ce6ba78d9594bb5451d6c7877da4 \
+                    sha256  5571e610bd306540cc6e9574bde0479889c62c9d2d3eed742bd3a5362c1ac03c
+depends_lib         port:druntime
+
+worksrcdir          ${name}
+
+post-patch {
+    reinplace "s|gcc|${configure.cc}|" ${worksrcpath}/posix.mak
+    reinplace "s|-m\$(MODEL)||" ${worksrcpath}/posix.mak
+    reinplace "s|/import||" ${worksrcpath}/posix.mak
+}
+
+use_configure       no
+
+if {${build_arch}=="x86_64"} {
+    set model 64
+} else {
+    set model 32
+}
+
+build.args          -f posix.mak \
+                    DRUNTIME_PATH=${prefix}/include/druntime \
+                    DRUNTIME=${prefix}/lib/libdruntime.a \
+                    CC=${configure.cc} \
+                    CFLAGS=${configure.cflags} \
+                    DMD=${prefix}/lib/dmd/bin/dmd \
+                    MODEL=${model} \
+                    BUILD=release
+build.target-delete ${build.target}
+
+destroot {
+    xinstall -m 755 -d ${destroot}${prefix}/lib
+    xinstall -m 644 ${worksrcpath}/generated/osx/release/${model}/lib${name}2.a \
+        ${destroot}${prefix}/lib
+    xinstall -d -m 755 ${destroot}${prefix}/include
+    xinstall -d -m 755 ${destroot}${prefix}/include/${name}
+    foreach f [glob ${worksrcpath}/*.d] {
+        xinstall -m 644 ${f} ${destroot}${prefix}/include/${name}
+    }
+    xinstall -d -m 755 ${destroot}${prefix}/include/${name}/etc
+    xinstall -d -m 755 ${destroot}${prefix}/include/${name}/etc/c
+    foreach f [glob ${worksrcpath}/etc/c/*.d] {
+        xinstall -m 644 ${f} ${destroot}${prefix}/include/${name}/etc/c
+    }
+    system "cd ${worksrcpath}; \
+        cp -r std ${destroot}${prefix}/include/${name}
+    "
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120503/3fb2ce9b/attachment.html>


More information about the macports-changes mailing list