diff options
Diffstat (limited to 'main/go/APKBUILD')
-rw-r--r-- | main/go/APKBUILD | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/main/go/APKBUILD b/main/go/APKBUILD index d875802a3c..46a829c679 100644 --- a/main/go/APKBUILD +++ b/main/go/APKBUILD @@ -4,7 +4,7 @@ pkgname=go pkgver=1.4.2 # This should be the latest commit on the corresponding release branch _toolsver="abf43428cc239218424c7a44dc9b5987cd351c3e" -pkgrel=1 +pkgrel=2 pkgdesc="Go programming language compiler" url="http://www.golang.org/" arch="x86 x86_64 armhf" @@ -14,7 +14,7 @@ depends_dev="" makedepends="bash perl" options="!strip" install="" -subpackages="$pkgname-tools:tools" +subpackages="$pkgname-tools:tools $pkgname-cross:cross" source=" http://golang.org/dl/go${pkgver}.src.tar.gz tools.tar.gz::https://github.com/golang/tools/archive/${_toolsver}.tar.gz @@ -44,20 +44,31 @@ build() { export GOROOT="$_builddir" export GOBIN="$GOROOT"/bin export GOROOT_FINAL=/usr/lib/go + # ccache breaks build for some reason unset CC case "$CARCH" in - x86) GOARCH=386;; - x86_64) GOARCH=amd64;; - arm*) GOARCH=arm; export GOARM=6;; - *) return 1;; + x86) + export GOARCH="386" ;; + x86_64) + export GOARCH="amd64" ;; + arm*) + export GOARCH="arm" + export GOARM="6" ;; + *) + return 1 ;; esac - export GOARCH cd "$_builddir/src" ./make.bash || return 1 + for os in darwin freebsd openbsd windows; do + for arch in "386" "amd64"; do + GOARCH=$arch GOOS=$os ./make.bash --no-clean || return 1 + done + done + # FIXME: race and bench tests fail: #PATH="$GOROOT/bin:$PATH" ./run.bash --no-rebuild --banner || return 1 @@ -116,6 +127,24 @@ tools() { done } +cross() { + pkgdesk="Go cross compilers" + depends="$pkgname" + + mkdir -p "$subpkgdir"/usr/lib/go/pkg/tool \ + "$subpkgdir"/usr/lib/go/src/runtime + + for os in darwin freebsd openbsd windows; do + mv "$pkgdir"/usr/lib/go/pkg/tool/${os}_* \ + "$subpkgdir"/usr/lib/go/pkg/tool || return 1 + mv "$pkgdir"/usr/lib/go/pkg/${os}_* \ + "$subpkgdir"/usr/lib/go/pkg || return 1 + mv "$pkgdir"/usr/lib/go/src/runtime/zasm_${os}*.h \ + "$subpkgdir"/usr/lib/go/src/runtime || return 1 + done + +} + md5sums="907f85c8fa765d31f7f955836fec4049 go1.4.2.src.tar.gz a8bc7ad3d0deff01bd45e4938cc3adb6 tools.tar.gz 65330c61f6d6c881033b0a95ca228edb no-werror.patch |