2011-07-05 20:51:42 +02:00
|
|
|
# Template file for 'go'
|
|
|
|
pkgname=go
|
2015-01-16 15:27:40 +01:00
|
|
|
version=1.4.1
|
2014-09-26 07:11:15 +02:00
|
|
|
revision=1
|
2012-07-29 07:59:11 +02:00
|
|
|
wrksrc=go
|
2014-11-11 10:04:58 +01:00
|
|
|
hostmakedepends="git ca-certificates"
|
2011-07-05 20:51:42 +02:00
|
|
|
short_desc="The Go Programming Language"
|
2014-07-01 16:18:30 +02:00
|
|
|
maintainer="Dominik Honnef <dominik@honnef.co>"
|
2011-07-05 20:51:42 +02:00
|
|
|
homepage="http://golang.org/"
|
|
|
|
license="BSD"
|
2014-06-19 19:40:18 +02:00
|
|
|
distfiles="http://golang.org/dl/go${version}.src.tar.gz"
|
2015-01-20 21:38:35 +01:00
|
|
|
checksum=66665005fac35ba832ff334977e658f961109d89a7a2358ae7707be0efb16fca
|
2011-07-05 20:51:42 +02:00
|
|
|
|
2014-03-05 17:53:19 +01:00
|
|
|
nostrip=yes
|
|
|
|
noverifyrdeps=yes
|
|
|
|
|
2014-08-20 22:21:34 +02:00
|
|
|
_go_targetarch() {
|
2014-03-05 17:53:19 +01:00
|
|
|
case "$XBPS_MACHINE" in
|
2014-08-20 22:21:34 +02:00
|
|
|
arm*) export hostarch=arm;;
|
|
|
|
i686*) export hostarch=386;;
|
|
|
|
x86_64*) export hostarch=amd64;;
|
2014-03-05 17:53:19 +01:00
|
|
|
esac
|
2014-07-01 12:12:22 +02:00
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
|
|
arm*) targetarch=arm;;
|
|
|
|
i686*) targetarch=386;;
|
|
|
|
x86_64*) targetarch=amd64;;
|
2014-08-20 22:21:34 +02:00
|
|
|
*) targetarch=$hostarch;;
|
2014-03-05 17:53:19 +01:00
|
|
|
esac
|
2014-08-20 22:21:34 +02:00
|
|
|
echo $targetarch
|
|
|
|
}
|
2014-03-05 17:53:19 +01:00
|
|
|
|
2014-08-20 22:21:34 +02:00
|
|
|
do_build() {
|
|
|
|
unset GCC CC CXX LD CFLAGS
|
|
|
|
|
|
|
|
targetarch=$(_go_targetarch)
|
2014-07-01 12:12:22 +02:00
|
|
|
export GOROOT=$PWD
|
2012-07-29 07:59:11 +02:00
|
|
|
export GOROOT_FINAL="/usr/lib/go"
|
2014-07-01 16:24:49 +02:00
|
|
|
export GOOS=
|
|
|
|
export GOARCH=
|
2014-07-01 12:12:22 +02:00
|
|
|
export GOPATH=/tmp
|
|
|
|
mkdir -p $GOPATH/src
|
2014-03-05 17:53:19 +01:00
|
|
|
|
2012-07-29 07:59:11 +02:00
|
|
|
cd src
|
2011-07-05 20:51:42 +02:00
|
|
|
|
2014-07-01 16:24:49 +02:00
|
|
|
GOOS=linux
|
|
|
|
GOARCH=arm
|
|
|
|
bash make.bash --no-clean
|
|
|
|
for os in darwin freebsd linux windows; do
|
|
|
|
for arch in 386 amd64; do
|
|
|
|
GOARCH=$arch
|
|
|
|
GOOS=$os
|
|
|
|
bash make.bash --no-clean
|
|
|
|
done
|
2014-07-01 11:16:18 +02:00
|
|
|
done
|
2014-07-01 12:12:22 +02:00
|
|
|
|
2014-07-01 16:24:49 +02:00
|
|
|
GOOS=linux
|
2014-07-01 12:12:22 +02:00
|
|
|
GOARCH=$targetarch
|
|
|
|
|
2014-11-11 10:04:58 +01:00
|
|
|
git clone https://go.googlesource.com/tools \
|
|
|
|
-b release-branch.go$(echo "$version" | cut -d "." -f "1-2") \
|
|
|
|
$GOPATH/src/golang.org/x/tools
|
2014-07-01 12:12:22 +02:00
|
|
|
|
|
|
|
for tool in godoc vet cover; do
|
2014-11-11 10:04:58 +01:00
|
|
|
$GOROOT/bin/go install golang.org/x/tools/cmd/${tool}
|
2014-07-01 12:12:22 +02:00
|
|
|
done
|
2011-07-05 20:51:42 +02:00
|
|
|
}
|
|
|
|
|
2011-10-14 19:24:20 +02:00
|
|
|
do_install() {
|
2014-03-05 17:53:19 +01:00
|
|
|
if [ "$CROSS_BUILD" ]; then
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
|
|
arm*) bindir=bin/linux_arm;;
|
|
|
|
i686*) bindir=bin/linux_386;;
|
|
|
|
x86_64*) bindir=bin/linux_amd64;;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
bindir=bin
|
|
|
|
fi
|
|
|
|
|
|
|
|
vmkdir usr/bin
|
2014-11-11 10:04:58 +01:00
|
|
|
vmkdir usr/lib/go
|
|
|
|
vmkdir usr/share/go
|
2014-08-20 22:21:34 +02:00
|
|
|
cp -d --preserve=all ${bindir}/* ${DESTDIR}/usr/bin || true
|
2014-11-11 10:04:58 +01:00
|
|
|
cp -a pkg src lib include ${DESTDIR}/usr/lib/go
|
|
|
|
cp -r doc misc -t ${DESTDIR}/usr/share/go
|
|
|
|
ln -s /usr/share/go/doc ${DESTDIR}/usr/lib/go/doc
|
2012-07-29 07:59:11 +02:00
|
|
|
vinstall ${FILESDIR}/go.sh 755 etc/profile.d
|
2014-11-11 10:04:58 +01:00
|
|
|
vlicense LICENSE
|
2012-07-29 07:59:11 +02: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.
|
|
|
|
#
|
|
|
|
# Also, /usr/bin is the place for system-wide executables,
|
|
|
|
# not /usr/lib/go/bin. Users should use different paths by
|
|
|
|
# setting the appropriate environment variables.
|
|
|
|
#
|
|
|
|
ln -sf /usr/bin ${DESTDIR}/usr/lib/go/bin
|
|
|
|
|
|
|
|
# For godoc
|
|
|
|
vinstall favicon.ico 644 usr/lib/go
|
|
|
|
|
|
|
|
rm -f ${DESTDIR}/usr/share/go/doc/articles/wiki/get.bin
|
2011-07-05 20:51:42 +02:00
|
|
|
}
|
2014-08-20 22:21:34 +02:00
|
|
|
|
|
|
|
go-cross-linux_package() {
|
|
|
|
nostrip=yes
|
2014-08-20 22:34:15 +02:00
|
|
|
noverifyrdeps=yes
|
2014-08-20 22:21:34 +02:00
|
|
|
depends="${sourcepkg}-${version}_${revision}"
|
|
|
|
short_desc+=" - Cross compilers for Linux"
|
|
|
|
pkg_install() {
|
|
|
|
targetarch=$(_go_targetarch)
|
|
|
|
mkdir -p $PKGDESTDIR/usr/lib/go/pkg/tool/
|
|
|
|
cd ${DESTDIR}/usr/lib/go/pkg/tool/
|
|
|
|
for i in linux_*; do
|
|
|
|
if [ "$i" != "linux_${targetarch}" ]; then
|
|
|
|
mv "$i" $PKGDESTDIR/usr/lib/go/pkg/tool/
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p $PKGDESTDIR/usr/lib/go/pkg/
|
|
|
|
cd ${DESTDIR}/usr/lib/go/pkg/
|
|
|
|
for i in linux_*; do
|
|
|
|
if [ "$i" != "linux_${targetarch}" ]; then
|
|
|
|
mv "$i" $PKGDESTDIR/usr/lib/go/pkg/
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2014-11-11 10:04:58 +01:00
|
|
|
mkdir -p $PKGDESTDIR/usr/lib/go/src/runtime/
|
|
|
|
cd ${DESTDIR}/usr/lib/go/src/runtime/
|
2014-08-20 22:21:34 +02:00
|
|
|
for i in zasm_linux_*.h; do
|
|
|
|
if [ "$i" != "zasm_linux_${targetarch}.h" ]; then
|
2014-11-11 10:04:58 +01:00
|
|
|
mv "$i" $PKGDESTDIR/usr/lib/go/src/runtime/
|
2014-08-20 22:21:34 +02:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
go-cross-darwin_package() {
|
|
|
|
nostrip=yes
|
2014-08-20 22:34:15 +02:00
|
|
|
noverifyrdeps=yes
|
2014-08-20 22:21:34 +02:00
|
|
|
depends="${sourcepkg}-${version}_${revision}"
|
|
|
|
short_desc+=" - Cross compilers for Darwin"
|
|
|
|
pkg_install() {
|
|
|
|
vmove "usr/lib/go/pkg/tool/darwin_*"
|
|
|
|
vmove "usr/lib/go/pkg/darwin_*"
|
2014-11-11 10:04:58 +01:00
|
|
|
vmove "usr/lib/go/src/runtime/zasm_darwin_*.h"
|
2014-08-20 22:21:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
go-cross-freebsd_package() {
|
|
|
|
nostrip=yes
|
2014-08-20 22:34:15 +02:00
|
|
|
noverifyrdeps=yes
|
2014-08-20 22:21:34 +02:00
|
|
|
depends="${sourcepkg}-${version}_${revision}"
|
|
|
|
short_desc+=" - Cross compilers for FreeBSD"
|
|
|
|
pkg_install() {
|
|
|
|
vmove "usr/lib/go/pkg/tool/freebsd_*"
|
|
|
|
vmove "usr/lib/go/pkg/freebsd_*"
|
2014-11-11 10:04:58 +01:00
|
|
|
vmove "usr/lib/go/src/runtime/zasm_freebsd_*.h"
|
2014-08-20 22:21:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
go-cross-windows_package() {
|
|
|
|
nostrip=yes
|
2014-08-20 22:34:15 +02:00
|
|
|
noverifyrdeps=yes
|
2014-08-20 22:21:34 +02:00
|
|
|
depends="${sourcepkg}-${version}_${revision}"
|
|
|
|
short_desc+=" - Cross compilers for Windows"
|
|
|
|
pkg_install() {
|
|
|
|
vmove "usr/lib/go/pkg/tool/windows_*"
|
|
|
|
vmove "usr/lib/go/pkg/windows_*"
|
2014-11-11 10:04:58 +01:00
|
|
|
vmove "usr/lib/go/src/runtime/zasm_windows_*.h"
|
2014-08-20 22:21:34 +02:00
|
|
|
}
|
|
|
|
}
|