]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Only run python if found
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 17 Feb 2025 15:06:42 +0000 (16:06 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 17 Feb 2025 15:10:59 +0000 (16:10 +0100)
docs/generate-docs.py
meson.build
pdns/dnsdistdist/meson.build
pdns/recursordist/meson.build

index 839e4c7f443b4c39e31b5625fdcb28865be707b5..6ba273fca303790da2798786101cfdb604f2eb89 100755 (executable)
@@ -41,7 +41,7 @@ def main():
     sphinx_build = venv_directory.joinpath("bin").joinpath("sphinx-build")
 
     if args.pdf_name:
-        buildargs = [
+        build_args = [
             sphinx_build,
             "-M",
             "latexpdf",
@@ -49,7 +49,7 @@ def main():
             '.'
         ]
     else:
-        buildargs = [
+        build_args = [
             sphinx_build,
             "-b",
             "html",
@@ -57,7 +57,7 @@ def main():
             target_directory,
         ]
     subprocess.run(
-        buildargs + files, # default is to do all
+        build_args + files, # if files is empty, it means do all files
         check=True
     )
     if args.pdf_name:
index bd5ff45c3393f72348c41fb9837c15c45ebe85ba..65d453c14649617daa38747a197634d58009bc33 100644 (file)
@@ -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
index ddf86963d2225f5907d9a952edf5c8c4d1b8aa60..414fafded0ef4358ea28137df41e5b07f6ee059b 100644 (file)
@@ -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
\ No newline at end of file
index 7ddded830670f847d083748e1061be690a01e117..43f583e3fe9688481fff140c8a7ca35200c92357 100644 (file)
@@ -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