pohly / meta-swupd

An experimental and now abandoned fork of http://git.yoctoproject.org/cgit/cgit.cgi/meta-swupd/ - do not use in production!
MIT License
2 stars 2 forks source link

swupd-client: build depend on python3-docutils-native #4

Closed marquiz closed 6 years ago

marquiz commented 6 years ago

Doc generation uses rst2man (from python3-docutils-native) which is not necessarily installed on the build host.

Signed-off-by: Markus Lehtonen markus.lehtonen@linux.intel.com

pohly commented 6 years ago

I have a different fix locally:

diff --git a/recipes-core/swupd-client/swupd-client_git.bb b/recipes-core/swupd-client/swupd-client_git.bb
index cb2947d..6a4720f 100644
--- a/recipes-core/swupd-client/swupd-client_git.bb
+++ b/recipes-core/swupd-client/swupd-client_git.bb
@@ -45,6 +45,20 @@ EXTRA_OECONF = "\
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[stateless] = ",--disable-stateless"

+do_unpack[postfuncs] += "fix_timestamps "
+fix_timestamps () {
+    # Depending on how time stamps are assigned by git, make may end up re-generating
+    # documentation, which then fails because rst2man.py is not found. Avoid that by
+    # ensuring that each man page file has the same time stamp as the corresponding
+    # input .rst file.
+    for i in ${S}/docs/*.rst; do
+        m=${S}/docs/`basename $i .rst`
+        if [ -f $m ]; then
+            touch -r $i $m
+        fi
+    done
+}
+
 do_patch[postfuncs] += "fix_paths "
 fix_paths () {
     # /usr/bin/systemctl is currently hard-coded in src/scripts.c update_triggers(),

What do you think about that?

aaronovz1 commented 6 years ago

I also ran across this problem and submitted a pull request to just allow disabling manual creation. See https://github.com/clearlinux/swupd-client/pull/309

marquiz commented 6 years ago

@pohly : Oh, I didn't even realize that the man pages are pre-generated and found in the git tree. I think your solution is nicer, even if it adds more lines to the recipe. Fewer dependencies and less (unneeded) compilation work done.

pohly commented 6 years ago

Then let's use my patch until upstream swupd implements a proper solution.