[148217] trunk/dports/lang/druntime

mcalhoun at macports.org mcalhoun at macports.org
Sat Apr 30 08:35:29 PDT 2016


Revision: 148217
          https://trac.macports.org/changeset/148217
Author:   mcalhoun at macports.org
Date:     2016-04-30 08:35:29 -0700 (Sat, 30 Apr 2016)
Log Message:
-----------
druntime: allow universal build

Modified Paths:
--------------
    trunk/dports/lang/druntime/Portfile

Added Paths:
-----------
    trunk/dports/lang/druntime/files/
    trunk/dports/lang/druntime/files/makefile_macports_install
    trunk/dports/lang/druntime/files/patch-posix.diff

Modified: trunk/dports/lang/druntime/Portfile
===================================================================
--- trunk/dports/lang/druntime/Portfile	2016-04-30 15:30:00 UTC (rev 148216)
+++ trunk/dports/lang/druntime/Portfile	2016-04-30 15:35:29 UTC (rev 148217)
@@ -3,6 +3,7 @@
 
 PortSystem          1.0
 PortGroup           github 1.0
+PortGroup           muniversal 1.0
 
 github.setup        D-Programming-Language druntime 2.069.2 v
 categories          lang
@@ -22,33 +23,41 @@
 
 depends_lib         port:dmd
 
+patchfiles          patch-posix.diff
+
 use_configure       no
 
-if {${build_arch} eq "x86_64"} {
-    set model 64
-} else {
-    set model 32
+post-extract {
+    xinstall -m 0644 ${filespath}/makefile_macports_install ${build.dir}
 }
 
+post-patch {
+    reinplace \
+        "s|__MACPORTS_CFLAGS__|${configure.cflags}|g" \
+        ${worksrcpath}/posix.mak
+}
+
 build.args          -f posix.mak \
                     CC=${configure.cc} \
                     DMD=${prefix}/bin/dmd \
-                    MODEL=${model} \
-                    DRUNTIME_BASE=${name} \
-                    CFLAGS=\"${configure.cflags}\"
+                    DRUNTIME_BASE=${name}
 build.target        ""
 
-destroot {
-    xinstall -m 644 ${worksrcpath}/generated/osx/release/${model}/lib${name}.a \
-        ${destroot}${prefix}/lib
-    xinstall -m 755 -d ${destroot}${prefix}/include
-    xinstall -m 755 -d ${destroot}${prefix}/include/${name}
-    file copy ${worksrcpath}/import ${destroot}${prefix}/include/${name}/import
-    xinstall -m 755 -d ${destroot}${prefix}/share/doc
-    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
-    file copy ${worksrcpath}/LICENSE ${destroot}${prefix}/share/doc/${name}
-    xinstall -m 755 -d ${destroot}${prefix}/share/${name}
-    file copy ${worksrcpath}/benchmark ${destroot}${prefix}/share/${name}
+if { ![variant_isset universal] } {
+    if { ${build_arch} eq "x86_64" || ${build_arch} eq "ppc64" } {
+        build.args-append MODEL=64
+    } else {
+        build.args-append MODEL=32
+    }
+} else {
+    lappend merger_build_args(x86_64) MODEL=64
+    lappend merger_build_args(i386)   MODEL=32
+    lappend merger_build_args(ppc64)  MODEL=64
+    lappend merger_build_args(ppc)    MODEL=32
 }
 
+destroot.args \
+    -f makefile_macports_install \
+    PREFIX=${prefix}
+
 livecheck.regex     archive/[join ${github.tag_prefix} ""](\[^"-\]+)${extract.suffix}

Added: trunk/dports/lang/druntime/files/makefile_macports_install
===================================================================
--- trunk/dports/lang/druntime/files/makefile_macports_install	                        (rev 0)
+++ trunk/dports/lang/druntime/files/makefile_macports_install	2016-04-30 15:35:29 UTC (rev 148217)
@@ -0,0 +1,16 @@
+# -*- mode: makefile -*-
+
+INSTALL=/usr/bin/install
+DCOPY=/bin/cp -r
+
+install:
+	$(INSTALL) -m 644 generated/osx/release/*/*.a \
+		$(DESTDIR)$(PREFIX)/lib
+	$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/include
+	$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/include/druntime
+	$(DCOPY) import $(DESTDIR)$(PREFIX)/include/druntime/import
+	$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/share/doc
+	$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/share/doc/druntime
+	file copy LICENSE $(DESTDIR)$(PREFIX)/share/doc/druntime
+	$(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/share/druntime
+	$(DCOPY) benchmark $(DESTDIR)$(PREFIX)/share/druntime

Added: trunk/dports/lang/druntime/files/patch-posix.diff
===================================================================
--- trunk/dports/lang/druntime/files/patch-posix.diff	                        (rev 0)
+++ trunk/dports/lang/druntime/files/patch-posix.diff	2016-04-30 15:35:29 UTC (rev 148217)
@@ -0,0 +1,11 @@
+--- posix.mak.orig	2015-11-16 11:20:23.000000000 -0700
++++ posix.mak	2016-04-30 05:36:36.000000000 -0700
+@@ -44,7 +44,7 @@
+ ifeq ($(BUILD),debug)
+ 	CFLAGS += -g
+ else
+-	CFLAGS += -O3
++	CFLAGS += __MACPORTS_CFLAGS__
+ endif
+ ifeq (solaris,$(OS))
+ 	CFLAGS+=-D_REENTRANT  # for thread-safe errno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160430/0e889a3f/attachment.html>


More information about the macports-changes mailing list