From f916f96761badc543beada695c9f94134f3340eb Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 29 Mar 2020 01:31:39 -0600 Subject: tunnel: libwg-go: prevent parallel downloads Signed-off-by: Jason A. Donenfeld --- tunnel/tools/libwg-go/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tunnel') diff --git a/tunnel/tools/libwg-go/Makefile b/tunnel/tools/libwg-go/Makefile index 99ce0380..6c2d25b5 100644 --- a/tunnel/tools/libwg-go/Makefile +++ b/tunnel/tools/libwg-go/Makefile @@ -26,9 +26,11 @@ default: $(DESTDIR)/libwg-go.so $(BUILDDIR)/go-$(DESIRED_GO_VERSION)/.prepared: mkdir -p "$(dir $@)" - curl "https://dl.google.com/go/go$(DESIRED_GO_VERSION).$(shell uname -s | tr '[:upper:]' '[:lower:]')-$(NDK_GO_ARCH_MAP_$(shell uname -m)).tar.gz" | tar -C "$(dir $@)" --strip-components=1 -xzf - - patch -p1 -f -N -r- -d "$(dir $@)" < goruntime-boottime-over-monotonic.diff - touch "$@" + flock -x "$@.lock" -c ' \ + [ -f "$@" ] && exit 0; \ + curl "https://dl.google.com/go/go$(DESIRED_GO_VERSION).$(shell uname -s | tr '[:upper:]' '[:lower:]')-$(NDK_GO_ARCH_MAP_$(shell uname -m)).tar.gz" | tar -C "$(dir $@)" --strip-components=1 -xzf - && \ + patch -p1 -f -N -r- -d "$(dir $@)" < goruntime-boottime-over-monotonic.diff && \ + touch "$@"' $(DESTDIR)/libwg-go.so: export PATH := $(BUILDDIR)/go-$(DESIRED_GO_VERSION)/bin/:$(PATH) $(DESTDIR)/libwg-go.so: $(BUILDDIR)/go-$(DESIRED_GO_VERSION)/.prepared go.mod -- cgit v1.2.3-59-g8ed1b