crun: Add PACKAGECONFIG options

Neither systemd nor seccomp is hard required by crun.
They can actually be disabled during configuration with
--disable-systemd or --disable-seccomp.

Introduce PACKAGECONFIG options for them and default them to presence
of corresponding entries in DISTRO_FEATURES.

Now REQUIRED_DISTRO_FEATURES and features_check can also be removed.

Similarly dependency on libcap can be made optional.
crun actually contains pregenerated manpages in the repository so
dependency on go-md2man-native can be made optional as well.

As there is a configuration option for embedding yajl I added an option
for that as well. However, as PACKAGECONFIG can only specify
dependencies when config is enabled I had to invert the options so the
config is for external-yajl.

I set default PACKAGECONFIG value to match previous state (except
detecting if systemd and seccomp are in DISTRO_FEATURES).

Signed-off-by: Michal Sieron <michalwsieron@gmail.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Michal Sieron 2024-09-23 17:53:17 +02:00 committed by Bruce Ashfield
parent 4d79636aac
commit 75b6a5cf61

View File

@ -20,16 +20,22 @@ SRC_URI = "git://github.com/containers/crun.git;branch=main;name=crun;protocol=h
PV = "v1.15+git${SRCREV_crun}"
S = "${WORKDIR}/git"
REQUIRED_DISTRO_FEATURES ?= "systemd seccomp"
inherit autotools-brokensep pkgconfig
inherit autotools-brokensep pkgconfig features_check
PACKAGECONFIG ??= " \
caps external-yajl man \
${@bb.utils.contains('DISTRO_FEATURES', 'seccomp', 'seccomp', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
"
PACKAGECONFIG ??= ""
PACKAGECONFIG[caps] = "--enable-caps,--disable-caps,libcap"
PACKAGECONFIG[external-yajl] = "--disable-embedded-yajl,--enable-embedded-yajl,yajl"
# whether to regenerate manpages that are already present in the repo
PACKAGECONFIG[man] = ",,go-md2man-native"
PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"
DEPENDS = "yajl libcap go-md2man-native m4-native"
# TODO: is there a packageconfig to turn this off ?
DEPENDS += "libseccomp"
DEPENDS += "systemd"
DEPENDS = "m4-native"
DEPENDS:append:libc-musl = " argp-standalone"
do_configure:prepend () {