2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 09:57:41 +00:00
kea/doc/sphinx/meson.build

156 lines
4.4 KiB
Meson
Raw Normal View History

if not PYTHON.found()
2025-02-18 15:54:20 +01:00
subdir_done()
endif
current_build_dir = meson.current_build_dir()
current_source_dir = meson.current_source_dir()
sphinxbuilddir = './_build'
abs_sphinxbuilddir = current_build_dir / '_build'
2025-02-18 15:54:20 +01:00
sphinxopts = ['-v', '-E', '-a', '-W', f'-c @current_source_dir@']
static_sources = [
'static/kea-imageonly-100bw.png',
'static/kea-logo-100x70.png',
'static/kea-logo-200.png',
'static/kea.css',
]
# ARM
rst_arm_sources = [
'index.rst',
'manpages.rst',
'umls.rst',
'debug-messages.rst',
'kea-messages.rst',
]
list = run_command(GRABBER, current_source_dir / 'arm', '*.rst', check: true)
2025-02-18 15:54:20 +01:00
rst_arm_sources += list.stdout().strip().split('\n')
list = run_command(GRABBER, current_source_dir / 'grammar', '*.rst', check: true)
rst_arm_sources += list.stdout().strip().split('\n')
2025-02-18 15:54:20 +01:00
main_sources = rst_arm_sources + ['conf.py'] + static_sources
# mans
list = run_command(GRABBER, current_source_dir / 'man', '*.rst', check: true)
2025-02-18 15:54:20 +01:00
rst_man_sources = list.stdout().strip().split('\n')
man8s = []
foreach file : rst_man_sources
man8 = file.replace('.rst', '')
man8s += [man8]
endforeach
man_sources = rst_man_sources + ['conf.py']
api_dir = TOP_SOURCE_DIR / 'src/share/api'
list = run_command(GRABBER, api_dir, '*.json', check: true)
2025-02-18 15:54:20 +01:00
api_files = list.stdout().strip().split('\n')
list = run_command(GRABBER, TOP_SOURCE_DIR, '*.mes', check: true)
2025-02-18 15:54:20 +01:00
mes_files = list.stdout().strip().split('\n')
list = run_command(GRABBER, current_source_dir / 'uml', '*.uml', check: true)
2025-02-18 15:54:20 +01:00
umls = list.stdout().strip().split('\n')
list = run_command(GRABBER, current_source_dir / 'uml', '*.png', check: true)
2025-02-18 15:54:20 +01:00
pngs = list.stdout().strip().split('\n')
list = run_command(GRABBER, current_source_dir / 'uml', '*.svg', check: true)
2025-02-18 15:54:20 +01:00
svgs = list.stdout().strip().split('\n')
list = run_command(GRABBER, current_source_dir / 'uml', '*.atxt', check: true)
2025-02-18 15:54:20 +01:00
txts = list.stdout().strip().split('\n')
2025-03-11 10:58:45 +02:00
doc_conf = configuration_data()
doc_conf.set('builddir', meson.current_build_dir())
doc_conf.set('srcdir', meson.current_source_dir())
doc_conf.set('sphinxbuilddir', sphinxbuilddir)
doc_conf.set('abs_sphinxbuilddir', abs_sphinxbuilddir)
doc_conf.set('PYTHON', PYTHON.full_path())
doc_conf.set('TOP_SOURCE_DIR', TOP_SOURCE_DIR)
if PDFLATEX.found()
2025-03-11 10:58:45 +02:00
doc_conf.set('HAVE_PDFLATEX', 'yes')
pdflatex = PDFLATEX.full_path()
2025-02-18 15:54:20 +01:00
else
2025-03-11 10:58:45 +02:00
doc_conf.set('HAVE_PDFLATEX', 'no')
2025-02-18 15:54:20 +01:00
pdflatex = 'false'
endif
2025-03-11 10:58:45 +02:00
doc_conf.set('PDFLATEX_AND_OPTS', pdflatex + ' -interaction nonstopmode')
if SPHINX.found()
2025-03-11 10:58:45 +02:00
doc_conf.set('SPHINXBUILD', SPHINX.full_path())
else
2025-03-11 10:58:45 +02:00
doc_conf.set('SPHINXBUILD', 'false')
endif
2025-03-11 10:58:45 +02:00
doc_conf.set('sphinxopts', ' '.join(sphinxopts))
if PLANTUML.found()
2025-03-11 10:58:45 +02:00
doc_conf.set('HAVE_PLANTUML', 'yes')
doc_conf.set('PLANTUML', PLANTUML.full_path())
2025-02-18 15:54:20 +01:00
else
2025-03-11 10:58:45 +02:00
doc_conf.set('HAVE_PLANTUML', 'no')
doc_conf.set('PLANTUML', 'false')
2025-02-18 15:54:20 +01:00
endif
2025-03-11 10:58:45 +02:00
doc_conf.set('umls', ' '.join(umls))
doc_conf.set('svgs', ' '.join(svgs))
if XMLLINT.found()
2025-03-11 10:58:45 +02:00
doc_conf.set('HAVE_XMLLINT', 'yes')
2025-02-18 15:54:20 +01:00
else
2025-03-11 10:58:45 +02:00
doc_conf.set('HAVE_XMLLINT', 'no')
2025-02-18 15:54:20 +01:00
endif
2025-06-20 11:20:03 +03:00
tumls = ['tkey.uml', 'update.uml']
2025-03-11 10:58:45 +02:00
doc_conf.set('tumls', ' '.join(tumls))
doc_conf.set('txts', ' '.join(txts))
if PIP_COMPILE.found()
2025-03-11 10:58:45 +02:00
doc_conf.set('HAVE_PIP_COMPILE', 'yes')
doc_conf.set('PIP_COMPILE', PIP_COMPILE.full_path())
2025-02-18 15:54:20 +01:00
else
2025-03-11 10:58:45 +02:00
doc_conf.set('HAVE_PIP_COMPILE', 'no')
doc_conf.set('PIP_COMPILE', 'pip-compile')
2025-02-18 15:54:20 +01:00
endif
2025-03-11 10:58:45 +02:00
doc_conf.set('man8s', ' '.join(man8s))
doc_conf.set('PREFIX', PREFIX)
docdir = DATADIR / 'doc/kea'
2025-03-11 10:58:45 +02:00
doc_conf.set('docdir', docdir)
doc_conf.set('INSTALL', INSTALL.full_path())
mandir8 = MANDIR / 'man8'
2025-03-11 10:58:45 +02:00
doc_conf.set('mandir8', mandir8)
2025-02-18 15:54:20 +01:00
2025-03-11 10:58:45 +02:00
make_doc = configure_file(
input: 'make-doc.sh.in',
output: 'make-doc.sh',
configuration: doc_conf,
)
2025-03-12 14:37:40 +02:00
install_docs = configure_file(
2025-03-11 10:58:45 +02:00
input: 'install-docs.sh.in',
output: 'install-docs.sh',
configuration: doc_conf,
2025-02-18 15:54:20 +01:00
)
make_mes_doc = configure_file(
input: 'make-mes-doc.sh.in',
output: 'make-mes-doc.sh',
2025-03-11 10:58:45 +02:00
configuration: doc_conf,
)
make_uml = configure_file(
input: 'make-uml.sh.in',
output: 'make-uml.sh',
2025-03-11 10:58:45 +02:00
configuration: doc_conf,
)
make_update_python_dependencies = configure_file(
2025-03-11 10:58:45 +02:00
input: 'update-python-dependencies.sh.in',
output: 'update-python-dependencies.sh',
configuration: doc_conf,
)
2025-03-11 10:58:45 +02:00
run_target('doc', command: [make_doc])
2025-02-21 14:47:24 +01:00
run_target('mes-doc', command: [make_mes_doc])
run_target('uml', command: [make_uml])
run_target(
'update-python-dependencies',
command: [make_update_python_dependencies],
)
2025-03-11 10:58:45 +02:00
2025-03-12 14:37:40 +02:00
meson.add_install_script(install_docs)