termux-packages/packages/golang/build.sh

42 lines
1.4 KiB
Bash
Raw Normal View History

2015-08-14 22:29:47 +02:00
TERMUX_PKG_HOMEPAGE=https://golang.org/
TERMUX_PKG_DESCRIPTION="Go programming language compiler"
2017-04-10 00:19:20 +02:00
_MAJOR_VERSION=1.8.1
2016-02-18 04:41:22 +01:00
# Use the ~ deb versioning construct in the future:
TERMUX_PKG_VERSION=2:${_MAJOR_VERSION}
TERMUX_PKG_SRCURL=https://storage.googleapis.com/golang/go${_MAJOR_VERSION}.src.tar.gz
2017-04-10 00:19:20 +02:00
TERMUX_PKG_SHA256=33daf4c03f86120fdfdc66bddf6bfff4661c7ca11c5da473e537f4d69b470e57
2015-08-14 22:29:47 +02:00
TERMUX_PKG_FOLDERNAME=go
TERMUX_PKG_KEEP_STATIC_LIBRARIES=true
TERMUX_PKG_DEPENDS="clang"
2015-08-14 22:29:47 +02:00
termux_step_make_install () {
2016-01-11 01:45:41 +01:00
termux_setup_golang
2015-08-14 22:29:47 +02:00
2015-08-17 22:58:29 +02:00
TERMUX_GOLANG_DIRNAME=${GOOS}_$GOARCH
2015-08-14 22:29:47 +02:00
TERMUX_GODIR=$TERMUX_PREFIX/lib/go
rm -Rf $TERMUX_GODIR
2017-02-17 20:09:31 +01:00
mkdir -p $TERMUX_GODIR/{src,lib,pkg/tool/$TERMUX_GOLANG_DIRNAME,pkg/include,pkg/${TERMUX_GOLANG_DIRNAME}}
2015-08-14 22:29:47 +02:00
cd $TERMUX_PKG_SRCDIR/src
2015-08-17 22:58:29 +02:00
env CC_FOR_TARGET=$CC \
CXX_FOR_TARGET=$CXX \
2017-01-16 11:13:38 +01:00
CC=clang \
2015-08-17 22:58:29 +02:00
GO_LDFLAGS="-extldflags=-pie" \
GOROOT_BOOTSTRAP=$GOROOT \
2016-09-09 15:36:53 +02:00
GOROOT_FINAL=$TERMUX_GODIR \
2015-08-17 22:58:29 +02:00
./make.bash
2015-08-14 22:29:47 +02:00
cd ..
cp bin/$TERMUX_GOLANG_DIRNAME/{go,gofmt} $TERMUX_PREFIX/bin
cp VERSION $TERMUX_GODIR/
cp pkg/tool/$TERMUX_GOLANG_DIRNAME/* $TERMUX_GODIR/pkg/tool/$TERMUX_GOLANG_DIRNAME/
cp -Rf src/* $TERMUX_GODIR/src/
cp pkg/include/* $TERMUX_GODIR/pkg/include/
cp -Rf lib/* $TERMUX_GODIR/lib
2017-02-17 20:09:31 +01:00
cp -Rf pkg/${TERMUX_GOLANG_DIRNAME}/* $TERMUX_GODIR/pkg/${TERMUX_GOLANG_DIRNAME}/
2015-08-14 22:29:47 +02:00
}
2015-08-19 13:50:30 +02:00
termux_step_post_massage () {
find . -path '*/testdata*' -delete
}