diff options
-rw-r--r-- | recipes-containers/skopeo/files/0001-makefile-add-GOBUILDFLAGS-to-go-build-call.patch | 29 | ||||
-rw-r--r-- | recipes-containers/skopeo/skopeo_git.bb | 5 |
2 files changed, 33 insertions, 1 deletions
diff --git a/recipes-containers/skopeo/files/0001-makefile-add-GOBUILDFLAGS-to-go-build-call.patch b/recipes-containers/skopeo/files/0001-makefile-add-GOBUILDFLAGS-to-go-build-call.patch new file mode 100644 index 00000000..4129e8b6 --- /dev/null +++ b/recipes-containers/skopeo/files/0001-makefile-add-GOBUILDFLAGS-to-go-build-call.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 7037cb27718fe23541885684fdacec9c52ee0e30 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
3 | Date: Tue, 13 Sep 2022 11:55:45 -0400 | ||
4 | Subject: [PATCH] makefile: add GOBUILDFLAGS to go build call | ||
5 | |||
6 | We may need to specify things like -trimpath, so add $(GOBUILDFLAGS) | ||
7 | to allow them to be passed from the recipe to the Makefile. | ||
8 | |||
9 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
10 | --- | ||
11 | src/import/Makefile | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/src/import/Makefile b/src/import/Makefile | ||
15 | index 58ed8d3a..990edd1d 100644 | ||
16 | --- a/src/import/Makefile | ||
17 | +++ b/src/import/Makefile | ||
18 | @@ -136,7 +136,7 @@ binary: cmd/skopeo | ||
19 | # Build w/o using containers | ||
20 | .PHONY: bin/skopeo | ||
21 | bin/skopeo: | ||
22 | - $(GO) build $(MOD_VENDOR) ${GO_DYN_FLAGS} ${SKOPEO_LDFLAGS} -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o $@ ./cmd/skopeo | ||
23 | + $(GO) build $(GOBUILDFLAGS) $(MOD_VENDOR) ${GO_DYN_FLAGS} ${SKOPEO_LDFLAGS} -gcflags "$(GOGCFLAGS)" -tags "$(BUILDTAGS)" -o $@ ./cmd/skopeo | ||
24 | bin/skopeo.%: | ||
25 | GOOS=$(word 2,$(subst ., ,$@)) GOARCH=$(word 3,$(subst ., ,$@)) $(GO) build $(MOD_VENDOR) ${SKOPEO_LDFLAGS} -tags "containers_image_openpgp $(BUILDTAGS)" -o $@ ./cmd/skopeo | ||
26 | local-cross: bin/skopeo.darwin.amd64 bin/skopeo.linux.arm bin/skopeo.linux.arm64 bin/skopeo.windows.386.exe bin/skopeo.windows.amd64.exe | ||
27 | -- | ||
28 | 2.19.1 | ||
29 | |||
diff --git a/recipes-containers/skopeo/skopeo_git.bb b/recipes-containers/skopeo/skopeo_git.bb index d426b4f8..a2fff2c9 100644 --- a/recipes-containers/skopeo/skopeo_git.bb +++ b/recipes-containers/skopeo/skopeo_git.bb | |||
@@ -23,6 +23,7 @@ SRC_URI = " \ | |||
23 | git://github.com/containers/skopeo;branch=main;protocol=https \ | 23 | git://github.com/containers/skopeo;branch=main;protocol=https \ |
24 | file://storage.conf \ | 24 | file://storage.conf \ |
25 | file://registries.conf \ | 25 | file://registries.conf \ |
26 | file://0001-makefile-add-GOBUILDFLAGS-to-go-build-call.patch \ | ||
26 | " | 27 | " |
27 | 28 | ||
28 | SRCREV = "b95e081162382f9a28f400bee10046ce72b957fe" | 29 | SRCREV = "b95e081162382f9a28f400bee10046ce72b957fe" |
@@ -70,6 +71,8 @@ do_compile() { | |||
70 | cd ${S}/src/import | 71 | cd ${S}/src/import |
71 | 72 | ||
72 | export GO111MODULE=off | 73 | export GO111MODULE=off |
74 | export GOBUILDFLAGS="-trimpath" | ||
75 | export EXTRA_LDFLAGS="-s -w" | ||
73 | 76 | ||
74 | oe_runmake bin/skopeo | 77 | oe_runmake bin/skopeo |
75 | } | 78 | } |
@@ -98,6 +101,6 @@ do_install:append:class-nativesdk() { | |||
98 | --policy ${sysconfdir}/containers/policy.json | 101 | --policy ${sysconfdir}/containers/policy.json |
99 | } | 102 | } |
100 | 103 | ||
101 | INSANE_SKIP:${PN} += "ldflags" | 104 | INSANE_SKIP:${PN} += "ldflags already-stripped" |
102 | 105 | ||
103 | BBCLASSEXTEND = "native nativesdk" | 106 | BBCLASSEXTEND = "native nativesdk" |