chiark / gitweb /
debianutils: Update from 4.8.3 to 4.8.4
[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.45
4 TERMUX_PKG_SHA256=3236a12b3698f6eaef785348a26fea59f87398b2753c414d18844e5f7d7a655b
5 TERMUX_PKG_SRCURL=https://github.com/syncthing/syncthing/releases/download/v${TERMUX_PKG_VERSION}/syncthing-source-v${TERMUX_PKG_VERSION}.tar.gz
6
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 are needed
12         # so the build.go is fine.
13         mkdir -p go/src/github.com/syncthing/syncthing
14         cp $TERMUX_PKG_SRCDIR/vendor/* ./go/src/ -r
15         cp $TERMUX_PKG_SRCDIR/*  go/src/github.com/syncthing/syncthing -r
16
17         # Set gopath so dependencies are built as in go get etc.
18         export GOPATH=$(pwd)/go
19
20         cd go/src/github.com/syncthing/syncthing
21
22         # Unset GOARCH so building build.go is works.
23         export GO_ARCH=$GOARCH
24         export _CC=$CC
25         unset GOOS GOARCH CC
26         
27         # Now file structure is same as go get etc.
28         go build build.go
29         export CC=$_CC
30         ./build -goos android \
31                 -goarch $GO_ARCH \
32                 -no-upgrade \
33                 -version v$TERMUX_PKG_VERSION \
34                 build
35 }
36
37 termux_step_make_install() {
38         cp go/src/github.com/syncthing/syncthing/syncthing $TERMUX_PREFIX/bin/
39
40         for section in 1 5 7; do
41                 local MANDIR=$PREFIX/share/man/man$section
42                 mkdir -p $MANDIR
43                 cp $TERMUX_PKG_SRCDIR/man/*.$section $MANDIR
44         done
45 }