ports/devel/llvm/18/patches/patch-flang_docs_conf_py

27 lines
866 B
Text

Index: flang/docs/conf.py
--- flang/docs/conf.py.orig
+++ flang/docs/conf.py
@@ -22,12 +22,22 @@ from datetime import date
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
- "myst_parser",
"sphinx.ext.todo",
"sphinx.ext.mathjax",
"sphinx.ext.intersphinx",
"sphinx.ext.autodoc",
]
+
+# When building man pages, we do not use the markdown pages,
+# So, we can continue without the myst_parser dependencies.
+# Doing so reduces dependencies of some packaged llvm distributions.
+try:
+ import myst_parser
+
+ extensions.append("myst_parser")
+except ImportError:
+ if not tags.has("builder-man"):
+ raise
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]