summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Barker <pbarker@toganlabs.com>2017-10-13 19:27:12 +0000
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-10-16 11:54:24 -0400
commit123cb0a0088247c7d8c8d0451533c40b37ef3201 (patch)
treeb78477f563881408e686d7811aa9b7456a3293bf
parentc1cd2d4c69f61e1e3bd9eb8d1a85e82df454588f (diff)
downloadmeta-virtualization-123cb0a0088247c7d8c8d0451533c40b37ef3201.tar.gz
netns: Use correct go cross-compiler
The makefile for netns needs to be patched to ensure that we use the binaries from go-cross and not go-native. Signed-off-by: Paul Barker <pbarker@toganlabs.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-networking/netns/files/0001-Use-correct-go-cross-compiler.patch77
-rw-r--r--recipes-networking/netns/netns_git.bb4
2 files changed, 80 insertions, 1 deletions
diff --git a/recipes-networking/netns/files/0001-Use-correct-go-cross-compiler.patch b/recipes-networking/netns/files/0001-Use-correct-go-cross-compiler.patch
new file mode 100644
index 00000000..ed66e11b
--- /dev/null
+++ b/recipes-networking/netns/files/0001-Use-correct-go-cross-compiler.patch
@@ -0,0 +1,77 @@
1From d5c319bb61155d94bef2571a095d82983d786b94 Mon Sep 17 00:00:00 2001
2From: Paul Barker <pbarker@toganlabs.com>
3Date: Fri, 13 Oct 2017 17:58:11 +0000
4Subject: [PATCH] Use correct go cross-compiler
5
6Signed-off-by: Paul Barker <pbarker@toganlabs.com>
7Upstream-status: Pending
8---
9 Makefile | 16 ++++++++--------
10 1 file changed, 8 insertions(+), 8 deletions(-)
11
12diff --git a/Makefile b/Makefile
13index cb9a46d..633f884 100644
14--- a/src/import/Makefile
15+++ b/src/import/Makefile
16@@ -33,12 +33,12 @@ build: $(NAME) ## Builds a dynamic executable or package
17
18 $(NAME): *.go VERSION
19 @echo "+ $@"
20- go build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
21+ $(GO) build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .
22
23 .PHONY: static
24 static: ## Builds a static executable
25 @echo "+ $@"
26- CGO_ENABLED=0 go build \
27+ CGO_ENABLED=0 $(GO) build \
28 -tags "$(BUILDTAGS) static_build" \
29 ${GO_LDFLAGS_STATIC} -o $(NAME) .
30
31@@ -55,21 +55,21 @@ lint: ## Verifies `golint` passes
32 .PHONY: test
33 test: ## Runs the go tests
34 @echo "+ $@"
35- @go test -v -tags "$(BUILDTAGS) cgo" $(shell go list ./... | grep -v vendor)
36+ @$(GO) test -v -tags "$(BUILDTAGS) cgo" $(shell $(GO) list ./... | grep -v vendor)
37
38 .PHONY: vet
39 vet: ## Verifies `go vet` passes
40 @echo "+ $@"
41- @go vet $(shell go list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
42+ @$(GO) vet $(shell $(GO) list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr
43
44 .PHONY: install
45 install: ## Installs the executable or package
46 @echo "+ $@"
47- @go install .
48+ @$(GO) install .
49
50 define buildpretty
51 mkdir -p $(BUILDDIR)/$(1)/$(2);
52-GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
53+GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
54 -o $(BUILDDIR)/$(1)/$(2)/$(NAME) \
55 -a -tags "$(BUILDTAGS) static_build netgo" \
56 -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
57@@ -83,7 +83,7 @@ cross: *.go VERSION ## Builds the cross-compiled binaries, creating a clean dire
58 $(foreach GOOSARCH,$(GOOSARCHES), $(call buildpretty,$(subst /,,$(dir $(GOOSARCH))),$(notdir $(GOOSARCH))))
59
60 define buildrelease
61-GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 go build \
62+GOOS=$(1) GOARCH=$(2) CGO_ENABLED=0 $(GO) build \
63 -o $(BUILDDIR)/$(NAME)-$(1)-$(2) \
64 -a -tags "$(BUILDTAGS) static_build netgo" \
65 -installsuffix netgo ${GO_LDFLAGS_STATIC} .;
66@@ -99,7 +99,7 @@ release: *.go VERSION ## Builds the cross-compiled binaries, naming them in such
67 .PHONY: bump-version
68 BUMP := patch
69 bump-version: ## Bump the version in the version file. Set KIND to [ patch | major | minor ]
70- @go get -u github.com/jessfraz/junk/sembump # update sembump tool
71+ @$(GO) get -u github.com/jessfraz/junk/sembump # update sembump tool
72 $(eval NEW_VERSION = $(shell sembump --kind $(BUMP) $(VERSION)))
73 @echo "Bumping VERSION from $(VERSION) to $(NEW_VERSION)"
74 echo $(NEW_VERSION) > VERSION
75--
762.7.4
77
diff --git a/recipes-networking/netns/netns_git.bb b/recipes-networking/netns/netns_git.bb
index 44377647..d35836ef 100644
--- a/recipes-networking/netns/netns_git.bb
+++ b/recipes-networking/netns/netns_git.bb
@@ -3,7 +3,9 @@ SUMMARY = "Runc hook for setting up default bridge networking."
3LICENSE = "MIT" 3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=20ce4c6a4f32d6ee4a68e3a7506db3f1" 4LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=20ce4c6a4f32d6ee4a68e3a7506db3f1"
5 5
6SRC_URI = "git://github.com/jessfraz/netns;branch=master" 6SRC_URI = "git://github.com/jessfraz/netns;branch=master \
7 file://0001-Use-correct-go-cross-compiler.patch \
8 "
7SRCREV = "74e23a0e5c4e7ac011aafcc4623586c196f1b3ef" 9SRCREV = "74e23a0e5c4e7ac011aafcc4623586c196f1b3ef"
8PV = "0.2.1" 10PV = "0.2.1"
9GO_IMPORT = "import" 11GO_IMPORT = "import"