Skip to contentSkip to conversation

buildah: add recipe for buildah v1.26

PATCH Superseded Sakib Sajal 2 participants 2 messages May 19, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildah: add recipe for buildah v1.26

buildah is a tool that facilitates building OCI container images.

---
 recipes-containers/buildah/buildah_git.bb | 57 +++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 recipes-containers/buildah/buildah_git.bb
recipes-containers/buildah/buildah_git.bb new file +57 -0
new file mode 100644
index 0000000..024e82c
@@ -0,0 +1,57 @@
+HOMEPAGE = "https://buildah.io"
+SUMMARY = "A tool that facilitates building OCI container images."
+DESCRIPTION = "A tool that facilitates building OCI container images."
+
+# Apache-2.0 for containerd
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://src/github.com/containers/buildah/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+S = "${WORKDIR}/git"
+
+BUILDAH_VERSION = "1.26"
+SRCREV_buildah = "0a9d6e6eaef2e2e7936313d449a4e226022eb865"
+
+PV = "${BUILDAH_VERSION}"
+
+inherit go
+inherit goarch
+inherit pkgconfig
+
+GO_IMPORT = "github.com/containers/buildah"
+GO_INSTALL = "${GO_IMPORT}"
+GO_WORKDIR = "${GO_INSTALL}"
+GOBUILDFLAGS += "-mod vendor"
+
+SRC_URI = " \
+    git://github.com/containers/buildah;branch=release-${BUILDAH_VERSION};name=buildah;protocol=https \
+    "
+
+DEPENDS = "libdevmapper btrfs-tools gpgme"
+RDEPENDS:${PN} = "cgroup-lite fuse-overlayfs libdevmapper podman"
+RDEPENDS:${PN}-dev = "bash perl"
+
+do_compile:prepend() {
+    cd ${S}/src/github.com/containers/buildah
+}
+
+go_do_compile() {
+        export TMPDIR="${GOTMPDIR}"
+        if [ -n "${GO_INSTALL}" ]; then
+                if [ -n "${GO_LINKSHARED}" ]; then
+                        ${GO} install ${GOBUILDFLAGS} ./cmd/buildah
+                        ${GO} install ${GOBUILDFLAGS} ./tests/imgtype/imgtype.go
+                        ${GO} install ${GOBUILDFLAGS} ./tests/copy/copy.go
+                        rm -rf ${B}/bin
+                fi
+                ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} ./cmd/buildah
+                ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} ./tests/imgtype/imgtype.go
+                ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} ./tests/copy/copy.go
+        fi
+}
+
+do_install:append() {
+    dest_dir=${D}/${sysconfdir}/containers
+    mkdir -p ${dest_dir}
+    install -m 666 ${S}/src/github.com/containers/buildah/docs/samples/registries.conf ${dest_dir}/buildah.registries.conf.sample
+    install -m 666 ${S}/src/github.com/containers/buildah/tests/policy.json ${dest_dir}/buildah.policy.json.sample
+}
Signature · 1 line
2.33.0
#1 lore raw
Quoted 3 lines · On Thu, May 19, 2022 at 3:52 PM <[email protected]> wrote:

buildah is a tool that facilitates building OCI container images.

We need a better description here.

What is the intent of the recipe ? Is it being run on the target (it isn't a -native recipe, so that is the implication). How would someone use it ? How would I test it ?

Those sorts of things. Then I can move onto more questions :)

Quoted 37 lines
---
 recipes-containers/buildah/buildah_git.bb | 57 +++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 recipes-containers/buildah/buildah_git.bb
recipes-containers/buildah/buildah_git.bb new file +25 -0
new file mode 100644
index 0000000..024e82c
@@ -0,0 +1,57 @@
+HOMEPAGE = "https://buildah.io"
+SUMMARY = "A tool that facilitates building OCI container images."
+DESCRIPTION = "A tool that facilitates building OCI container images."
+
+# Apache-2.0 for containerd
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://src/github.com/containers/buildah/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+
+S = "${WORKDIR}/git"
+
+BUILDAH_VERSION = "1.26"
+SRCREV_buildah = "0a9d6e6eaef2e2e7936313d449a4e226022eb865"
+
+PV = "${BUILDAH_VERSION}"
+
+inherit go
+inherit goarch
+inherit pkgconfig
+
+GO_IMPORT = "github.com/containers/buildah"
+GO_INSTALL = "${GO_IMPORT}"
+GO_WORKDIR = "${GO_INSTALL}"
+GOBUILDFLAGS += "-mod vendor"
+
+SRC_URI = " \

recipes-containers/buildah/buildah_git.bb line 35

Quoted 10 lines
recipes-containers/buildah/buildah_git.bb new file +10 -0
+    git://github.com/containers/buildah;branch=release-${BUILDAH_VERSION};name=buildah;protocol=https \
+    "
+
+DEPENDS = "libdevmapper btrfs-tools gpgme"
+RDEPENDS:${PN} = "cgroup-lite fuse-overlayfs libdevmapper podman"
+RDEPENDS:${PN}-dev = "bash perl"
+
+do_compile:prepend() {
+    cd ${S}/src/github.com/containers/buildah
+}

What is do_compile actually doing ? Does buildah have a Makefile (it does, I peeked).

Since you have a secondary do_compile .. I'm not sure what the buildah Makefile isn't doing that requires the go_do_compile().

recipes-containers/buildah/buildah_git.bb line 39

Quoted 4 lines
recipes-containers/buildah/buildah_git.bb new file +4 -0
+
+go_do_compile() {
+        export TMPDIR="${GOTMPDIR}"
+        if [ -n "${GO_INSTALL}" ]; then

It's unclear why you are copying the format of the go.bbclass's go_do_compile.

You don't really need to check either of the variables you are checking, since this is not general purpose and is only building this package, not attempting to be generic.

Summary .. I think this can be simplified, or the default go_do_compile only used.

Quoted 7 lines
recipes-containers/buildah/buildah_git.bb new file +7 -0
+                if [ -n "${GO_LINKSHARED}" ]; then
+                        ${GO} install ${GOBUILDFLAGS} ./cmd/buildah
+                        ${GO} install ${GOBUILDFLAGS} ./tests/imgtype/imgtype.go
+                        ${GO} install ${GOBUILDFLAGS} ./tests/copy/copy.go
+                        rm -rf ${B}/bin
+                fi
+                ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} ./cmd/buildah

recipes-containers/buildah/buildah_git.bb line 56

Quoted 10 lines
recipes-containers/buildah/buildah_git.bb new file +10 -0
+                ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} ./tests/imgtype/imgtype.go
+                ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} ./tests/copy/copy.go
+        fi
+}
+
+do_install:append() {
+    dest_dir=${D}/${sysconfdir}/containers
+    mkdir -p ${dest_dir}
+    install -m 666 ${S}/src/github.com/containers/buildah/docs/samples/registries.conf ${dest_dir}/buildah.registries.conf.sample
+    install -m 666 ${S}/src/github.com/containers/buildah/tests/policy.json ${dest_dir}/buildah.policy.json.sample

Minor 'nit, but the spacing is different in this append, versus the other functions.

Bruce

Quoted 5 lines
recipes-containers/buildah/buildah_git.bb new file +1 -1
+}
--

2.33.0

Quoted 8 lines

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

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