git » go-1.20.git » commit 90a0b60

Upgrade to Go 1.1rc1

author Alexander Rødseth
2013-05-02 14:15:35 UTC
committer Alexander Rødseth
2013-05-02 14:15:35 UTC
parent ca8f1634f2deea206e000258e387373952c64fc2

Upgrade to Go 1.1rc1

PKGBUILD +26 -26

diff --git a/PKGBUILD b/PKGBUILD
index 2c23489..0196474 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,9 +6,8 @@
 # Contributor: Christian Himpel <chressie@gmail.com>
 # Contributor: Mike Rosset <mike.rosset@gmail.com>
 # Contributor: Daniel YC Lin <dlin.tw@gmail.com>
-
 pkgname=go
-pkgver=1.1
+pkgver=1.1rc1
 pkgrel=1
 epoch=2
 pkgdesc='Google Go compiler and tools'
@@ -20,47 +19,48 @@ makedepends=('inetutils')
 options=('!strip')
 install="$pkgname.install"
 backup=('usr/lib/go/bin')
-source=('http://go.googlecode.com/files/go1.1beta1.linux-amd64.tar.gz'
-        "$pkgname.sh")
-#source=("http://go.googlecode.com/files/${pkgname}$pkgver.src.tar.gz"
-sha256sums=('a0ab2aeb1e7845ee9d93c1c52fa62af1956bb903e243d78322000b99fcfd595f'
+if [ "$CARCH" == 'x86_64' ]; then
+  source=("http://go.googlecode.com/files/${pkgname}$pkgver.linux-amd64.tar.gz"
+          "$pkgname.sh")
+  sha256sums=('fc76b716b031d8afba3f3e6bcaca410e8dbf5fb625db5def00fbaaaa960e108c'
             'a03db71d323ed2794123bb31b5c8ad5febd551c490b5c0b341052c8e5f0ba892')
+else
+  source=("http://go.googlecode.com/files/${pkgname}$pkgver.linux-386.tar.gz"
+          "$pkgname.sh")
+  sha256sums=('b4eb8d9b55ae4a78c86213fa968755163ab3a8efa3f5c9f3a472b182b9d9a52e'
+              'a03db71d323ed2794123bb31b5c8ad5febd551c490b5c0b341052c8e5f0ba892')
+fi
 
 build() {
-  cd "$srcdir/$pkgname"
+  cd "$srcdir/$pkgname/src"
 
-  if [ "$CARCH" == 'x86_64' ]; then
-    export GOARCH=amd64
-  elif [ "$CARCH" == 'i686' ]; then
-    export GOARCH=386
-  else
-    # A friendly gesture to Arch Linux ARM
-    export GOARCH=arm
-  fi
   export GOROOT_FINAL=/usr/lib/go
-  export GOOS=linux
 
-  cd src
+  # Enable ARM crosscompilation for linux
+  export GOOS=linux
+  export GOARCH=arm
   bash make.bash
 
-  # Enable ARM crosscompilation for non-arm platforms
-  if [ "$CARCH" == 'x86_64' ]; then
-    export GOARCH=arm
-  elif [ "$CARCH" == 'i686' ]; then
-    export GOARCH=arm
-  fi
-  bash make.bash
+  # Crosscompilation for other platforms too (including linux i686 and x86_64)
+  for os in linux; do # also possible: darwin freebsd windows
+    for arch in amd64 386; do
+      export GOOS=$os
+      export GOARCH=$arch
+      bash make.bash
+    done
+  done
 }
 
 check() {
   cd "$srcdir/$pkgname"
 
+  # Only test for linux and the architecture we're on
+  export GOOS=linux
   if [ "$CARCH" == 'x86_64' ]; then
     export GOARCH=amd64
   elif [ "$CARCH" == 'i686' ]; then
     export GOARCH=386
   else
-    # A friendly gesture to Arch Linux ARM
     export GOARCH=arm
   fi
 
@@ -136,7 +136,7 @@ package() {
   install -Dm644 VERSION $pkgdir/usr/lib/go/VERSION
 
   # Clean up
-  rm -r "$pkgdir/usr/bin/linux_arm"
+  #rm -r "$pkgdir/usr/bin/linux_arm"
 }
 
 # vim:set ts=2 sw=2 et: