source: trunk/dports/lang/go/Portfile

Last change on this file was 154251, checked in by ciserlohn@…, 9 months ago

go: update to version 1.7.3; disable support for darwin versions not supported upstream

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 154251 2016-10-25 12:31:12Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                go
7epoch               2
8version             1.7.3
9categories          lang
10platforms           darwin freebsd linux
11license             BSD
12maintainers         ciserlohn
13description         compiled, garbage-collected, concurrent programming \
14                    language developed by Google Inc.
15long_description    \
16    The Go programming language is an open source project to make programmers \
17    more productive. Go is expressive, concise, clean, and efficient. Its \
18    concurrency mechanisms make it easy to write programs that get the most \
19    out of multicore and networked machines, while its novel type system \
20    enables flexible and modular program construction. Go compiles quickly \
21    to machine code yet has the convenience of garbage collection and the \
22    power of run-time reflection. It's a fast, statically typed, compiled \
23    language that feels like a dynamically typed, interpreted language. Go \
24    is developed by Google Inc.
25
26homepage            https://golang.org/
27master_sites        https://storage.googleapis.com/golang/
28distfiles           ${name}${version}.src.tar.gz
29worksrcdir          ${name}
30
31checksums           rmd160  a1fbbf8e0805989e2ca74d66912c87e58328c6b5 \
32                    sha256  79430a0027a09b0b3ad57e214c4c1acfdd7af290961dd08d322818895af1ef44
33
34depends_build       port:go-1.4
35
36set GOROOT          ${worksrcpath}
37set GOROOT_FINAL    ${prefix}/lib/${name}
38
39supported_archs     i386 x86_64
40
41switch ${build_arch} {
42    i386 {
43        set GOARCH 386
44    }
45    x86_64 {
46        set GOARCH amd64
47    }
48    default {
49        set GOARCH {}
50    }
51}
52
53use_configure       no
54
55build.dir           ${worksrcpath}/src
56build.cmd           ./make.bash
57build.target
58build.env           GOROOT_BOOTSTRAP=${prefix}/lib/go-1.4 \
59                    GOROOT=${GOROOT} \
60                    GOARCH=${GOARCH} \
61                    GOOS=darwin \
62                    GOROOT_FINAL=${GOROOT_FINAL} \
63                    CC=${configure.cc}
64
65use_parallel_build  no
66
67post-build {
68    system "find ${worksrcpath} -type d -name .hg* -print0 | xargs -0 rm -rf"
69    delete ${worksrcpath}/pkg/bootstrap
70}
71
72destroot {
73
74    set grfdir ${destroot}${GOROOT_FINAL}
75    set docdir ${destroot}${prefix}/share/doc/${name}
76   
77    xinstall -d ${grfdir}
78    xinstall -d ${docdir}
79   
80    foreach f {api bin lib misc pkg src test} {
81        copy ${worksrcpath}/${f} ${grfdir}
82    }
83
84    foreach f {go gofmt} {
85        system -W ${destroot}${prefix}/bin/ "ln -s ../lib/${name}/bin/$f ./$f"
86    }
87
88    xinstall -m 644 -W ${worksrcpath} \
89        AUTHORS \
90        CONTRIBUTING.md \
91        CONTRIBUTORS \
92        LICENSE \
93        README.md \
94        PATENTS \
95        VERSION \
96        ${docdir}
97
98    copy {*}[glob -directory ${worksrcpath}/doc *] ${docdir}
99}
100
101if {${os.major} < 12} {
102    pre-fetch {
103        ui_error "${name} ${version} requires Mac OS X 10.8 or greater."
104        return -code error "incompatible Mac OS X version"
105    }
106}
107
108livecheck.type      regex
109livecheck.url       ${homepage}/dl/
110livecheck.regex     {go([0-9.]+).src.tar.gz}
Note: See TracBrowser for help on using the repository browser.