PKGBUILDs/community/go/PKGBUILD

133 lines
4.1 KiB
Bash
Raw Normal View History

2013-04-08 18:56:19 +00:00
# $Id: PKGBUILD 86967 2013-03-25 13:19:54Z arodseth $
2012-11-22 18:49:32 +00:00
# Maintainer: Vesa Kaihlavirta <vegai@iki.fi>
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Rémy Oudompheng <remy@archlinux.org>
# Contributor: Andres Perera <andres87p gmail>
# Contributor: Matthew Bauer <mjbauer95@gmail.com>
# Contributor: Christian Himpel <chressie@gmail.com>
# Contributor: Mike Rosset <mike.rosset@gmail.com>
# Contributor: Daniel YC Lin <dlin.tw@gmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - added switches for our architectures
2013-04-08 18:56:19 +00:00
# ALARM: Alexander Rødseth <rodseth@gmail.com>
2013-04-09 22:15:48 +00:00
# - Go 1.1beta2 support
2012-11-22 18:49:32 +00:00
pkgname=go
2013-08-13 14:56:38 +00:00
pkgver=1.1.2
pkgrel=2
2012-11-22 18:49:32 +00:00
epoch=2
2013-06-02 19:05:10 +00:00
pkgdesc='Compiler and tools for the Go programming language from Google'
2012-11-22 18:49:32 +00:00
url='http://golang.org/'
license=('custom')
depends=('perl' 'gawk')
makedepends=('inetutils')
2013-03-25 21:30:50 +00:00
options=('!strip')
install="$pkgname.install"
2012-11-22 18:49:32 +00:00
backup=('usr/lib/go/bin')
source=("http://go.googlecode.com/files/${pkgname}$pkgver.src.tar.gz"
2013-04-08 18:56:19 +00:00
"$pkgname.sh")
2013-08-13 14:56:38 +00:00
sha256sums=('56f384c973e58c098ec462bcd892a7c1166b9a392461970ddb22d57ed4d495af'
'36202a833faeb8ea10760557a1e221025288480bdeebf776c8b610014aadc181')
2012-11-22 18:49:32 +00:00
build() {
2013-05-02 18:09:25 +00:00
cd "$srcdir/$pkgname/src"
2013-04-08 18:56:19 +00:00
[ "$CARCH" == 'arm' ] && export GOARM=5
[ "$CARCH" == 'armv6h' ] && export GOARM=6
[ "$CARCH" == 'armv7h' ] && export GOARM=7
2012-11-22 18:49:32 +00:00
2013-04-08 18:56:19 +00:00
export GOARCH=arm
2012-11-22 18:49:32 +00:00
export GOROOT_FINAL=/usr/lib/go
export GOOS=linux
2013-04-08 18:56:19 +00:00
2012-11-22 18:49:32 +00:00
bash make.bash
}
check() {
2013-04-08 18:56:19 +00:00
cd "$srcdir/$pkgname"
[ "$CARCH" == 'arm' ] && export GOARM=5
[ "$CARCH" == 'armv6h' ] && export GOARM=6
[ "$CARCH" == 'armv7h' ] && export GOARM=7
export GOARCH=arm
export GOROOT="$srcdir/$pkgname"
export PATH="$srcdir/$pkgname/bin:$PATH"
2012-11-22 18:49:32 +00:00
# TestSimpleMulticastListener will fail in standard chroot.
cd src && bash run.bash --no-rebuild || true
}
package() {
2013-04-08 18:56:19 +00:00
cd "$srcdir/$pkgname"
2013-04-09 00:44:20 +00:00
export GOROOT="$srcdir/$pkgname"
2012-11-29 16:12:53 +00:00
2013-04-09 22:15:48 +00:00
export GOROOT="$srcdir/$pkgname"
2012-11-22 18:49:32 +00:00
install -Dm644 LICENSE \
2013-06-02 19:05:10 +00:00
"$pkgdir/usr/share/licenses/go/LICENSE"
2012-11-22 18:49:32 +00:00
install -Dm644 misc/bash/go \
2013-06-02 19:05:10 +00:00
"$pkgdir/usr/share/bash-completion/completions/go"
2012-11-22 18:49:32 +00:00
install -Dm644 misc/emacs/go-mode-load.el \
2013-06-02 19:05:10 +00:00
"$pkgdir/usr/share/emacs/site-lisp/go-mode-load.el"
2012-11-22 18:49:32 +00:00
install -Dm644 misc/emacs/go-mode.el \
2013-06-02 19:05:10 +00:00
"$pkgdir/usr/share/emacs/site-lisp/go-mode.el"
2012-11-22 18:49:32 +00:00
install -Dm644 misc/zsh/go \
2013-06-02 19:05:10 +00:00
"$pkgdir/usr/share/zsh/site-functions/_go"
2012-11-22 18:49:32 +00:00
for f in ftdetect/gofiletype.vim autoload/go/complete.vim indent/go.vim \
2013-04-08 18:56:19 +00:00
ftplugin/go/fmt.vim ftplugin/go/import.vim \
2012-11-22 18:49:32 +00:00
syntax/go.vim syntax/godoc.vim plugin/godoc.vim;
do
2013-06-02 19:05:10 +00:00
install -Dm644 "misc/vim/$f" "$pkgdir/usr/share/vim/vimfiles/$f"
2012-11-22 18:49:32 +00:00
done
2013-05-26 17:41:54 +00:00
mkdir -p \
2013-06-02 19:05:10 +00:00
"$pkgdir/"{etc/profile.d,usr/{share/go,lib/go,lib/go/src,lib/go/site/src}}
2012-11-22 18:49:32 +00:00
2013-06-02 19:05:10 +00:00
cp -r doc misc -t "$pkgdir/usr/share/go"
ln -s /usr/share/go/doc "$pkgdir/usr/lib/go/doc"
cp -a bin "$pkgdir/usr"
cp -a pkg "$pkgdir/usr/lib/go"
cp -a $GOROOT/src/pkg "$pkgdir/usr/lib/go/src/"
cp -a $GOROOT/src/cmd "$pkgdir/usr/lib/go/src/cmd"
cp -a $GOROOT/src/lib9 "$pkgdir/usr/lib/go/src/"
cp -a $GOROOT/lib "$pkgdir/usr/lib/go/"
cp -a $GOROOT/include "$pkgdir/usr/lib/go/"
2012-11-22 18:49:32 +00:00
2013-06-02 19:05:10 +00:00
install -Dm644 src/Make.* "$pkgdir/usr/lib/go/src"
2012-11-22 18:49:32 +00:00
# Remove object files from target src dir
2013-06-02 19:05:10 +00:00
find "$pkgdir/usr/lib/go/src/" -type f -name '*.[ao]' -delete
2013-04-08 18:56:19 +00:00
2012-11-28 19:20:12 +00:00
# Fix for FS#32813
2013-06-02 19:05:10 +00:00
find "$pkgdir" -type f -name sql.go -exec chmod -x {} \;
2013-04-08 18:56:19 +00:00
2012-11-28 19:20:12 +00:00
# Remove all executable source files
2013-06-02 19:05:10 +00:00
find "$pkgdir/usr/lib/go/src/pkg" -type f -executable -delete
2012-11-22 18:49:32 +00:00
# Headers for C modules
install -Dm644 src/pkg/runtime/runtime.h \
2013-06-02 19:05:10 +00:00
"$pkgdir/usr/lib/go/src/pkg/runtime/runtime.h"
2012-11-22 18:49:32 +00:00
install -Dm644 src/pkg/runtime/cgocall.h \
2013-06-02 19:05:10 +00:00
"$pkgdir/usr/lib/go/src/pkg/runtime/cgocall.h"
2012-11-22 18:49:32 +00:00
# For packages that source /etc/profile.d/go.sh
2013-06-02 19:05:10 +00:00
install -Dm755 "$srcdir/$pkgname.sh" "$pkgdir/etc/profile.d/$pkgname.sh"
2012-11-22 18:49:32 +00:00
# This is to make go get code.google.com/p/go-tour/gotour and
# then running the gotour executable work out of the box.
2013-06-02 19:05:10 +00:00
ln -sf /usr/bin "$pkgdir/usr/lib/go/bin"
2012-11-22 18:49:32 +00:00
# For godoc
2013-06-02 19:05:10 +00:00
install -Dm644 favicon.ico "$pkgdir/usr/lib/go/favicon.ico"
2012-11-22 18:49:32 +00:00
2013-06-02 19:05:10 +00:00
rm -f "$pkgdir/usr/share/go/doc/articles/wiki/get.bin"
2012-11-22 18:49:32 +00:00
2013-06-02 19:05:10 +00:00
install -Dm644 VERSION "$pkgdir/usr/lib/go/VERSION"
2013-06-01 12:58:40 +00:00
2013-06-03 15:39:59 +00:00
find "$pkgdir/usr/"{lib/go/pkg,bin} -type f -exec touch '{}' +
2012-11-22 18:49:32 +00:00
}
# vim:set ts=2 sw=2 et: