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

singingwolfboy at macports.org singingwolfboy at macports.org
Wed Mar 24 14:47:32 PDT 2010


Revision: 65262
          http://trac.macports.org/changeset/65262
Author:   singingwolfboy at macports.org
Date:     2010-03-24 14:47:32 -0700 (Wed, 24 Mar 2010)
Log Message:
-----------
Made changes to go-devel port as suggested by ryandesign

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

Modified: trunk/dports/lang/go-devel/Portfile
===================================================================
--- trunk/dports/lang/go-devel/Portfile	2010-03-24 21:29:28 UTC (rev 65261)
+++ trunk/dports/lang/go-devel/Portfile	2010-03-24 21:47:32 UTC (rev 65262)
@@ -5,8 +5,9 @@
 name                go-devel
 set real_name       go
 version             0.0.1
+revision            1
 categories          lang
-platforms           darwin freebsd linux nacl
+platforms           darwin freebsd linux
 license             BSD
 maintainers         singingwolfboy
 description         Systems programming language developed by Google (development version)
@@ -21,7 +22,8 @@
 homepage            http://golang.org/
 fetch.type          hg
 hg.url              https://go.googlecode.com/hg/
-hg.tag              release
+#hg.tag              release
+hg.tag              9482fde11a02
 
 depends_build       bin:bison:bison \
                     bin:make:gmake \
@@ -30,72 +32,92 @@
 
 set GOROOT          ${worksrcpath}
 set GOBIN           ${workpath}/bin
+
+# 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}"
+        }
+    }
+}
+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."
+        return -code error "incompatible processor"
+    }
+}
+
+use_configure       no
+
 pre-build {
     xinstall -m 755 -d ${GOROOT} ${GOBIN}
 }
-
-use_configure       no
-build.cmd           cd src && ./make.bash
+build.dir           ${worksrcpath}/src
+build.cmd           ./make.bash
 build.target    
-build.env           GOROOT=${GOROOT} GOBIN=${GOBIN}
+build.env           GOROOT=${GOROOT} GOBIN=${GOBIN} GOARCH=${GOARCH}
 use_parallel_build  no
+
 test.run            yes
-test.cmd            cd src && ./run.bash
+test.dir            ${worksrcpath}/src
+test.cmd            ./run.bash
 test.target 
-test.env            GOROOT=${GOROOT} GOBIN=${GOBIN}
+test.env            GOROOT=${GOROOT} GOBIN=${GOBIN} GOARCH=${build_arch}
 
 destroot {
     # bin files
     file delete ${destroot}${prefix}/bin
-    file copy ${workpath}/bin ${destroot}${prefix}
+    file copy ${GOBIN} ${destroot}${prefix}
         
     # lib files
-    xinstall -m 644 -W ${worksrcpath}/lib lib9.a libbio.a libmach.a \
-        ${destroot}${prefix}/lib
+    file delete -force ${destroot}${prefix}/lib
+    file copy ${worksrcpath}/lib ${destroot}${prefix}
     
     # include files
     file copy ${worksrcpath}/include ${destroot}${prefix}/include/${real_name}
+    
+    # documentation
+    xinstall -m 755 -d ${destroot}${prefix}/share/doc/
+    file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${real_name}
+    xinstall -m 644 -W ${worksrcpath} favicon.ico \
+        ${destroot}${prefix}/share/doc/${real_name}
 }
 
-### PLATFORM VARIANTS ###
-variant darwin {
+
+platform darwin {
     build.env-append GOOS=darwin
     test.env-append GOOS=darwin
 }
-variant freebsd {
+platform freebsd {
     build.env-append GOOS=freebsd
     test.env-append GOOS=freebsd
 }
-variant linux {
+platform linux {
     build.env-append GOOS=linux
     test.env-append GOOS=linux
 }
-variant nacl description {Platform variant} {
+variant nacl description {Native Client platform} {
+    build.env-delete GOOS
     build.env-append GOOS=nacl
+    test.env-delete GOOS
     test.env-append GOOS=nacl
 }
-variant i386 {
-    build.env-append GOARCH=386
-    test.env-append GOARCH=386
-}
-variant amd64 description {Platform variant} {
-    build.env-append GOARCH=amd64
-    test.env-append GOARCH=amd64
-}
-variant arm description {Platform variant} {
-    build.env-append GOARCH=arm
-    test.env-append GOARCH=arm
-}
 
-### OTHER VARIANTS ###
-variant docs description {Install Go documentation} {
-    post-destroot {
-        xinstall -m 755 -d ${destroot}${prefix}/share/doc/
-        file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${real_name}
-        xinstall -m 644 -W ${worksrcpath} favicon.ico \
-            ${destroot}${prefix}/share/doc/${real_name}
-    }
-}
+
 variant bash_completion description {Install bash completion files for Go} {
     depends_run-append      path:etc/bash_completion.d:bash-completion
     post-destroot {
@@ -120,5 +142,3 @@
             ${destroot}${prefix}/share/vim/vim72/syntax/
     }
 }
-
-default_variants +docs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100324/54928501/attachment.html>


More information about the macports-changes mailing list