Move golang cache logic out of build.sh
This commit is contained in:
parent
b109e79c2c
commit
40aef7e5ea
@ -10,14 +10,5 @@ TERMUX_PKG_BUILD_IN_SRC=true
|
||||
|
||||
termux_step_pre_configure() {
|
||||
termux_setup_golang
|
||||
if $TERMUX_ON_DEVICE_BUILD; then
|
||||
export GOPATH=$TERMUX_PKG_SRCDIR/go
|
||||
if [ -d $TERMUX_PKG_CACHEDIR/go ]; then
|
||||
cp $TERMUX_PKG_CACHEDIR/go $GOPATH -r
|
||||
go get
|
||||
else
|
||||
go get
|
||||
cp $TERMUX_PKG_SRCDIR/go $TERMUX_PKG_CACHEDIR/go -r
|
||||
fi
|
||||
fi
|
||||
termux_go_get
|
||||
}
|
||||
|
@ -40,3 +40,23 @@ termux_setup_golang() {
|
||||
export GOROOT="$TERMUX_PREFIX/lib/go"
|
||||
fi
|
||||
}
|
||||
|
||||
termux_go_get() {
|
||||
if $TERMUX_ON_DEVICE_BUILD; then
|
||||
if $TERMUX_PKG_BUILD_IN_SRC; then
|
||||
export GOPATH=$TERMUX_PKG_SRCDIR/go
|
||||
else
|
||||
export GOPATH=$TERMUX_PKG_BUILDDIR/go
|
||||
fi
|
||||
if [ -d $TERMUX_PKG_CACHEDIR/go ]; then
|
||||
cp $TERMUX_PKG_CACHEDIR/go $GOPATH -r
|
||||
go get "$@"
|
||||
else
|
||||
go get "$@"
|
||||
cp $GOPATH $TERMUX_PKG_CACHEDIR/go -r
|
||||
fi
|
||||
go get "$@"
|
||||
else
|
||||
go get "$@"
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user