Skip to content

Commit

Permalink
Only run python if found
Browse files Browse the repository at this point in the history
  • Loading branch information
omoerbeek committed Feb 17, 2025
1 parent 379b8d7 commit efb47e3
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 122 deletions.
83 changes: 42 additions & 41 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1124,47 +1124,48 @@ if get_option('unit-tests-backends')
endforeach
endif

html_docs = custom_target(
'html-docs',
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@' / 'html-docs',
],
output: 'html-docs',
console: true,
)

docs_tarball = custom_target(
'html-docs.tar.bz2',
command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
output: 'html-docs.tar.bz2',
)
if python.found()
html_docs = custom_target(
'html-docs',
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@' / 'html-docs',
],
output: 'html-docs',
console: true,
)

pdf_docs = custom_target(
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@',
'--pdf-name', 'PowerDNS-Authoritative.pdf',
],
output: 'PowerDNS-Authoritative.pdf',
console: true,
)
docs_tarball = custom_target(
'html-docs.tar.bz2',
command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
output: 'html-docs.tar.bz2',
)

run_target(
'all-docs',
# args mentioned in command line become auto-dependency
command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
)
pdf_docs = custom_target(
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@',
'--pdf-name', 'PowerDNS-Authoritative.pdf',
],
output: 'PowerDNS-Authoritative.pdf',
console: true,
)

run_target(
'all-docs',
# args mentioned in command line become auto-dependency
command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
)
endif
82 changes: 42 additions & 40 deletions pdns/dnsdistdist/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -690,46 +690,48 @@ install_data(
follow_symlinks: true
)

html_docs = custom_target(
'html-docs',
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@' / 'html-docs',
],
output: 'html-docs',
console: true,
)
if python.found()
html_docs = custom_target(
'html-docs',
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@' / 'html-docs',
],
output: 'html-docs',
console: true,
)

docs_tarball = custom_target(
'html-docs.tar.bz2',
command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
output: 'html-docs.tar.bz2',
)
docs_tarball = custom_target(
'html-docs.tar.bz2',
command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
output: 'html-docs.tar.bz2',
)

pdf_docs = custom_target(
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@',
'--pdf-name', 'dnsdist.pdf',
],
output: 'dnsdist.pdf',
console: true,
)
pdf_docs = custom_target(
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@',
'--pdf-name', 'dnsdist.pdf',
],
output: 'dnsdist.pdf',
console: true,
)

run_target(
'all-docs',
# args mentioned in command line become auto-dependency
command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
)
run_target(
'all-docs',
# args mentioned in command line become auto-dependency
command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
)
endif
83 changes: 42 additions & 41 deletions pdns/recursordist/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -734,47 +734,48 @@ dep_conf_distfile = custom_target(
install_dir: get_option('sysconfdir'),
)

html_docs = custom_target(
'html-docs',
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@' / 'html-docs',
],
output: 'html-docs',
console: true,
)

docs_tarball = custom_target(
'html-docs.tar.bz2',
command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
output: 'html-docs.tar.bz2',
)
if python.found()
html_docs = custom_target(
'html-docs',
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@' / 'html-docs',
],
output: 'html-docs',
console: true,
)

pdf_docs = custom_target(
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@',
'--pdf-name', 'PowerDNS-Recursor.pdf',
],
output: 'PowerDNS-Recursor.pdf',
console: true,
)
docs_tarball = custom_target(
'html-docs.tar.bz2',
command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
output: 'html-docs.tar.bz2',
)

run_target(
'all-docs',
# args mentioned in command line become auto-dependency
command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
)
pdf_docs = custom_target(
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@',
'--pdf-name', 'PowerDNS-Recursor.pdf',
],
output: 'PowerDNS-Recursor.pdf',
console: true,
)

run_target(
'all-docs',
# args mentioned in command line become auto-dependency
command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
)
endif

0 comments on commit efb47e3

Please sign in to comment.