From 840bfc5fd01bf036344bd687d2e40e0fc19f39e4 Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Thu, 15 Jun 2017 00:47:52 +0200 Subject: [PATCH] Fix syncthing-inotify build error Signed-off-by: Sebastien Douheret --- scripts/get-syncthing.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/get-syncthing.sh b/scripts/get-syncthing.sh index 368c941..4770d31 100755 --- a/scripts/get-syncthing.sh +++ b/scripts/get-syncthing.sh @@ -44,7 +44,7 @@ tarball="syncthing-${GOOS_ST}-${GOARCH}-v${SYNCTHING_VERSION}.${TB_EXT}" \ && curl -sfSL "https://github.com/syncthing/syncthing/releases/download/v${SYNCTHING_VERSION}/sha1sum.txt.asc" -O \ && gpg -q --verify sha1sum.txt.asc \ && grep -E " ${tarball}\$" sha1sum.txt.asc | sha1sum -c - \ - && rm sha1sum.txt.asc + && rm -rf sha1sum.txt.asc syncthing-${GOOS_ST}-${GOARCH}-v${SYNCTHING_VERSION} if [ "${TB_EXT}" = "tar.gz" ]; then tar -xvf "$tarball" --strip-components=1 "$(basename "$tarball" .tar.gz)"/syncthing \ && mv syncthing ${DESTDIR}/syncthing || exit 1 @@ -65,11 +65,21 @@ if [ "$SYNCTHING_INOTIFY_VERSION" = "master" ]; then git status export GOPATH=$(cd ../../../.. && pwd) version=$(git describe --tags --always | sed 's/^v//')__patch_165 - go build -v -i -ldflags "-w -X main.Version=$version" -o ${DESTDIR}/syncthing-inotify${EXT} || exit 1 + + # Workaround about "cannot find package "golang.org/x/sys/unix" + go get -u golang.org/x/sys/unix + + # Workaround about "undefined: stream" error when cross-building MacOS + # https://github.com/rjeczalik/notify/issues/108 + OPTS="" + [[ "$GOOS_STI" = "darwin" ]] && OPTS="-tags kqueue" + + go build ${OPTS} -v -i -ldflags "-w -X main.Version=$version" -o ${DESTDIR}/syncthing-inotify${EXT} || exit 1 else tarball="syncthing-inotify-${GOOS_STI}-${GOARCH}-v${SYNCTHING_INOTIFY_VERSION}.${TB_EXT}" curl -sfSL "https://github.com/syncthing/syncthing-inotify/releases/download/v${SYNCTHING_INOTIFY_VERSION}/${tarball}" -O || exit 1 + rm -rf syncthing-inotify-${GOOS_STI}-${GOARCH}-v${SYNCTHING_INOTIFY_VERSION} if [ "${TB_EXT}" = "tar.gz" ]; then tar -xvf "${tarball}" syncthing-inotify && mv syncthing-inotify ${DESTDIR}/syncthing-inotify || exit 1 else -- 2.16.6