termux-packages/packages/syncthing/build.sh
Leonid Pliushch 3fedf3ba45 syncthing: bump revision & do custom build with older Go version
Fixes this error:

 panic: qtls.ClientSessionState not compatible with tls.ClientSessionState

 goroutine 1 [running]:
 github.com/lucas-clemente/quic-go/internal/handshake.init.2()
         /home/builder/termux-packages/.termux-builder/syncthing/build/go/pkg/mod/github.com/lucas-clemente/quic-go@v0.17.3/internal/handshake/unsafe.go:26 +0x1c4

Package is uploaded manually.
%ci:no-build
2020-08-15 16:33:10 +03:00

48 lines
1.4 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://syncthing.net/
TERMUX_PKG_DESCRIPTION="Decentralized file synchronization"
TERMUX_PKG_LICENSE="MPL-2.0"
TERMUX_PKG_VERSION=1.8.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/syncthing/syncthing/releases/download/v${TERMUX_PKG_VERSION}/syncthing-source-v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=04d78fbe6015334c284bf46ffcf8feb6b2b690ef810f2f0c5732cdee5cd8142a
termux_step_make(){
termux_setup_golang
# The build.sh script doesn't with our compiler
# so small adjustments to file locations are needed
# so the build.go is fine.
mkdir -p go/src/github.com/syncthing/syncthing
cp $TERMUX_PKG_SRCDIR/vendor/* ./go/src/ -r
cp $TERMUX_PKG_SRCDIR/* go/src/github.com/syncthing/syncthing -r
# Set gopath so dependencies are built as in go get etc.
export GOPATH=$(pwd)/go
cd go/src/github.com/syncthing/syncthing
# Unset GOARCH so building build.go is works.
export GO_ARCH=$GOARCH
export _CC=$CC
unset GOOS GOARCH CC
# Now file structure is same as go get etc.
go build build.go
export CC=$_CC
./build -goos android \
-goarch $GO_ARCH \
-no-upgrade \
-version v$TERMUX_PKG_VERSION \
build
}
termux_step_make_install() {
cp go/src/github.com/syncthing/syncthing/syncthing $TERMUX_PREFIX/bin/
for section in 1 5 7; do
local MANDIR=$PREFIX/share/man/man$section
mkdir -p $MANDIR
cp $TERMUX_PKG_SRCDIR/man/*.$section $MANDIR
done
}