37 | | switch ${build_arch} { |
38 | | i386 { |
39 | | set GOARCH 386 |
40 | | set cmd_prefix 8 |
41 | | } |
42 | | x86_64 { |
43 | | set GOARCH amd64 |
44 | | set cmd_prefix 6 |
45 | | } |
46 | | default { |
47 | | # unsupported arch, but GOARCH needs to be set to something to prevent errors |
48 | | set GOARCH x |
49 | | set cmd_prefix 6 |
| 38 | # Actual ports |
| 39 | } else { |
| 40 | switch ${subport} { |
| 41 | go1.4 { |
| 42 | version 1.4.2 |
| 43 | checksums rmd160 dea15b3b4c31554a47b40799f4b9a926ea760e70 \ |
| 44 | sha256 299a6fd8f8adfdce15bc06bde926e7b252ae8e24dd5b16b7d8791ed79e7b5e9b |
| 45 | } |
| 46 | go1.5 { |
| 47 | version 1.5.1 |
| 48 | checksums rmd160 751d078789bcd6ec0d85e09f5f40d9959877e202 \ |
| 49 | sha256 a889873e98d9a72ae396a9b7dd597c29dcd709cafa9097d9c4ba04cff0ec436b |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | distfiles go${version}.src.tar.gz |
| 54 | worksrcdir go |
| 55 | |
| 56 | depends_run port:go_select |
| 57 | select.group go |
| 58 | select.file ${filespath}/${subport} |
| 59 | |
| 60 | set GOROOT ${worksrcpath} |
| 61 | set GOROOT_FINAL ${prefix}/lib/${subport} |
| 62 | |
| 63 | switch ${build_arch} { |
| 64 | i386 { |
| 65 | set GOARCH 386 |
| 66 | set cmd_prefix 8 |
| 67 | } |
| 68 | x86_64 { |
| 69 | set GOARCH amd64 |
| 70 | set cmd_prefix 6 |
| 71 | } |
| 72 | default { |
| 73 | # unsupported arch, but GOARCH needs to be set to something to prevent errors |
| 74 | set GOARCH x |
| 75 | set cmd_prefix 6 |
| 76 | } |
62 | | build.dir ${worksrcpath}/src |
63 | | build.cmd ./make.bash |
64 | | build.target |
65 | | build.env GOROOT=${GOROOT} GOBIN= GOARCH=${GOARCH} \ |
66 | | GOROOT_FINAL=${GOROOT_FINAL} \ |
67 | | CC=${configure.cc} \ |
68 | | GCC=${configure.cc} |
69 | | |
70 | | use_parallel_build no |
71 | | post-build { |
72 | | # remove mercurial extras |
73 | | system "find ${worksrcpath} -type d -name .hg -print0 | xargs -0 rm -rf" |
74 | | } |
| 88 | build.dir ${worksrcpath}/src |
| 89 | build.cmd ./make.bash |
| 90 | build.target |
| 91 | build.env GOROOT=${GOROOT} GOBIN= GOARCH=${GOARCH} \ |
| 92 | GOROOT_FINAL=${GOROOT_FINAL} \ |
| 93 | CC=${configure.cc} \ |
| 94 | GCC=${configure.cc} \ |
| 95 | CGO_ENABLED=1 |
| 96 | |
| 97 | use_parallel_build no |
| 98 | post-build { |
| 99 | # extra tools |
| 100 | set tools_dir ${workpath}/tools |
| 101 | file mkdir ${tools_dir} |
| 102 | system "GOPATH=${tools_dir} GOROOT=${worksrcpath} ${worksrcpath}/bin/go get golang.org/x/tools/cmd/..." |
| 103 | system "cp -R ${tools_dir}/* ${worksrcpath}" |
| 104 | system "rm -r ${tools_dir}" |
| 105 | |
| 106 | # remove mercurial extras |
| 107 | system "find ${worksrcpath} -type d -name .hg -print0 | xargs -0 rm -rf" |
| 108 | } |
| 109 | |
| 110 | test.run yes |
| 111 | test.dir ${worksrcpath}/src |
| 112 | test.cmd ./run.bash |
| 113 | test.target |
| 114 | test.env ${build.env} |