Skip to content

Commit

Permalink
rec: Fix handling of man pages with meson
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rgacogne committed Feb 11, 2025
1 parent 4bd1ebf commit 42b922a
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions pdns/recursordist/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 42b922a

Please sign in to comment.