go: cross build support.
This commit is contained in:
parent
ba9e78889d
commit
7d2b60418b
1 changed files with 35 additions and 16 deletions
|
@ -3,7 +3,6 @@ pkgname=go
|
||||||
version=1.2.1
|
version=1.2.1
|
||||||
revision=1
|
revision=1
|
||||||
wrksrc=go
|
wrksrc=go
|
||||||
nostrip=yes
|
|
||||||
makedepends="ed bison"
|
makedepends="ed bison"
|
||||||
depends="perl gawk"
|
depends="perl gawk"
|
||||||
short_desc="The Go Programming Language"
|
short_desc="The Go Programming Language"
|
||||||
|
@ -13,29 +12,37 @@ license="BSD"
|
||||||
distfiles="http://go.googlecode.com/files/go${version}.src.tar.gz"
|
distfiles="http://go.googlecode.com/files/go${version}.src.tar.gz"
|
||||||
checksum=1655a9367bec083df57cacc29add280c279791801e102fd851c00d8babd12a55
|
checksum=1655a9367bec083df57cacc29add280c279791801e102fd851c00d8babd12a55
|
||||||
|
|
||||||
|
nostrip=yes
|
||||||
|
noverifyrdeps=yes
|
||||||
|
|
||||||
do_build() {
|
do_build() {
|
||||||
cd ${wrksrc}
|
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
|
||||||
|
|
||||||
export GOROOT_FINAL="/usr/lib/go"
|
export GOROOT_FINAL="/usr/lib/go"
|
||||||
export GOOS=linux
|
export GOOS=linux
|
||||||
|
|
||||||
|
cd src
|
||||||
|
# ARM build
|
||||||
export GOARCH=arm
|
export GOARCH=arm
|
||||||
cd src
|
|
||||||
bash make.bash
|
bash make.bash
|
||||||
|
|
||||||
cd ${wrksrc}
|
# x86 build
|
||||||
export GOROOT_FINAL="/usr/lib/go"
|
|
||||||
export GOOS=linux
|
|
||||||
export GOARCH=386
|
export GOARCH=386
|
||||||
cd src
|
|
||||||
bash make.bash
|
bash make.bash
|
||||||
|
|
||||||
if [ "${XBPS_MACHINE}" = "x86_64" ]; then
|
# x86_64 build
|
||||||
cd ${wrksrc}
|
export GOARCH=amd64
|
||||||
export GOROOT_FINAL="/usr/lib/go"
|
bash make.bash
|
||||||
export GOOS=linux
|
|
||||||
export GOARCH=amd64
|
|
||||||
cd src
|
|
||||||
bash make.bash
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
|
@ -55,7 +62,19 @@ do_install() {
|
||||||
|
|
||||||
cp -r doc misc -t ${DESTDIR}/usr/share/go
|
cp -r doc misc -t ${DESTDIR}/usr/share/go
|
||||||
ln -s /usr/share/go/doc ${DESTDIR}/usr/lib/go/doc
|
ln -s /usr/share/go/doc ${DESTDIR}/usr/lib/go/doc
|
||||||
cp -a bin ${DESTDIR}/usr
|
|
||||||
|
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
|
||||||
cp -a pkg ${DESTDIR}/usr/lib/go
|
cp -a pkg ${DESTDIR}/usr/lib/go
|
||||||
cp -a src/pkg ${DESTDIR}/usr/lib/go/src/
|
cp -a src/pkg ${DESTDIR}/usr/lib/go/src/
|
||||||
cp -a src/cmd ${DESTDIR}/usr/lib/go/src/cmd
|
cp -a src/cmd ${DESTDIR}/usr/lib/go/src/cmd
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue