2011-07-05 18:51:42 +00:00
|
|
|
# Template file for 'go'
|
|
|
|
pkgname=go
|
2014-03-05 16:00:14 +00:00
|
|
|
version=1.2.1
|
2012-06-03 07:08:53 +00:00
|
|
|
revision=1
|
2012-07-29 05:59:11 +00:00
|
|
|
wrksrc=go
|
|
|
|
makedepends="ed bison"
|
2014-01-01 15:10:11 +00:00
|
|
|
depends="perl gawk"
|
2011-07-05 18:51:42 +00:00
|
|
|
short_desc="The Go Programming Language"
|
2011-07-17 06:27:36 +00:00
|
|
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
2011-07-05 18:51:42 +00:00
|
|
|
homepage="http://golang.org/"
|
|
|
|
license="BSD"
|
2012-07-29 05:59:11 +00:00
|
|
|
distfiles="http://go.googlecode.com/files/go${version}.src.tar.gz"
|
2014-03-05 16:00:14 +00:00
|
|
|
checksum=1655a9367bec083df57cacc29add280c279791801e102fd851c00d8babd12a55
|
2011-07-05 18:51:42 +00:00
|
|
|
|
2014-03-05 16:53:19 +00:00
|
|
|
nostrip=yes
|
|
|
|
noverifyrdeps=yes
|
|
|
|
|
2012-07-29 05:59:11 +00:00
|
|
|
do_build() {
|
2014-03-05 16:53:19 +00:00
|
|
|
unset GCC CC CXX LD CFLAGS
|
|
|
|
|
|
|
|
case "$XBPS_MACHINE" in
|
|
|
|
arm*) export GOHOSTARCH=arm;;
|
|
|
|
i686*) export GOHOSTARCH=386;;
|
|
|
|
x86_64*) export GOHOSTARCH=amd64;;
|
|
|
|
esac
|
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
|
|
armv6l*) export GOARM=6;;
|
|
|
|
armv7l*) export GOARM=7;;
|
|
|
|
esac
|
|
|
|
|
2012-07-29 05:59:11 +00:00
|
|
|
export GOROOT_FINAL="/usr/lib/go"
|
|
|
|
export GOOS=linux
|
2014-03-05 16:53:19 +00:00
|
|
|
|
2012-07-29 05:59:11 +00:00
|
|
|
cd src
|
2014-03-05 16:53:19 +00:00
|
|
|
# ARM build
|
|
|
|
export GOARCH=arm
|
2012-07-29 05:59:11 +00:00
|
|
|
bash make.bash
|
2011-07-05 18:51:42 +00:00
|
|
|
|
2014-03-05 16:53:19 +00:00
|
|
|
# x86 build
|
2012-07-29 05:59:11 +00:00
|
|
|
export GOARCH=386
|
|
|
|
bash make.bash
|
2011-07-05 18:51:42 +00:00
|
|
|
|
2014-03-05 16:53:19 +00:00
|
|
|
# x86_64 build
|
|
|
|
export GOARCH=amd64
|
|
|
|
bash make.bash
|
2011-07-05 18:51:42 +00:00
|
|
|
}
|
|
|
|
|
2011-10-14 17:24:20 +00:00
|
|
|
do_install() {
|
2012-07-29 05:59:11 +00:00
|
|
|
vinstall LICENSE 644 usr/share/licenses/go
|
|
|
|
vinstall misc/bash/go 644 usr/share/bash-completion/completions
|
|
|
|
vinstall misc/emacs/go-mode-load.el 644 usr/share/emacs/site-lisp
|
|
|
|
vinstall misc/emacs/go-mode.el 644 usr/share/emacs/site-lisp
|
|
|
|
vinstall misc/zsh/go 644 usr/share/zsh/site-functions _go
|
|
|
|
|
|
|
|
for f in ftdetect/gofiletype.vim autoload/go/complete.vim indent/go.vim \
|
2013-05-30 09:07:25 +00:00
|
|
|
ftplugin/go/fmt.vim ftplugin/go/import.vim \
|
2012-07-29 05:59:11 +00:00
|
|
|
syntax/go.vim syntax/godoc.vim plugin/godoc.vim; do
|
|
|
|
vinstall misc/vim/$f 644 usr/share/vim/vimfiles
|
2011-07-05 18:51:42 +00:00
|
|
|
done
|
2012-07-29 05:59:11 +00:00
|
|
|
|
2014-01-05 09:51:35 +00:00
|
|
|
install -d ${DESTDIR}/{etc/profile.d,usr/{share/go,lib/go,lib/go/src,lib/go/site/src}}
|
2012-07-29 05:59:11 +00:00
|
|
|
|
|
|
|
cp -r doc misc -t ${DESTDIR}/usr/share/go
|
|
|
|
ln -s /usr/share/go/doc ${DESTDIR}/usr/lib/go/doc
|
2014-03-05 16:53:19 +00: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
|
|
|
|
cp -a ${bindir}/* ${DESTDIR}/usr/bin
|
2012-07-29 05:59:11 +00:00
|
|
|
cp -a pkg ${DESTDIR}/usr/lib/go
|
|
|
|
cp -a src/pkg ${DESTDIR}/usr/lib/go/src/
|
|
|
|
cp -a src/cmd ${DESTDIR}/usr/lib/go/src/cmd
|
|
|
|
cp -a src/lib9 ${DESTDIR}/usr/lib/go/src/
|
|
|
|
cp -a lib ${DESTDIR}/usr/lib/go/
|
2014-01-05 09:51:35 +00:00
|
|
|
cp -a include ${DESTDIR}/usr/lib/go/
|
2012-07-29 05:59:11 +00:00
|
|
|
|
|
|
|
install -Dm644 src/Make.* ${DESTDIR}/usr/lib/go/src
|
|
|
|
|
|
|
|
# Remove object files from target src dir
|
|
|
|
find ${DESTDIR}/usr/lib/go/src/ -type f -name '*.[ao]' -delete
|
|
|
|
find ${DESTDIR}/usr/lib/go/src/pkg -type f -executable -delete
|
|
|
|
|
|
|
|
# Headers for C modules
|
|
|
|
vinstall src/pkg/runtime/runtime.h 644 usr/lib/go/src/pkg/runtime
|
|
|
|
vinstall src/pkg/runtime/cgocall.h 644 usr/lib/go/src/pkg/runtime
|
|
|
|
|
|
|
|
# For packages that source /etc/profile.d/go.sh
|
|
|
|
vinstall ${FILESDIR}/go.sh 755 etc/profile.d
|
|
|
|
|
|
|
|
# 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 18:51:42 +00:00
|
|
|
}
|