Skip to contentSkip to conversation

skopeo: clean up depends and fix CGO settings

PATCH In review Chen Qi 2 participants 2 messages Jun 10, 2022

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

PATCH 1/1 skopeo: clean up depends and fix CGO settings

According to https://github.com/containers/skopeo/blob/main/install.md#building-from-source,
the ostree dependency is not needed.

Also, remove the CGO settings which incorrectly use BUILDSDK_XXX. The CGO_CFLAGS and CGO_LDFALGS should use target flags instead of SDK ones. As the CGO_XXX vars have already been set in go.bbclass, there's no need to set them here.

---
 recipes-containers/skopeo/skopeo_git.bb | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
recipes-containers/skopeo/skopeo_git.bb +1 -6
index f3217dbf..24d951ef 100644
@@ -9,10 +9,9 @@ DEPENDS = " \
     lvm2 \
     btrfs-tools \
     glib-2.0 \
-    ostree \
 "
 
-inherit go
+inherit go pkgconfig
 
 RDEPENDS:${PN} = " \
      gpgme \
@@ -33,8 +32,6 @@ GO_IMPORT = "import"
 
 S = "${WORKDIR}/git"
 
-inherit goarch
-inherit pkgconfig
 
 # This disables seccomp and apparmor, which are on by default in the
 # go package. 
@@ -61,8 +58,6 @@ do_compile() {
 	export CGO_ENABLED="1"
 	export CFLAGS=""
 	export LDFLAGS=""
-	export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
-	export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
 	cd ${S}/src/import
 
 	export GO111MODULE=off
Signature · 1 line
2.36.0
#1 lore raw
Quoted 8 lines · Chen Qi

According to https://github.com/containers/skopeo/blob/main/install.md#building-from-source,
the ostree dependency is not needed.

Also, remove the CGO settings which incorrectly use BUILDSDK_XXX. The CGO_CFLAGS and CGO_LDFALGS should use target flags instead of SDK ones. As the CGO_XXX vars have already been set in go.bbclass, there's no need to set them here.

I'll take the ostree change (it is now handled by vendor/), and that wasn't always the case.

But like the others, I'm not going to drop the explicit arch/flag settings.

Cheers,

Bruce

Quoted 52 lines
---
 recipes-containers/skopeo/skopeo_git.bb | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
recipes-containers/skopeo/skopeo_git.bb +1 -7
index f3217dbf..24d951ef 100644
@@ -9,10 +9,9 @@ DEPENDS = " \
     lvm2 \
     btrfs-tools \
     glib-2.0 \
-    ostree \
 "
 
-inherit go
+inherit go pkgconfig
 
 RDEPENDS:${PN} = " \
      gpgme \
@@ -33,8 +32,6 @@ GO_IMPORT = "import"
 
 S = "${WORKDIR}/git"
 
-inherit goarch
-inherit pkgconfig
 
 # This disables seccomp and apparmor, which are on by default in the
 # go package.
@@ -61,8 +58,6 @@ do_compile() {
        export CGO_ENABLED="1"
        export CFLAGS=""
        export LDFLAGS=""
-       export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
-       export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
        cd ${S}/src/import
 
        export GO111MODULE=off
--

2.36.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7358): https://lists.yoctoproject.org/g/meta-virtualization/message/7358
Mute This Topic: https://lists.yoctoproject.org/mt/91664552/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II