From 5dd49dbcae79d36ebf71d5b746e71d419ad818fc Mon Sep 17 00:00:00 2001 From: Aditya Alok Date: Wed, 6 Apr 2022 12:37:15 +0530 Subject: [PATCH] feat(syncthing): fix build, update to 1.19.2 - removing vendor dir should not cause any problem unless, any dependencies of syncthing have been removed from there hosting site. (Highly unlikely) Signed-off-by: Aditya Alok --- packages/syncthing/build.sh | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/packages/syncthing/build.sh b/packages/syncthing/build.sh index be05ad8e5..37638d99f 100644 --- a/packages/syncthing/build.sh +++ b/packages/syncthing/build.sh @@ -4,43 +4,39 @@ TERMUX_PKG_LICENSE="MPL-2.0" TERMUX_PKG_MAINTAINER="@termux" # NOTE: as of 1.12.0 compilation fails when package zstd is # present in TERMUX_PREFIX. -TERMUX_PKG_VERSION=1.19.1 +TERMUX_PKG_VERSION=1.19.2 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=ffc5ec2f232314122a216884f63a48eea7c8739f9779e249be1f4776d7a55127 +TERMUX_PKG_SHA256=dcf93ef2fea1150b5b2e27d1c5e8e4853bd440b766a8355309af1607be08ce80 TERMUX_PKG_AUTO_UPDATE=true -termux_step_make(){ +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 + mkdir -p go/src/github.com/syncthing + ln -sf "${TERMUX_PKG_SRCDIR}" go/src/github.com/syncthing/syncthing # Set gopath so dependencies are built as in go get etc. - export GOPATH=$(pwd)/go + export GOPATH="$(pwd)/go" cd go/src/github.com/syncthing/syncthing # Unset GOARCH so building build.go works. - export GO_ARCH=$GOARCH - export _CC=$CC + export GO_ARCH="${GOARCH}" + export _CC="${CC}" + export GO_OS="${GOOS}" unset GOOS GOARCH CC + rm -rf vendor # syncthing has vendored dependencies, which fails with our compiler. # 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 + go run build.go -goos "${GO_OS}" -goarch "${GO_ARCH}" \ + -cc "${_CC}" -version "${TERMUX_PKG_VERSION}" -no-upgrade build } termux_step_make_install() { - cp go/src/github.com/syncthing/syncthing/syncthing $TERMUX_PREFIX/bin/ + cp "${GOPATH}"/src/github.com/syncthing/syncthing/syncthing $TERMUX_PREFIX/bin/ for section in 1 5 7; do local MANDIR=$TERMUX_PREFIX/share/man/man$section