diff options
Diffstat (limited to 'community/go')
-rw-r--r-- | community/go/PKGBUILD | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/community/go/PKGBUILD b/community/go/PKGBUILD index 9eee99996..3307eb9c3 100644 --- a/community/go/PKGBUILD +++ b/community/go/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 106448 2014-03-03 17:04:25Z arodseth $ +# $Id: PKGBUILD 108061 2014-03-22 01:23:54Z arodseth $ # Maintainer: Vesa Kaihlavirta <vegai@iki.fi> # Maintainer: Alexander Rødseth <rodseth@gmail.com> # Contributor: Rémy Oudompheng <remy@archlinux.org> @@ -7,11 +7,12 @@ # Contributor: Christian Himpel <chressie@gmail.com> # Contributor: Mike Rosset <mike.rosset@gmail.com> # Contributor: Daniel YC Lin <dlin.tw@gmail.com> +# Contributor: John Luebs <jkluebs@gmail.com> pkgname=go -pkgver=1.2.1 -pkgrel=1 epoch=2 +pkgver=1.2.1 +pkgrel=2 pkgdesc='Compiler and tools for the Go programming language from Google' arch=('x86_64' 'i686') url='http://golang.org/' @@ -27,8 +28,10 @@ source=("$pkgname-$pkgver::hg+https://code.google.com/p/$pkgname#branch=release- md5sums=('SKIP') build() { - cd "$pkgname-$pkgver/src" + export GOROOT="$srcdir/$pkgname-$pkgver" + cd "$GOROOT/src" + export GOPATH="$srcdir/" export GOROOT_FINAL=/usr/lib/go # @@ -53,8 +56,18 @@ build() { done done - # TODO: Find a way to install these tools as well: - #go get code.google.com/p/go.tools/cmd/... + GOOS=linux + case "$CARCH" in + x86_64) GOARCH=amd64 ;; + i686) GOARCH=386 ;; + esac + + $GOROOT/bin/go get -d code.google.com/p/go.tools/cmd/godoc + $GOROOT/bin/go build -o $srcdir/godoc code.google.com/p/go.tools/cmd/godoc + for tool in vet cover; do + $GOROOT/bin/go get -d code.google.com/p/go.tools/cmd/${tool} + $GOROOT/bin/go build -o $GOROOT/pkg/tool/${GOOS}_${GOARCH}/${tool} code.google.com/p/go.tools/cmd/${tool} + done } check() { @@ -78,6 +91,9 @@ check() { package() { cd "$pkgname-$pkgver" + export GOROOT="$srcdir/$pkgname-$pkgver" + + install -Dm755 $srcdir/godoc $pkgdir/usr/bin/godoc install -Dm644 LICENSE \ "$pkgdir/usr/share/licenses/go/LICENSE" |