From: Sebastien Douheret Date: Wed, 14 Jun 2017 22:47:52 +0000 (+0200) Subject: Fix syncthing-inotify build error X-Git-Tag: 0.1.0~25 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=840bfc5fd01bf036344bd687d2e40e0fc19f39e4;p=src%2Fxds%2Fxds-agent.git Fix syncthing-inotify build error Signed-off-by: Sebastien Douheret --- 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