]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Fix handling of man pages with meson
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 11 Feb 2025 09:55:58 +0000 (10:55 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 11 Feb 2025 10:06:38 +0000 (11:06 +0100)
This commit moves to `custom_target` to build the man pages since
we don't want to have to explicitely run a different meson command
to build them. As opposed to `run_target`, `custom_target` does not
have access to the build and source roots via env variables, so the
man pages generation script now takes these as required parameters.

pdns/recursordist/meson.build

index 81d740568fe5535f090ac493c770ea70ccf31b20..4706f6894bcf1d2fd6ac83bb46a3e61a8b6e3bc4 100644 (file)
@@ -576,16 +576,30 @@ summary('Path', python.full_path(), section: 'Manual Pages')
 summary('Version', python.version(), section: 'Manual Pages')
 
 if python.found()
-  run_target(
-    'man-pages',
-    command: [
-      python,
-      product_source_dir / docs_dir / 'generate-man-pages.py',
-      '--venv-name', 'venv-rec-man-pages',
-      '--requirements-file', docs_dir / 'requirements.txt',
-      '--source-directory', docs_dir,
-      '--target-directory', 'rec-man-pages',
-    ] + man_pages,
+  generated_man_pages = []
+  foreach tool, info: tools
+    if 'manpages' in info
+      foreach man_page: info['manpages']
+        generated_man_pages += man_page
+      endforeach
+    endif
+  endforeach
+  custom_target(
+     'man-pages',
+     input: man_pages,
+     output: generated_man_pages,
+     install: true,
+     install_dir: join_paths(get_option('mandir'), 'man1'),
+     command: [
+       python,
+       product_source_dir / docs_dir / 'generate-man-pages.py',
+       '--build-root', '@BUILD_ROOT@',
+       '--source-root', '@SOURCE_ROOT@',
+       '--venv-name', 'venv-rec-man-pages',
+       '--requirements-file', docs_dir / 'requirements.txt',
+       '--source-directory', docs_dir,
+       '--target-directory', 'rec-man-pages',
+     ] + man_pages,
   )
 endif