Ticket #22569: Portfile

File Portfile, 2.3 KB (added by pbhogan@…, 15 years ago)

Updated Portfile

Line 
1# $Id$
2
3PortSystem 1.0
4
5name                            go
6version                         2009-12-22
7
8categories                      lang go
9maintainers                     gmail.com:pbhogan
10
11description                     The Go Programming Language.
12long_description        A systems programming language that is expressive, concurrent, garbage-collected.
13homepage                        http://golang.org/
14
15platforms                       darwin
16
17fetch.type                      hg
18hg.url                          https://go.googlecode.com/hg/
19hg.tag                          release.${version}
20
21livecheck.type          regex
22livecheck.url           https://go.googlecode.com/hg/.hgtags
23livecheck.regex         release\.(.+)
24
25use_configure           no
26
27use_parallel_build      no
28build.env                       GOROOT=${worksrcpath} GOOS=darwin GOBIN=${destroot}${prefix}/bin PATH=${destroot}${prefix}/bin:/usr/bin:/bin
29build.cmd                       cd ${worksrcpath}/src && ./make.bash
30build.target           
31
32pre-build {
33        # create binaries directory in destroot
34        xinstall -m 755 -d ${destroot}${prefix}/bin
35}
36
37destroot {
38        delete "${worksrcpath}/pkg/~place-holder~"
39        xinstall -m 755 -d ${destroot}${prefix}/lib/${name}
40        eval copy ${worksrcpath}/pkg ${destroot}${prefix}/lib/${name}/pkg
41        xinstall -m 755 -d ${destroot}${prefix}/share/doc
42        eval copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
43}
44
45post-activate {
46        puts "*****************************************************************"
47        puts "** IMPORTANT!                                                  **"
48        puts "*****************************************************************"
49        puts [format "Go is installed in %s" ${prefix}/lib/${name}]
50        puts "You will need to add the following to your environment to use Go:"
51        puts [format "export GOROOT=%s" ${prefix}/lib/${name}]
52        puts [format "export GOBIN=%s" ${prefix}/bin]
53        puts [format "export GOOS=%s" "darwin"]
54        puts [format "export GOARCH=%s" ${goArch}]
55        puts "*****************************************************************"
56}
57
58variant x86-64 conflicts x86-32 arm description "64-bit compiler. The most mature implementation." {
59        global goArch
60        set goArch "amd64"
61        build.env-append        GOARCH=amd64
62}
63
64variant x86-32 conflicts x86-64 arm description "32-bit compiler. Comparable to the 64-bit compiler. Not as well soaked but should be nearly as solid." {
65        global goArch
66        set goArch "386"
67        build.env-append        GOARCH=386
68}
69
70# Does not work on OS X quite yet
71# variant arm conflicts x86-64 x86-32 description "ARM compiler. Experimental." {
72#       global goArch
73#       set goArch "arm"
74#       build.env-append        GOARCH=arm
75# }
76
77default_variants        +x86-64