[67125] trunk/dports/lang/go-devel/Portfile

singingwolfboy at macports.org singingwolfboy at macports.org
Thu Apr 29 14:22:21 PDT 2010


Revision: 67125
          http://trac.macports.org/changeset/67125
Author:   singingwolfboy at macports.org
Date:     2010-04-29 14:22:18 -0700 (Thu, 29 Apr 2010)
Log Message:
-----------
Updated to latest hg, added compiled packages to lib/gopkg, generated GOARCH by proc rather than switch

Modified Paths:
--------------
    trunk/dports/lang/go-devel/Portfile

Modified: trunk/dports/lang/go-devel/Portfile
===================================================================
--- trunk/dports/lang/go-devel/Portfile	2010-04-29 21:06:38 UTC (rev 67124)
+++ trunk/dports/lang/go-devel/Portfile	2010-04-29 21:22:18 UTC (rev 67125)
@@ -5,7 +5,7 @@
 name                go-devel
 set real_name       go
 version             0.0.1
-revision            2
+revision            3
 categories          lang
 platforms           darwin freebsd linux
 license             BSD
@@ -23,7 +23,7 @@
 fetch.type          hg
 hg.url              https://go.googlecode.com/hg/
 #hg.tag              release
-hg.tag              9482fde11a02
+hg.tag              7a932654bb51
 
 depends_build       bin:bison:bison \
                     bin:make:gmake \
@@ -33,19 +33,27 @@
 set GOROOT          ${worksrcpath}
 set GOBIN           ${workpath}/bin
 
-switch ${build_arch} {
-    i386 {
-        set GOARCH 386
+# based on minivmac port
+# converts normal arch names into Go arch names
+proc my_arch_to_target {arch} {
+    switch ${arch} {
+        i386 {
+            return 386
+        }
+        x86_64 {
+            return amd64
+        }
+        arm {
+            return arm
+        }
+        default {
+            return -code error "unsupported architecture ${arch}"
+        }
     }
-    x86_64 {
-        set GOARCH amd64
-    }
-    default {
-        # unsupported arch, but GOARCH needs to be set to something to prevent errors
-        set GOARCH x
-    }
 }
+set GOARCH          [my_arch_to_target ${build_arch}]
 
+# based on wine port
 pre-fetch {
     if {"big" == ${os.endian}} {
         ui_error "${name} can only be used on an Intel Mac or other computer with a little-endian processor."
@@ -68,7 +76,7 @@
 test.dir            ${worksrcpath}/src
 test.cmd            ./run.bash
 test.target 
-test.env            GOROOT=${GOROOT} GOBIN=${GOBIN} GOARCH=${build_arch}
+test.env            GOROOT=${GOROOT} GOBIN=${GOBIN} GOARCH=${GOARCH}
 
 destroot {
     # bin files
@@ -79,6 +87,10 @@
     file delete -force ${destroot}${prefix}/lib
     file copy ${worksrcpath}/lib ${destroot}${prefix}
     
+    # compiled packages (in lib dir)
+    file delete ${worksrcpath}/pkg/~place-holder~
+    eval file copy [glob ${worksrcpath}/pkg/*] ${destroot}${prefix}/lib/gopkg
+
     # include files
     file copy ${worksrcpath}/include ${destroot}${prefix}/include/${real_name}
     
@@ -117,8 +129,6 @@
     test.env-append GOOS=linux
 }
 variant nacl description {Native Client platform} {
-    build.env-delete GOOS
     build.env-append GOOS=nacl
-    test.env-delete GOOS
     test.env-append GOOS=nacl
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100429/32220c92/attachment.html>


More information about the macports-changes mailing list