meta-virtualization/recipes-containers/podman/podman_git.bb
Bruce Ashfield d876cfc5bf global: overrides syntax conversion
OEcore/bitbake are moving to use the clearer ":" as an overrides
separator.

This is pass one of updating the meta-virt recipes to use that
syntax.

This has only been minimally build/runtime tested, more changes
will be required for missed overrides, or incorrect conversions

Note: A recent bitbake is required:

    commit 75fad23fc06c008a03414a1fc288a8614c6af9ca
    Author: Richard Purdie <richard.purdie@linuxfoundation.org>
    Date:   Sun Jul 18 12:59:15 2021 +0100

        bitbake: data_smart/parse: Allow ':' characters in variable/function names

        It is becomming increasingly clear we need to find a way to show what
        is/is not an override in our syntax. We need to do this in a way which
        is clear to users, readable and in a way we can transition to.

        The most effective way I've found to this is to use the ":" charater
        to directly replace "_" where an override is being specified. This
        includes "append", "prepend" and "remove" which are effectively special
        override directives.

        This patch simply adds the character to the parser so bitbake accepts
        the value but maps it back to "_" internally so there is no behaviour
        change.

        This change is simple enough it could potentially be backported to older
        version of bitbake meaning layers using the new syntax/markup could
        work with older releases. Even if other no other changes are accepted
        at this time and we don't backport, it does set us on a path where at
        some point in future we could
        require a more explict syntax.

        I've tested this patch by converting oe-core/meta-yocto to the new
        syntax for overrides (9000+ changes) and then seeing that builds
        continue to work with this patch.

        (Bitbake rev: 0dbbb4547cb2570d2ce607e9a53459df3c0ac284)

        Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2021-08-02 17:17:53 -04:00

115 lines
3.6 KiB
BlitzBasic

HOMEPAGE = "https://podman.io/"
SUMMARY = "A daemonless container engine"
DESCRIPTION = "Podman is a daemonless container engine for developing, \
managing, and running OCI Containers on your Linux System. Containers can \
either be run as root or in rootless mode. Simply put: \
`alias docker=podman`. \
"
inherit features_check
REQUIRED_DISTRO_FEATURES ?= "seccomp"
DEPENDS = " \
go-metalinter-native \
go-md2man-native \
gpgme \
libseccomp \
${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
"
SRCREV = "5ef6c011fc25ab78a6cba583cfef81c0a66d81af"
SRC_URI = " \
git://github.com/containers/libpod.git;branch=v3.2 \
"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
GO_IMPORT = "import"
S = "${WORKDIR}/git"
PV = "3.2.3+git${SRCPV}"
PACKAGES =+ "${PN}-contrib"
PODMAN_PKG = "github.com/containers/libpod"
BUILDTAGS ?= "seccomp varlink \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
exclude_graphdriver_btrfs exclude_graphdriver_devicemapper"
# overide LDFLAGS to allow podman to build without: "flag provided but not # defined: -Wl,-O1
export LDFLAGS=""
inherit go goarch
inherit systemd pkgconfig
do_configure[noexec] = "1"
EXTRA_OEMAKE = " \
PREFIX=${prefix} BINDIR=${bindir} LIBEXECDIR=${libexecdir} \
ETCDIR=${sysconfdir} TMPFILESDIR=${nonarch_libdir}/tmpfiles.d \
SYSTEMDDIR=${systemd_unitdir}/system USERSYSTEMDDIR=${systemd_unitdir}/user \
"
# remove 'docker' from the packageconfig if you don't want podman to
# build and install the docker wrapper. If docker is enabled in the
# packageconfig, the podman package will rconfict with docker.
PACKAGECONFIG ?= "docker"
do_compile() {
cd ${S}/src
rm -rf .gopath
mkdir -p .gopath/src/"$(dirname "${PODMAN_PKG}")"
ln -sf ../../../../import/ .gopath/src/"${PODMAN_PKG}"
ln -sf "../../../import/vendor/github.com/varlink/" ".gopath/src/github.com/varlink"
export GOARCH="${BUILD_GOARCH}"
export GOPATH="${S}/src/.gopath"
export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
cd ${S}/src/.gopath/src/"${PODMAN_PKG}"
# Pass the needed cflags/ldflags so that cgo
# can find the needed headers files and libraries
export GOARCH=${TARGET_GOARCH}
export CGO_ENABLED="1"
export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
oe_runmake BUILDTAGS="${BUILDTAGS}"
}
do_install() {
cd ${S}/src/.gopath/src/"${PODMAN_PKG}"
export GOARCH="${BUILD_GOARCH}"
export GOPATH="${S}/src/.gopath"
export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
oe_runmake install DESTDIR="${D}"
if ${@bb.utils.contains('PACKAGECONFIG', 'docker', 'true', 'false', d)}; then
oe_runmake install.docker DESTDIR="${D}"
fi
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${systemd_unitdir}/system
install -m 644 ${S}/src/import/contrib/systemd/system/podman.service ${D}/${systemd_unitdir}/system
install -m 644 ${S}/src/import/contrib/systemd/system/podman.socket ${D}/${systemd_unitdir}/system
rm -f ${D}/${systemd_unitdir}/system/docker.service.rpm
fi
}
FILES:${PN} += " \
${systemd_unitdir}/system/* \
${systemd_unitdir}/user/* \
${nonarch_libdir}/tmpfiles.d/* \
${sysconfdir}/cni \
"
SYSTEMD_SERVICE:${PN} = "podman.service podman.socket"
RDEPENDS:${PN} += "conmon virtual/runc iptables cni skopeo"
RRECOMMENDS:${PN} += "slirp4netns kernel-module-xt-masquerade kernel-module-xt-comment"
RCONFLICTS:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'docker', 'docker', '', d)}"