PKGBUILDs/community/go/PKGBUILD

142 lines
4.7 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>
2014-03-22 15:00:40 +00:00
# Contributor: John Luebs <jkluebs@gmail.com>
2014-01-27 17:32:44 +00:00
2012-11-22 18:49:32 +00:00
# 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
2014-03-22 15:00:40 +00:00
epoch=2
2014-03-03 18:32:22 +00:00
pkgver=1.2.1
pkgrel=5
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')
2014-03-03 18:32:22 +00:00
makedepends=('inetutils' 'mercurial')
2013-10-30 15:09:58 +00:00
options=('!strip' 'staticlibs')
2014-03-26 13:05:40 +00:00
optdepends=('mercurial: for fetching sources from mercurial repositories'
'git: for fetching sources from git repositories'
'bzr: for fetching sources from bazaar repositories'
'subversion: for fetching sources from subversion repositories')
2013-03-25 21:30:50 +00:00
install="$pkgname.install"
2014-03-03 18:32:22 +00:00
source=("$pkgname-$pkgver::hg+https://code.google.com/p/$pkgname#branch=release-branch.$pkgname${pkgver/.1}")
md5sums=('SKIP')
2012-11-22 18:49:32 +00:00
build() {
2014-03-03 18:32:22 +00:00
cd "$pkgname-$pkgver/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
2014-03-22 15:00:40 +00:00
export GOPATH="$srcdir/"
export GOROOT="$srcdir/$pkgname-$pkgver"
2013-04-08 18:56:19 +00:00
2012-11-22 18:49:32 +00:00
bash make.bash
2014-03-03 18:32:22 +00:00
2014-03-22 15:00:40 +00:00
$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
2012-11-22 18:49:32 +00:00
}
check() {
2014-03-03 18:32:22 +00:00
cd "$pkgname-$pkgver"
2013-04-08 18:56:19 +00:00
[ "$CARCH" == 'arm' ] && export GOARM=5
[ "$CARCH" == 'armv6h' ] && export GOARM=6
[ "$CARCH" == 'armv7h' ] && export GOARM=7
export GOARCH=arm
2014-03-03 18:32:22 +00:00
export GOROOT="$srcdir/$pkgname-$pkgver"
export PATH="$srcdir/$pkgname-$pkgver/bin:$PATH"
2012-11-22 18:49:32 +00:00
2013-10-30 15:09:58 +00:00
# TestSimpleMulticastListener will fail in standard chroot
2012-11-22 18:49:32 +00:00
cd src && bash run.bash --no-rebuild || true
}
package() {
2014-03-03 18:32:22 +00:00
cd "$pkgname-$pkgver"
2012-11-29 16:12:53 +00:00
2014-03-03 18:55:01 +00:00
export GOROOT="$srcdir/$pkgname-$pkgver"
2013-04-09 22:15:48 +00:00
2014-03-22 15:00:40 +00:00
install -Dm755 ../godoc "$pkgdir/usr/bin/godoc"
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
# 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: