2 # Maintainer: Vesa Kaihlavirta <vegai@iki.fi>
3 # Contributor: Andres Perera <andres87p gmail>
4 # Contributor: Matthew Bauer <mjbauer95@gmail.com>
5 # Contributor: Christian Himpel <chressie at gmail dot com>
6 # Contributor: Neal van Veen <nealvanveen at gmail dot com>
12 pkgdesc='Google Go compiler and tools (weekly version)'
13 arch=('i686' 'x86_64')
14 url="http://golang.org/"
17 makedepends=('mercurial' 'inetutils')
21 md5sums=('67c472bfcfdb760d1d1f0a87cfe3661f')
25 _hgroot="https://go.googlecode.com/hg/"
29 msg "Connecting to Mercurial server...."
31 if [ -d $_hgrepo ] ; then
34 msg "The local files are updated."
36 hg clone $_hgroot $_hgrepo
39 msg "Mercurial checkout done or server timeout"
40 msg "Starting make..."
42 rm -rf "$srcdir/$_hgrepo-build"
43 cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
44 cd "$srcdir/$_hgrepo-build"
46 export GOROOT="$srcdir/$_hgrepo-build"
48 export GOBIN="$GOROOT/bin"
49 export PATH="$GOBIN:$PATH"
51 mkdir -p "$GOROOT/bin"
59 export GOROOT="$srcdir/$_hgrepo-build"
61 export GOBIN="$GOROOT/bin"
63 gomake -k test || true
69 install -Dm644 LICENSE $pkgdir/usr/share/licenses/go/LICENSE
70 install -Dm644 misc/bash/go $pkgdir/etc/bash_completion.d/go
71 install -Dm644 misc/emacs/go-mode-load.el $pkgdir/usr/share/emacs/site-lisp/go-mode-load.el
72 install -Dm644 misc/emacs/go-mode.el $pkgdir/usr/share/emacs/site-lisp/go-mode.el
73 install -Dm644 misc/vim/ftdetect/gofiletype.vim $pkgdir/usr/share/vim/vimfiles/ftdetect/gofiletype.vim
74 install -Dm644 misc/vim/syntax/go.vim $pkgdir/usr/share/vim/vimfiles/syntax/go.vim
76 mkdir -p $pkgdir/{etc/profile.d,usr/{share/go,lib/go,lib/go/src}}
79 cp -r doc misc -t $pkgdir/usr/share/go
80 ln -s /usr/share/go/doc $pkgdir/usr/lib/go/doc
81 cp -r pkg $pkgdir/usr/lib/go
82 cp -r $GOROOT/src/pkg $pkgdir/usr/lib/go/src/
83 cp -r $GOROOT/src/lib9 $pkgdir/usr/lib/go/src/
84 cp -r $GOROOT/lib $pkgdir/usr/lib/go/
86 install -Dm644 src/Make.* $pkgdir/usr/lib/go/src
88 # remove object files from target src dir
89 find $pkgdir/usr/lib/go/src/ -type f -name '*.[ao]' -delete
90 find $pkgdir/usr/lib/go/src/pkg -type f -executable -delete
92 # Headers for C modules
93 install -Dm644 src/pkg/runtime/runtime.h $pkgdir/usr/lib/go/src/pkg/runtime/runtime.h
94 install -Dm644 src/pkg/runtime/cgocall.h $pkgdir/usr/lib/go/src/pkg/runtime/cgocall.h
96 install $srcdir/go.sh $pkgdir/etc/profile.d/
97 echo "Source /etc/profile.d/go.sh or relogin"