Revision: 75658 http://trac.macports.org/changeset/75658 Author: singingwolfboy@macports.org Date: 2011-02-02 15:42:54 -0800 (Wed, 02 Feb 2011) Log Message: ----------- New port: go Added Paths: ----------- trunk/dports/lang/go/ trunk/dports/lang/go/Portfile Copied: trunk/dports/lang/go/Portfile (from rev 75061, trunk/dports/lang/go-devel/Portfile) =================================================================== --- trunk/dports/lang/go/Portfile (rev 0) +++ trunk/dports/lang/go/Portfile 2011-02-02 23:42:54 UTC (rev 75658) @@ -0,0 +1,129 @@ +# $Id$ + +PortSystem 1.0 + +name go +conflicts go-devel +version 2011-02-01 +categories lang +platforms darwin freebsd linux +license BSD +maintainers singingwolfboy +description compiled, garbage-collected, concurrent programming \ + language developed by Google Inc. +long_description \ + The Go programming language is an open source project to make programmers \ + more productive. Go is expressive, concise, clean, and efficient. Its \ + concurrency mechanisms make it easy to write programs that get the most \ + out of multicore and networked machines, while its novel type system \ + enables flexible and modular program construction. Go compiles quickly \ + to machine code yet has the convenience of garbage collection and the \ + power of run-time reflection. It's a fast, statically typed, compiled \ + language that feels like a dynamically typed, interpreted language. Go \ + is developed by Google Inc. + +homepage http://golang.org/ +fetch.type hg +hg.url https://go.googlecode.com/hg/ +hg.tag release.${version} + +depends_build bin:bison:bison \ + bin:make:gmake \ + bin:awk:gawk \ + bin:ed:ed + +set GOROOT ${worksrcpath} +set GOBIN ${workpath}/bin + +switch ${build_arch} { + i386 { + set GOARCH 386 + } + x86_64 { + set GOARCH amd64 + } + default { + # unsupported arch, but GOARCH needs to be set to something to prevent errors + set GOARCH x + } +} + +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} +} +build.dir ${worksrcpath}/src +build.cmd ./make.bash +build.target +build.env GOROOT=${GOROOT} GOBIN=${GOBIN} GOARCH=${GOARCH} \ + GOROOT_FINAL=${prefix} +use_parallel_build no + +test.run yes +test.dir ${worksrcpath}/src +test.cmd ./run.bash +test.target +test.env ${build.env} + +destroot { + # bin files + file delete ${destroot}${prefix}/bin + file copy ${GOBIN} ${destroot}${prefix} + + # lib files + file delete -force ${destroot}${prefix}/lib + file copy ${worksrcpath}/lib ${destroot}${prefix} + + # compiled packages + file copy ${worksrcpath}/pkg ${destroot}${prefix} + + # include files + file copy ${worksrcpath}/include ${destroot}${prefix}/include + + # documentation + xinstall -m 755 -d ${destroot}${prefix}/share/doc/ + file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name} + xinstall -m 644 -W ${worksrcpath} favicon.ico \ + ${destroot}${prefix}/share/doc/${name}/${name}.ico + + # bash completion + xinstall -m 755 -d ${destroot}${prefix}/etc/bash_completion.d + xinstall -m 644 -W ${worksrcpath}/misc/bash ${name} \ + ${destroot}${prefix}/etc/bash_completion.d/${name} + + # emacs syntax highlighting + xinstall -m 755 -d ${destroot}${prefix}/share/emacs/site-lisp/ + eval xinstall -m 644 [glob ${worksrcpath}/misc/emacs/*.el] \ + ${destroot}${prefix}/share/emacs/site-lisp/ + + # vim syntax highlighting + set vimdir ${destroot}${prefix}/share/vim/vim73 + xinstall -m 755 -d ${vimdir}/syntax ${vimdir}/ftdetect ${vimdir}/ftplugin + xinstall -m 644 ${worksrcpath}/misc/vim/syntax/go.vim \ + ${vimdir}/syntax/go.vim + xinstall -m 644 ${worksrcpath}/misc/vim/ftdetect/gofiletype.vim \ + ${vimdir}/ftdetect/go.vim + xinstall -m 644 ${worksrcpath}/misc/vim/ftplugin/go/import.vim \ + ${vimdir}/ftplugin/go.vim +} + +platform darwin { + build.env-append GOOS=darwin + test.env-append GOOS=darwin +} +platform freebsd { + build.env-append GOOS=freebsd + test.env-append GOOS=freebsd +} +platform linux { + build.env-append GOOS=linux + test.env-append GOOS=linux +}
participants (1)
-
singingwolfboy@macports.org