Skip to contentSkip to conversation

podman: make manpages optional via PACKAGECONFIG

PATCH Bruce Ashfield 1 participant 1 message Sep 1 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 30 lines · Harish Kore

The default make target also builds the manpages, which fails when the required manpages tools are not available.

Add a manpages PACKAGECONFIG option and only build and install the manpages when it is enabled.

---
 recipes-containers/podman/podman_git.bb | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
recipes-containers/podman/podman_git.bb +4 -0
index 36c80c0e..6e990fe4 100644
@@ -71,6 +71,10 @@ EXTRA_OEMAKE = " \
 PODMAN_FEATURES ?= "docker"
 
 PACKAGECONFIG ?= ""
+# Building manpages needs go-md2man and runs 'man -l', which is not
+# available on the build host. Off by default; when enabled, use
+# go-md2man-native and skip the 'man -l' check via MAN_L=true.
+PACKAGECONFIG[manpages] = ",,go-md2man-native"
 PACKAGECONFIG[rootless] = ",,,fuse-overlayfs slirp4netns,,"
 
 do_compile() {
@@ -98,7 +102,14 @@ do_compile() {
        export NATIVE_GOOS=${BUILD_GOOS}
        export NATIVE_GOARCH=${BUILD_GOARCH}

recipes-containers/podman/podman_git.bb do_compile() { · line 112

Quoted 10 lines
recipes-containers/podman/podman_git.bb +8 -1
 
-       oe_runmake NATIVE_GOOS=${BUILD_GOOS} NATIVE_GOARCH=${BUILD_GOARCH} BUILDTAGS="${BUILDTAGS}"
+       if ${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'true', 'false', d)}; then
+               oe_runmake binaries docs \
+                       GOMD2MAN="${STAGING_BINDIR_NATIVE}/go-md2man" MAN_L="true" \
+                       NATIVE_GOOS=${BUILD_GOOS} NATIVE_GOARCH=${BUILD_GOARCH} BUILDTAGS="${BUILDTAGS}"
+       else
+               oe_runmake binaries \
+                       NATIVE_GOOS=${BUILD_GOOS} NATIVE_GOARCH=${BUILD_GOARCH} BUILDTAGS="${BUILDTAGS}"
+       fi

Rather than repeating the oe_runmake, make the additions to the make invokation be
a variable, and set the variable(s) (both environment and make command line) conditionally.

Same for the condition below.

Bruce

Quoted 19 lines
recipes-containers/podman/podman_git.bb +5 -2
 }
 
 do_install() {
@@ -108,7 +119,11 @@ do_install() {
        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', 'manpages', 'true', 'false', d)}; then
+               oe_runmake install.bin install.man install.systemd DESTDIR="${D}"
+       else
+               oe_runmake install.bin install.systemd DESTDIR="${D}"
+       fi
        if ${@bb.utils.contains('PODMAN_FEATURES', 'docker', 'true', 'false', d)}; then
                oe_runmake install.docker DESTDIR="${D}"
        fi
--

2.53.0

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