syncthing: fix crash on Android 8 (#2391)
[termux-packages] / packages / syncthing / build.sh
CommitLineData
fb887a78 1TERMUX_PKG_HOMEPAGE=https://syncthing.net/
b2f02e74 2TERMUX_PKG_DESCRIPTION="Decentralized file synchronization"
f9423d0a 3TERMUX_PKG_VERSION=0.14.45
3067d29d 4TERMUX_PKG_REVISION=1
f9423d0a 5TERMUX_PKG_SHA256=3236a12b3698f6eaef785348a26fea59f87398b2753c414d18844e5f7d7a655b
d6c26998 6TERMUX_PKG_SRCURL=https://github.com/syncthing/syncthing/releases/download/v${TERMUX_PKG_VERSION}/syncthing-source-v${TERMUX_PKG_VERSION}.tar.gz
fb887a78 7
b2f02e74
FF
8termux_step_make(){
9 termux_setup_golang
fb887a78 10
b2f02e74
FF
11 # The build.sh script doesn't with our compiler
12 # so small adjustments to file locations are needed
13 # so the build.go is fine.
fb887a78 14 mkdir -p go/src/github.com/syncthing/syncthing
15 cp $TERMUX_PKG_SRCDIR/vendor/* ./go/src/ -r
16 cp $TERMUX_PKG_SRCDIR/* go/src/github.com/syncthing/syncthing -r
17
b2f02e74 18 # Set gopath so dependencies are built as in go get etc.
fb887a78 19 export GOPATH=$(pwd)/go
b2f02e74 20
fb887a78 21 cd go/src/github.com/syncthing/syncthing
b2f02e74
FF
22
23 # Unset GOARCH so building build.go is works.
fb887a78 24 export GO_ARCH=$GOARCH
7fab8e0d 25 export _CC=$CC
26 unset GOOS GOARCH CC
27
b2f02e74 28 # Now file structure is same as go get etc.
fb887a78 29 go build build.go
7fab8e0d 30 export CC=$_CC
b2f02e74
FF
31 ./build -goos android \
32 -goarch $GO_ARCH \
33 -no-upgrade \
34 -version v$TERMUX_PKG_VERSION \
35 build
fb887a78 36}
fb887a78 37
38termux_step_make_install() {
b2f02e74 39 cp go/src/github.com/syncthing/syncthing/syncthing $TERMUX_PREFIX/bin/
e5a9fdd8
FF
40
41 for section in 1 5 7; do
42 local MANDIR=$PREFIX/share/man/man$section
43 mkdir -p $MANDIR
44 cp $TERMUX_PKG_SRCDIR/man/*.$section $MANDIR
45 done
fb887a78 46}