2 # Maintainer: Brennan Taylor <taylor.brennan at gmail>
7 pkgdesc='A compiler toolchain from Google for the Go programming language'
9 url='http://golang.org/'
11 depends=('perl' 'ed' 'bison' 'make' 'awk')
12 makedepends=('mercurial')
16 install=$pkgname.install
18 md5sums=('bc2b023837973b4aeb6966a58564fa68')
21 _hgroot="https://go.googlecode.com/hg/"
25 msg "Connecting to Mercurial server...."
27 if [ -d $_hgrepo ] ; then
30 msg "The local files are updated."
32 hg clone -r weekly $_hgroot $_hgrepo
35 msg "Mercurial checkout done or server timeout"
36 msg "Starting make..."
38 rm -rf "$srcdir/$_hgrepo-build"
39 cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
40 cd "$srcdir/$_hgrepo-build"
42 export GOROOT="$srcdir/$_hgrepo-build"
43 export GOROOT_FINAL="/opt/go/"
45 export GOBIN="$GOROOT/bin"
46 export PATH="$GOBIN:$PATH"
48 mkdir -p "$GOROOT/bin"
57 install -Dm644 go-build/misc/bash/go $pkgdir/etc/bash_completion.d/go
58 install -Dm644 go-build/misc/emacs/go-mode-load.el $pkgdir/usr/share/emacs/site-lisp/go-mode-load.el
59 install -Dm644 go-build/misc/emacs/go-mode.el $pkgdir/usr/share/emacs/site-lisp/go-mode.el
60 install -Dm644 go-build/misc/vim/syntax/go.vim $pkgdir/usr/share/vim/vimfiles/syntax/go.vim
61 install -Dm644 go-build/misc/vim/ftdetect/gofiletype.vim $pkgdir/usr/share/vim/vimfiles/syntax/gofiletype.vim
63 mkdir -p $pkgdir/{etc/profile.d,opt/go}
64 for i in bin doc misc src lib include pkg ; do
65 cp -r go-build/$i $pkgdir/opt/go/$i
68 install $srcdir/go.sh $pkgdir/etc/profile.d/
70 # Point Python scripts to the python2 binary
71 cd $pkgdir/opt/go/misc/dashboard
72 sed -i 's/python$/\02/' googlecode_upload.py godashboard/app.yaml