Update go handling
- Use 1.6beta1 for host build - Download host build tool when needed - Re-build asciinema with 1.6beta1 to avoid relocation warnings
This commit is contained in:
parent
b6cc859c74
commit
3a189d898c
@ -542,6 +542,23 @@ termux_step_create_debscripts () {
|
||||
return
|
||||
}
|
||||
|
||||
termux_setup_golang () {
|
||||
local TERMUX_GO_VERSION=go1.6beta1
|
||||
local TERMUX_GO_PLATFORM=linux-amd64
|
||||
test `uname` = "Darwin" && TERMUX_GO_PLATFORM=darwin-amd64
|
||||
|
||||
export TERMUX_BUILDGO_FOLDER=$TERMUX_COMMON_CACHEDIR/${TERMUX_GO_VERSION}.${TERMUX_GO_PLATFORM}
|
||||
export GOROOT=$TERMUX_BUILDGO_FOLDER
|
||||
export PATH=$GOROOT/bin:$PATH
|
||||
|
||||
if [ -d $TERMUX_BUILDGO_FOLDER ]; then return; fi
|
||||
|
||||
local TERMUX_BUILDGO_TAR=$TERMUX_COMMON_CACHEDIR/${TERMUX_GO_VERSION}.${TERMUX_GO_PLATFORM}.tar.gz
|
||||
rm -Rf $TERMUX_COMMON_CACHEDIR/go $TERMUX_BUILDGO_FOLDER
|
||||
curl -o $TERMUX_BUILDGO_TAR https://storage.googleapis.com/golang/${TERMUX_GO_VERSION}.${TERMUX_GO_PLATFORM}.tar.gz
|
||||
( cd $TERMUX_COMMON_CACHEDIR; tar xf $TERMUX_BUILDGO_TAR; mv go $TERMUX_BUILDGO_FOLDER; rm $TERMUX_BUILDGO_TAR )
|
||||
}
|
||||
|
||||
source $TERMUX_PKG_BUILDER_SCRIPT
|
||||
|
||||
# Compute full version:
|
||||
|
@ -1,9 +1,7 @@
|
||||
# Go programs does not build on android-386
|
||||
# - will hopefully get fixed in go 1.6!
|
||||
# https://github.com/golang/go/issues/9327
|
||||
TERMUX_PKG_HOMEPAGE=https://asciinema.org/
|
||||
TERMUX_PKG_DESCRIPTION="Record and share your terminal sessions, the right way"
|
||||
TERMUX_PKG_VERSION=1.1.1
|
||||
TERMUX_PKG_BUILD_REVISION=1
|
||||
TERMUX_PKG_SRCURL=https://github.com/asciinema/asciinema/archive/v${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_FOLDERNAME=asciinema-${TERMUX_PKG_VERSION}
|
||||
TERMUX_PKG_BUILD_IN_SRC=yes
|
||||
@ -35,8 +33,7 @@ termux_step_make () {
|
||||
|
||||
termux_step_make_install () {
|
||||
cd $GOPATH/src/github.com/asciinema/asciinema
|
||||
export GOROOT=$HOME/lib/go/
|
||||
export PATH=$GOROOT/bin:$PATH
|
||||
termux_setup_golang
|
||||
PREFIX=$TERMUX_PREFIX make build
|
||||
PREFIX=$TERMUX_PREFIX make install
|
||||
}
|
||||
|
@ -1,35 +1,19 @@
|
||||
TERMUX_PKG_HOMEPAGE=https://golang.org/
|
||||
TERMUX_PKG_DESCRIPTION="Go programming language compiler"
|
||||
_MAJOR_VERSION=1.5.2
|
||||
_MAJOR_VERSION=1.6beta1
|
||||
# Need to be considered a higher version than "1.5rc1":
|
||||
TERMUX_PKG_VERSION=1:$_MAJOR_VERSION
|
||||
TERMUX_PKG_SRCURL=https://storage.googleapis.com/golang/go${_MAJOR_VERSION}.src.tar.gz
|
||||
TERMUX_PKG_FOLDERNAME=go
|
||||
TERMUX_PKG_KEEP_STATIC_LIBRARIES=true
|
||||
|
||||
TERMUX_HOST_GOLANG_DIR=$TERMUX_PKG_CACHEDIR/go-host-$_MAJOR_VERSION
|
||||
|
||||
termux_step_post_extract_package () {
|
||||
if [ ! -d $TERMUX_HOST_GOLANG_DIR ]; then
|
||||
cd $TERMUX_PKG_CACHEDIR
|
||||
GOHOST_TARFILE=go-host-${_MAJOR_VERSION}.tar.gz
|
||||
if [ ! -f $GOHOST_TARFILE ]; then
|
||||
curl -o $GOHOST_TARFILE https://storage.googleapis.com/golang/go${_MAJOR_VERSION}.linux-amd64.tar.gz
|
||||
fi
|
||||
tar xf $GOHOST_TARFILE
|
||||
mv go $TERMUX_HOST_GOLANG_DIR
|
||||
fi
|
||||
}
|
||||
|
||||
termux_step_make_install () {
|
||||
export GOOS=android
|
||||
export CGO_ENABLED=1
|
||||
if [ "$TERMUX_ARCH" = "arm" ]; then
|
||||
export GOOS=android
|
||||
export CGO_ENABLED=1
|
||||
export GOARCH=arm
|
||||
export GOARM=7
|
||||
elif [ "$TERMUX_ARCH" = "i686" ]; then
|
||||
export GOOS=linux
|
||||
export CGO_ENABLED=0
|
||||
export GOARCH=386
|
||||
export GO386=sse2
|
||||
else
|
||||
@ -41,14 +25,16 @@ termux_step_make_install () {
|
||||
|
||||
TERMUX_GODIR=$TERMUX_PREFIX/lib/go
|
||||
rm -Rf $TERMUX_GODIR
|
||||
mkdir -p $TERMUX_GODIR/{src,pkg/tool/$TERMUX_GOLANG_DIRNAME,pkg/include,pkg/$TERMUX_GOLANG_DIRNAME}
|
||||
mkdir -p $TERMUX_GODIR/{src,pkg/tool/$TERMUX_GOLANG_DIRNAME,pkg/include,pkg/${TERMUX_GOLANG_DIRNAME}_shared}
|
||||
|
||||
termux_setup_golang
|
||||
|
||||
cd $TERMUX_PKG_SRCDIR/src
|
||||
env CC_FOR_TARGET=$CC \
|
||||
CXX_FOR_TARGET=$CXX \
|
||||
CC=gcc \
|
||||
GO_LDFLAGS="-extldflags=-pie" \
|
||||
GOROOT_BOOTSTRAP=$TERMUX_HOST_GOLANG_DIR \
|
||||
GOROOT_BOOTSTRAP=$GOROOT \
|
||||
GOROOT_FINAL=$TERMUX_GODIR \
|
||||
./make.bash
|
||||
|
||||
@ -58,7 +44,7 @@ termux_step_make_install () {
|
||||
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 pkg/$TERMUX_GOLANG_DIRNAME/* $TERMUX_GODIR/pkg/$TERMUX_GOLANG_DIRNAME/
|
||||
cp -Rf pkg/${TERMUX_GOLANG_DIRNAME}_shared/* $TERMUX_GODIR/pkg/${TERMUX_GOLANG_DIRNAME}_shared/
|
||||
}
|
||||
|
||||
termux_step_post_massage () {
|
||||
|
Loading…
Reference in New Issue
Block a user