summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2023-05-19 21:51:53 -0400
committerBruce Ashfield <bruce.ashfield@gmail.com>2023-06-15 17:42:31 -0400
commite215f05c27ebaab464dfa38dd4fd460f5d058767 (patch)
tree2d92466d5bb5a606ca6a1c779944c8bc5b480b21
parent05e51d92d56f5cc0e3c88989352c6476bd47d0ec (diff)
downloadmeta-virtualization-e215f05c27ebaab464dfa38dd4fd460f5d058767.tar.gz
skopeo: restructure recipe to fix buildpaths warnings
Like many of the other go recipes, the method of symlinking vendor packages ends up recording the path in the binary. -trimpath can't fix those embedded paths, so we switch skopeo to be link the other recipes and position our source in a way that doesn't require the symlinking, and hence no QA warning. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/skopeo/files/0001-makefile-add-GOBUILDFLAGS-to-go-build-call.patch4
-rw-r--r--recipes-containers/skopeo/skopeo_git.bb30
2 files changed, 8 insertions, 26 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
index c362b6a2..5d313e73 100644
--- 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
@@ -15,8 +15,8 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
15 15
16Index: git/src/import/Makefile 16Index: git/src/import/Makefile
17=================================================================== 17===================================================================
18--- git.orig/src/import/Makefile 18--- git.orig/Makefile
19+++ git/src/import/Makefile 19+++ git/Makefile
20@@ -126,7 +126,7 @@ 20@@ -126,7 +126,7 @@
21 # Build w/o using containers 21 # Build w/o using containers
22 .PHONY: bin/skopeo 22 .PHONY: bin/skopeo
diff --git a/recipes-containers/skopeo/skopeo_git.bb b/recipes-containers/skopeo/skopeo_git.bb
index b52158d2..aefdcd44 100644
--- a/recipes-containers/skopeo/skopeo_git.bb
+++ b/recipes-containers/skopeo/skopeo_git.bb
@@ -1,7 +1,7 @@
1HOMEPAGE = "https://github.com/containers/skopeo" 1HOMEPAGE = "https://github.com/containers/skopeo"
2SUMMARY = "Work with remote images registries - retrieving information, images, signing content" 2SUMMARY = "Work with remote images registries - retrieving information, images, signing content"
3LICENSE = "Apache-2.0" 3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=7e611105d3e369954840a6668c438584" 4LIC_FILES_CHKSUM = "file://LICENSE;md5=7e611105d3e369954840a6668c438584"
5 5
6DEPENDS = " \ 6DEPENDS = " \
7 gpgme \ 7 gpgme \
@@ -20,7 +20,7 @@ RDEPENDS:${PN} = " \
20" 20"
21 21
22SRC_URI = " \ 22SRC_URI = " \
23 git://github.com/containers/skopeo;branch=main;protocol=https \ 23 git://github.com/containers/skopeo;branch=main;protocol=https;destsuffix=git/src/github.com/containers/skopeo \
24 file://0001-makefile-add-GOBUILDFLAGS-to-go-build-call.patch \ 24 file://0001-makefile-add-GOBUILDFLAGS-to-go-build-call.patch \
25" 25"
26 26
@@ -28,7 +28,7 @@ SRCREV = "cf5027809ac32847df8570bccb4e425a10ba1591"
28PV = "v1.12.0+git${SRCPV}" 28PV = "v1.12.0+git${SRCPV}"
29GO_IMPORT = "import" 29GO_IMPORT = "import"
30 30
31S = "${WORKDIR}/git" 31S = "${WORKDIR}/git/src/github.com/containers/skopeo"
32 32
33inherit goarch 33inherit goarch
34inherit pkgconfig 34inherit pkgconfig
@@ -48,25 +48,8 @@ EXTRA_OEMAKE="BUILDTAGS=''"
48do_compile() { 48do_compile() {
49 export GOARCH="${TARGET_GOARCH}" 49 export GOARCH="${TARGET_GOARCH}"
50 50
51 # Setup vendor directory so that it can be used in GOPATH. 51 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go:${WORKDIR}/git/"
52 # 52 cd ${S}
53 # Go looks in a src directory under any directory in GOPATH but riddler
54 # uses 'vendor' instead of 'vendor/src'. We can fix this with a symlink.
55 #
56 # We also need to link in the ipallocator directory as that is not under
57 # a src directory.
58 ln -sfn . "${S}/src/import/vendor/src"
59
60 # not used in v1.12+, but kept for temporary compatibiity
61 mkdir -p "${S}/src/import/vendor/src/github.com/projectatomic/skopeo"
62 ln -sfn "${S}/src/import/skopeo" "${S}/src/import/vendor/src/github.com/projectatomic/skopeo"
63 ln -sfn "${S}/src/import/version" "${S}/src/import/vendor/src/github.com/projectatomic/skopeo/version"
64
65 mkdir -p "${S}/src/import/vendor/src/github.com/containers/skopeo"
66 mkdir -p "${S}/src/import/vendor/src/github.com/containers/skopeo/cmd/skopeo"
67 ln -sfn "${S}/src/import/version" "${S}/src/import/vendor/src/github.com/containers/skopeo/version"
68 ln -sfn "${S}/src/import/cmd/skopeo/inspect" "${S}/src/import/vendor/src/github.com/containers/skopeo/cmd/skopeo/inspect"
69 export GOPATH="${S}/src/import/vendor"
70 53
71 # Pass the needed cflags/ldflags so that cgo 54 # Pass the needed cflags/ldflags so that cgo
72 # can find the needed headers files and libraries 55 # can find the needed headers files and libraries
@@ -75,7 +58,6 @@ do_compile() {
75 export LDFLAGS="" 58 export LDFLAGS=""
76 export CGO_CFLAGS="${TARGET_CFLAGS}" 59 export CGO_CFLAGS="${TARGET_CFLAGS}"
77 export CGO_LDFLAGS="${TARGET_LDFLAGS}" 60 export CGO_LDFLAGS="${TARGET_LDFLAGS}"
78 cd ${S}/src/import
79 61
80 export GO111MODULE=off 62 export GO111MODULE=off
81 export GOBUILDFLAGS="-trimpath" 63 export GOBUILDFLAGS="-trimpath"
@@ -88,7 +70,7 @@ do_install() {
88 install -d ${D}/${sbindir} 70 install -d ${D}/${sbindir}
89 install -d ${D}/${sysconfdir}/containers 71 install -d ${D}/${sysconfdir}/containers
90 72
91 install ${S}/src/import/bin/skopeo ${D}/${sbindir}/ 73 install ${S}/bin/skopeo ${D}/${sbindir}/
92} 74}
93 75
94do_install:append:class-native() { 76do_install:append:class-native() {