]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
docs/manpages/meson.build: Use template code for XSLT processing
authorPeter Krempa <pkrempa@redhat.com>
Tue, 13 Oct 2020 15:19:50 +0000 (17:19 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 19 Oct 2020 10:40:51 +0000 (12:40 +0200)
Replace the reimplementation of the XSLT processing custom target with
an identical copy form docs/meson.build and a comment to keep them in
sync.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
docs/manpages/meson.build

index 7ed1d304a4e6e40f3a5f42db78026272b3f782df..ecc517e80e2886cfa4ed90f59b8f292c2a14ad94 100644 (file)
@@ -1,3 +1,7 @@
+html_xslt_gen_xslt = subsite_xsl
+html_xslt_gen_install_dir = docs_html_dir / 'manpages'
+html_xslt_gen = []
+
 # docs_man_files
 #   each entry is a dictionary with following items:
 #   name - man page name (required)
@@ -104,29 +108,44 @@ foreach data : docs_man_files
     capture: true,
   )
 
-  out_file = custom_target(
-    html_file,
-    input: html_in,
-    output: html_file,
+  html_xslt_gen += {
+    'name': data['name'],
+    'file': html_in,
+    'source': 'docs/manpages' / rst_in_file,
+  }
+endforeach
+
+# keep the XSLT processing code block in sync with docs/meson.build
+
+# --- begin of XSLT processing ---
+
+foreach data : html_xslt_gen
+  html_filename = data['name'] + '.html'
+
+  html_file = custom_target(
+    html_filename,
+    input: data.get('file', data['name'] + '.html.in'),
+    output: html_filename,
     command: [
-      meson_python_prog,
-      python3_prog.path(),
-      meson_html_gen_prog.path(),
-      xsltproc_prog.path(),
-      xmllint_prog.path(),
-      meson.build_root(),
-      docs_timestamp,
-      subsite_xsl,
+      xsltproc_prog,
+      '--stringparam', 'pagesrc', data.get('source', ''),
+      '--stringparam', 'builddir', meson.build_root(),
+      '--stringparam', 'timestamp', docs_timestamp,
+      '--nonet',
+      html_xslt_gen_xslt,
       '@INPUT@',
-      '@OUTPUT@',
-      'docs/manpages' / rst_in_file,
     ],
-    depends: [ aclperms_gen ],
+    depends: data.get('depends', []),
     depend_files: [ page_xsl ],
+    capture: true,
     install: true,
-    install_dir: docs_html_dir / 'manpages',
+    install_dir: html_xslt_gen_install_dir,
   )
 
-  install_web_deps += out_file
-  install_web_files += '@0@:@1@'.format(out_file.full_path(), docs_html_dir / 'manpages')
+  install_web_deps += html_file
+  install_web_files += html_file.full_path() + ':' + html_xslt_gen_install_dir
 endforeach
+
+html_xslt_gen = []
+
+# --- end of XSLT processing ---