]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: Fix handling of man pages with meson
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 11 Feb 2025 09:55:01 +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.

meson.build

index 6a67f093ec0d2033cfd1d7f495a595e8c0a4f9ba..8247479e410945c01d244acd486a3e3ca4445967 100644 (file)
@@ -1011,16 +1011,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-auth-man-pages',
-      '--requirements-file', docs_dir / 'requirements.txt',
-      '--source-directory', docs_dir,
-      '--target-directory', 'auth-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-auth-man-pages',
+       '--requirements-file', docs_dir / 'requirements.txt',
+       '--source-directory', docs_dir,
+       '--target-directory', 'auth-man-pages',
+     ] + man_pages,
   )
 endif