From: Remi Gacogne Date: Tue, 11 Feb 2025 09:55:01 +0000 (+0100) Subject: auth: Fix handling of man pages with meson X-Git-Tag: dnsdist-2.0.0-alpha1~99^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bd1ebf27cb43e76ef2e21ddb46728aededacb82;p=thirdparty%2Fpdns.git auth: Fix handling of man pages with meson 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. --- diff --git a/meson.build b/meson.build index 6a67f093ec..8247479e41 100644 --- a/meson.build +++ b/meson.build @@ -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