Syncthing (#918)
[termux-packages] / packages / syncthing / build.sh
1 TERMUX_PKG_HOMEPAGE=https://syncthing.net/
2 TERMUX_PKG_DESCRIPTION="decentralized file synchronization"
3 TERMUX_PKG_VERSION=0.14.27-rc.2
4 TERMUX_PKG_SRCURL=https://github.com/syncthing/syncthing/archive/v0.14.27-rc.2.tar.gz
5 TERMUX_PKG_SHA256=2243d3ddec966fef7f6563e3028c17f55916479a4e8fe5b30cd0960825f9f3b0
6 TERMUX_PKG_FOLDERNAME=syncthing-${TERMUX_PKG_VERSION}
7 termux_step_make(){
8 termux_setup_golang
9
10 # the build.sh script doesn't with our compiler
11 # so small adjustments to file locations needed
12 # so the build.go is fine.
13
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
18 # set gopath so dependencies are built as in go get etc
19 export GOPATH=$(pwd)/go
20 cd go/src/github.com/syncthing/syncthing
21 # unset GOARCH so building build.go is works
22 export GO_ARCH=$GOARCH
23 unset GOOS
24 unset GOARCH
25 # now fike structure is same as go get etc..
26 # we can build it
27 go build build.go
28 ./build -goos android -goarch $GO_ARCH -no-upgrade build
29 }
30 # im sure there are better ways of doing it. I don't use go though.
31
32 termux_step_make_install() {
33 cp go/src/github.com/syncthing/syncthing/syncthing $TERMUX_PREFIX/bin/
34 }