2017-04-11 21:35:34 +02:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://syncthing.net/
|
2017-04-11 22:22:54 +02:00
|
|
|
TERMUX_PKG_DESCRIPTION="Decentralized file synchronization"
|
2019-01-21 13:53:58 +01:00
|
|
|
TERMUX_PKG_LICENSE="MPL-2.0"
|
2020-12-20 14:16:34 +01:00
|
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
2020-12-08 00:26:05 +01:00
|
|
|
# NOTE: as of 1.12.0 compilation fails when package zstd is
|
|
|
|
# present in TERMUX_PREFIX.
|
2022-04-06 09:07:15 +02:00
|
|
|
TERMUX_PKG_VERSION=1.19.2
|
2022-04-10 08:49:48 +02:00
|
|
|
TERMUX_PKG_REVISION=1
|
2017-05-17 22:58:45 +02:00
|
|
|
TERMUX_PKG_SRCURL=https://github.com/syncthing/syncthing/releases/download/v${TERMUX_PKG_VERSION}/syncthing-source-v${TERMUX_PKG_VERSION}.tar.gz
|
2022-04-06 09:07:15 +02:00
|
|
|
TERMUX_PKG_SHA256=dcf93ef2fea1150b5b2e27d1c5e8e4853bd440b766a8355309af1607be08ce80
|
2021-10-04 12:43:31 +02:00
|
|
|
TERMUX_PKG_AUTO_UPDATE=true
|
2017-04-11 21:35:34 +02:00
|
|
|
|
2022-04-06 09:07:15 +02:00
|
|
|
termux_step_make() {
|
2017-04-11 22:22:54 +02:00
|
|
|
termux_setup_golang
|
2017-04-11 21:35:34 +02:00
|
|
|
|
2017-04-11 22:22:54 +02:00
|
|
|
# The build.sh script doesn't with our compiler
|
|
|
|
# so small adjustments to file locations are needed
|
|
|
|
# so the build.go is fine.
|
2022-04-06 09:07:15 +02:00
|
|
|
mkdir -p go/src/github.com/syncthing
|
|
|
|
ln -sf "${TERMUX_PKG_SRCDIR}" go/src/github.com/syncthing/syncthing
|
2017-04-11 21:35:34 +02:00
|
|
|
|
2017-04-11 22:22:54 +02:00
|
|
|
# Set gopath so dependencies are built as in go get etc.
|
2022-04-06 09:07:15 +02:00
|
|
|
export GOPATH="$(pwd)/go"
|
2017-04-11 22:22:54 +02:00
|
|
|
|
2017-04-11 21:35:34 +02:00
|
|
|
cd go/src/github.com/syncthing/syncthing
|
2017-04-11 22:22:54 +02:00
|
|
|
|
2020-09-09 20:11:21 +02:00
|
|
|
# Unset GOARCH so building build.go works.
|
2022-04-06 09:07:15 +02:00
|
|
|
export GO_ARCH="${GOARCH}"
|
|
|
|
export _CC="${CC}"
|
|
|
|
export GO_OS="${GOOS}"
|
2018-02-24 01:14:15 +01:00
|
|
|
unset GOOS GOARCH CC
|
2021-07-10 16:00:18 +02:00
|
|
|
|
2022-04-06 09:07:15 +02:00
|
|
|
rm -rf vendor # syncthing has vendored dependencies, which fails with our compiler.
|
2017-04-11 22:22:54 +02:00
|
|
|
# Now file structure is same as go get etc.
|
2022-04-06 09:07:15 +02:00
|
|
|
go run build.go -goos "${GO_OS}" -goarch "${GO_ARCH}" \
|
2022-04-10 08:49:48 +02:00
|
|
|
-cc "${_CC}" -version "v${TERMUX_PKG_VERSION}" -no-upgrade build
|
2017-04-11 21:35:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_make_install() {
|
2022-04-06 09:07:15 +02:00
|
|
|
cp "${GOPATH}"/src/github.com/syncthing/syncthing/syncthing $TERMUX_PREFIX/bin/
|
2017-04-11 22:26:35 +02:00
|
|
|
|
|
|
|
for section in 1 5 7; do
|
2021-10-13 12:45:14 +02:00
|
|
|
local MANDIR=$TERMUX_PREFIX/share/man/man$section
|
2017-04-11 22:26:35 +02:00
|
|
|
mkdir -p $MANDIR
|
|
|
|
cp $TERMUX_PKG_SRCDIR/man/*.$section $MANDIR
|
|
|
|
done
|
2017-04-11 21:35:34 +02:00
|
|
|
}
|