From fa37ead9e850fd5923047247eec8d87dbae447ab Mon Sep 17 00:00:00 2001
From: "Kali Kaneko (leap communications)" <kali@leap.se>
Date: Wed, 7 Aug 2019 20:32:37 +0200
Subject: [PATCH] [pkg] do not make user mess with symlinks in gopath

---
 Makefile | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 62eabffd..49d87f76 100644
--- a/Makefile
+++ b/Makefile
@@ -12,13 +12,18 @@ PROVIDER_CONFIG ?= branding/config/vendor.conf
 DEFAULT_PROVIDER = branding/assets/default/
 VERSION ?= $(shell git describe)
 
+# go paths
+GOPATH = $(shell go env GOPATH)
+SYSTRAY = "0xacab.org/leap/bitmask-vpn"
+GOSYSTRAY = ${GOPATH}/src/${SYSTRAY}
+
 # detect OS, we use it for dependencies
 UNAME = `uname`
 
 TEMPLATES = "branding/templates"
 SCRIPTS = "branding/scripts"
 
-all: icon locales get build
+all: icon locales build
 
 #########################################################################
 # go build
@@ -41,10 +46,14 @@ dependsCygwin:
 	choco install -y golang python nssm nsis wget 7zip
 
 get:
-	@go get -tags $(TAGS) ./...
-	@go get -tags "$(TAGS) bitmaskd" ./...
+	-@mkdir -p ${GOPATH}/src/0xacab.org/leap
+	-@ln -s `pwd` ${GOSYSTRAY}
+	@cd ${GOSYSTRAY} && go get -tags $(TAGS) ./...
+	@cd ${GOSYSTRAY} && go get -tags "$(TAGS) bitmaskd" ./...
+
+# when we can depend on go 1.11 we don't need the get step anymore
 
-build: $(foreach path,$(wildcard cmd/*),build_$(patsubst cmd/%,%,$(path)))
+build: get $(foreach path,$(wildcard cmd/*),build_$(patsubst cmd/%,%,$(path)))
 
 build_%:
 	go build -tags $(TAGS) -ldflags "-s -w -X main.version=`git describe --tags`" -o $* ./cmd/$*
-- 
GitLab