Ticket #22506: Portfile

File Portfile, 1.7 KB (added by nefar@…, 15 years ago)

portfile ...

Line 
1# $Id
2
3PortSystem          1.0
4
5name                go-devel
6version             2009-11-10.1
7categories          lang
8platforms           darwin
9
10maintainers         nefar@otherware.org
11
12description         a systems programming language by Google
13
14long_description    Go is a new programming language from Google that aims for \
15                    performance that is nearly comparable to C, but with more expressive syntax and \
16                    faster compilation.
17
18homepage            http://golang.org/
19
20fetch.type          hg
21hg.url              https://go.googlecode.com/hg/
22hg.tag              release.2009-11-10.1
23worksrcdir          ${name}-${version}
24
25use_configure       no
26patchfiles          patch-src-Make.pkg.diff
27
28pre-build {
29  file copy ${portpath}/${filesdir}/Makefile ${worksrcpath}
30  # the ~placeholder~ file interferes during install
31  delete "${worksrcpath}/pkg/~place-holder~"
32}
33
34destroot {
35
36  # executables
37  file mkdir ${destroot}${prefix}/lib/${name}/bin
38  eval copy [glob ${worksrcpath}/bin/*] ${destroot}${prefix}/lib/${name}/bin
39
40  # install go packages (libs)
41  eval copy ${worksrcpath}/pkg ${destroot}${prefix}/lib/${name}
42
43  # docs
44  file mkdir ${destroot}${prefix}/share/doc/${name}
45  eval copy [glob ${worksrcpath}/doc/*] ${destroot}${prefix}/share/doc/${name}
46
47  # make wrappers
48  foreach x [glob ${worksrcpath}/bin/*] {
49    set fname [file tail $x]
50    copy ${portpath}/${filesdir}/wrapper ${destroot}${prefix}/bin/${fname}
51    file attributes ${destroot}${prefix}/bin/${fname} -permissions 00755
52    reinplace "s|__GOROOT__|${prefix}/lib/${name}|g" ${destroot}${prefix}/bin/${fname}
53    reinplace "s|__EXECUTABLE__|${prefix}/lib/${name}/bin/${fname}|g" ${destroot}${prefix}/bin/${fname}
54  }
55}
56# kevin@sb.org