+if [ "$SYNCTHING_INOTIFY_VERSION" = "master_and_patch165" ]; then
+ mkdir -p ${TEMPDIR}/syncthing-inotify-build/src/github.com/syncthing || exit 1
+ cd ${TEMPDIR}/syncthing-inotify-build/src/github.com/syncthing
+ git clone https://github.com/syncthing/syncthing || exit 1
+ git clone https://github.com/syncthing/syncthing-inotify || exit 1
+ cd syncthing-inotify
+ cat <<EOF > 165.patch
+ diff --git a/syncwatcher.go b/syncwatcher.go
+index c36b034..5175c12 100644
+--- a/syncwatcher.go
++++ b/syncwatcher.go
+@@ -677,7 +677,10 @@ func accumulateChanges(debounceTimeout time.Duration,
+ if flushTimerNeedsReset {
+ flushTimerNeedsReset = false
+ if !flushTimer.Stop() {
+- <-flushTimer.C
++ select {
++ case <-flushTimer.C:
++ default:
++ }
+ }
+ flushTimer.Reset(currInterval)
+ }
+EOF
+ git apply 165.patch || exit 1
+ export GOPATH=$(realpath `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 || exit 1
+else
+