PKGBUILDs/community/go/PKGBUILD

123 lines
3.8 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>
2015-09-12 14:58:15 +00:00
# Contributor: Pierre Neidhardt <ambrevar@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
2015-11-18 01:33:33 +00:00
# - cherry-pick upstream commit to fix multiple definition linker error
# https://github.com/golang/go/issues/9510
2012-11-22 18:49:32 +00:00
pkgname=go
2014-03-22 15:00:40 +00:00
epoch=2
2015-12-04 01:29:37 +00:00
pkgver=1.5.2
pkgrel=1
2013-06-02 19:05:10 +00:00
pkgdesc='Compiler and tools for the Go programming language from Google'
2015-09-12 14:58:15 +00:00
arch=('arm' 'armv6h' 'armv7h' 'aarch64')
2012-11-22 18:49:32 +00:00
url='http://golang.org/'
2015-09-12 14:58:15 +00:00
license=('BSD')
makedepends=('inetutils' 'git' 'go')
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"
2015-01-18 01:08:44 +00:00
source=("$pkgname-$pkgver::git+https://go.googlesource.com/go#tag=$pkgname$pkgver")
2014-03-03 18:32:22 +00:00
md5sums=('SKIP')
2012-11-22 18:49:32 +00:00
2015-11-18 01:33:33 +00:00
prepare() {
cd "$pkgname-$pkgver/src"
git cherry-pick -n 754f707f5f6b870892b78814bac4f90086312039
}
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
2015-08-21 00:19:21 +00:00
export GOARCH=arm
2013-04-08 18:56:19 +00:00
[ "$CARCH" == 'arm' ] && export GOARM=5
[ "$CARCH" == 'armv6h' ] && export GOARM=6
[ "$CARCH" == 'armv7h' ] && export GOARM=7
2015-08-21 00:19:21 +00:00
[ "$CARCH" == 'aarch64' ] && export GOARCH=arm64
2012-11-22 18:49:32 +00:00
export GOROOT_FINAL=/usr/lib/go
2015-08-20 19:27:46 +00:00
export GOROOT_BOOTSTRAP=/usr/lib/go
2012-11-22 18:49:32 +00:00
export GOOS=linux
2014-03-22 15:00:40 +00:00
export GOPATH="$srcdir/"
export GOROOT="$srcdir/$pkgname-$pkgver"
2014-05-13 13:06:49 +00:00
export GOBIN="$GOROOT/bin"
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-12-12 01:48:23 +00:00
$GOROOT/bin/go get -d golang.org/x/tools/cmd/godoc
$GOROOT/bin/go build -o $srcdir/godoc golang.org/x/tools/cmd/godoc
2015-03-24 18:19:57 +00:00
for tool in vet cover callgraph; do
2014-12-12 01:48:23 +00:00
$GOROOT/bin/go get -d golang.org/x/tools/cmd/${tool}
$GOROOT/bin/go build -o $GOROOT/pkg/tool/${GOOS}_${GOARCH}/${tool} golang.org/x/tools/cmd/${tool}
2014-03-22 15:00:40 +00:00
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
2015-08-21 00:19:21 +00:00
export GOARCH=arm
2013-04-08 18:56:19 +00:00
[ "$CARCH" == 'arm' ] && export GOARM=5
[ "$CARCH" == 'armv6h' ] && export GOARM=6
[ "$CARCH" == 'armv7h' ] && export GOARM=7
2015-08-21 00:19:21 +00:00
[ "$CARCH" == 'aarch64' ] && export GOARCH=arm64
2013-04-08 18:56:19 +00:00
2014-03-03 18:32:22 +00:00
export GOROOT="$srcdir/$pkgname-$pkgver"
2014-05-13 13:06:49 +00:00
export GOBIN="$GOROOT/bin"
2014-03-03 18:32:22 +00:00
export PATH="$srcdir/$pkgname-$pkgver/bin:$PATH"
2015-08-20 19:27:46 +00:00
export GOROOT_BOOTSTRAP=/usr/lib/go
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"
2014-05-13 13:06:49 +00:00
export GOBIN="$GOROOT/bin"
2015-08-20 19:27:46 +00:00
export GOROOT_BOOTSTRAP=/usr/lib/go
2013-04-09 22:15:48 +00:00
2014-05-13 13:06:49 +00:00
install -Dm755 "$srcdir/godoc" "$pkgdir/usr/bin/godoc"
2014-03-22 15:00:40 +00:00
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
2013-05-26 17:41:54 +00:00
mkdir -p \
2015-09-12 14:58:15 +00:00
"$pkgdir/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"
2014-12-12 01:48:23 +00:00
cp -a "$GOROOT/src" "$pkgdir/usr/lib/go/"
2015-09-12 14:58:15 +00:00
cp -a "$GOROOT/lib" "$pkgdir/usr/lib/go/"
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
2014-11-07 14:39:12 +00:00
cp -r misc/ "$pkgdir/usr/lib/go/"
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
install -Dm644 VERSION "$pkgdir/usr/lib/go/VERSION"
2015-09-12 14:58:15 +00:00
# Clean Windows specific files.
rm -f "$pkgdir"/usr/lib/go/src/*.bat
2012-11-22 18:49:32 +00:00
}
2015-09-12 14:58:15 +00:00
2012-11-22 18:49:32 +00:00
# vim:set ts=2 sw=2 et: