summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-07-14 11:50:43 -0400
committerDavid Robillard <d@drobilla.net>2022-07-18 20:18:28 -0400
commit55dc97a32eeeb42012ce1e7d28ed99ea537f4d2f (patch)
treec0fc78d78609c1bd3e880499bd0e80a4498b0be3 /doc
parent891f4044c92117517041c9e7ee4099b75bd493da (diff)
downloadlilv-55dc97a32eeeb42012ce1e7d28ed99ea537f4d2f.tar.gz
lilv-55dc97a32eeeb42012ce1e7d28ed99ea537f4d2f.tar.bz2
lilv-55dc97a32eeeb42012ce1e7d28ed99ea537f4d2f.zip
Switch to meson build system
Diffstat (limited to 'doc')
-rw-r--r--doc/c/Doxyfile.in (renamed from doc/c/Doxyfile)6
-rw-r--r--doc/c/api/meson.build6
-rw-r--r--doc/c/meson.build47
-rw-r--r--doc/c/wscript43
-rw-r--r--doc/c/xml/meson.build18
-rw-r--r--doc/meson.build19
6 files changed, 94 insertions, 45 deletions
diff --git a/doc/c/Doxyfile b/doc/c/Doxyfile.in
index ce10524..70abb39 100644
--- a/doc/c/Doxyfile
+++ b/doc/c/Doxyfile.in
@@ -21,6 +21,8 @@ SHOW_FILES = NO
MACRO_EXPANSION = YES
PREDEFINED = LILV_API LILV_DEPRECATED
-INPUT = ../../include/lilv/lilv.h
+RECURSIVE = YES
+STRIP_FROM_PATH = @LILV_SRCDIR@
+INPUT = @LILV_SRCDIR@/include
-OUTPUT_DIRECTORY = .
+OUTPUT_DIRECTORY = @DOX_OUTPUT@
diff --git a/doc/c/api/meson.build b/doc/c/api/meson.build
new file mode 100644
index 0000000..4717825
--- /dev/null
+++ b/doc/c/api/meson.build
@@ -0,0 +1,6 @@
+c_lilv_rst = custom_target(
+ 'lilv.rst',
+ command: [dox_to_sphinx, '-f', '@INPUT0@', '@OUTDIR@'],
+ input: [c_index_xml] + c_rst_files,
+ output: 'lilv.rst',
+)
diff --git a/doc/c/meson.build b/doc/c/meson.build
new file mode 100644
index 0000000..f75dc74
--- /dev/null
+++ b/doc/c/meson.build
@@ -0,0 +1,47 @@
+config = configuration_data()
+config.set('LILV_VERSION', meson.project_version())
+
+conf_py = configure_file(configuration: config,
+ input: files('../conf.py.in'),
+ output: 'conf.py')
+
+configure_file(copy: true,
+ input: files('../summary.rst'),
+ output: 'summary.rst')
+
+c_rst_files = files(
+ 'index.rst',
+ 'overview.rst',
+ 'plugins.rst',
+ 'uis.rst',
+ 'world.rst',
+)
+
+foreach f : c_rst_files
+ configure_file(copy: true, input: f, output: '@PLAINNAME@')
+endforeach
+
+subdir('xml')
+subdir('api')
+
+docs = custom_target(
+ 'singlehtml',
+ build_by_default: true,
+ command: [sphinx_build, '-M', 'singlehtml', '@OUTDIR@', '@OUTDIR@',
+ '-E', '-q', '-t', 'singlehtml'],
+ input: [c_rst_files, c_lilv_rst, c_index_xml],
+ install: true,
+ install_dir: docdir / 'lilv-0',
+ output: 'singlehtml',
+)
+
+docs = custom_target(
+ 'html',
+ build_by_default: true,
+ command: [sphinx_build, '-M', 'html', '@OUTDIR@', '@OUTDIR@',
+ '-E', '-q', '-t', 'html'],
+ input: [c_rst_files, c_lilv_rst, c_index_xml],
+ install: true,
+ install_dir: docdir / 'lilv-0',
+ output: 'html',
+)
diff --git a/doc/c/wscript b/doc/c/wscript
deleted file mode 100644
index d515ddf..0000000
--- a/doc/c/wscript
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-
-def build(bld):
- dox_to_sphinx = bld.path.find_node("../../scripts/dox_to_sphinx.py")
- index_xml = bld.path.get_bld().make_node("xml/index.xml")
-
- files = [
- ("../summary.rst", "sphinx/summary.rst"),
- ("index.rst", "sphinx/index.rst"),
- ("overview.rst", "sphinx/overview.rst"),
- ("plugins.rst", "sphinx/plugins.rst"),
- ("uis.rst", "sphinx/uis.rst"),
- ("world.rst", "sphinx/world.rst"),
- ]
-
- # Run Doxygen to generate XML documentation
- bld(features="doxygen", doxyfile="Doxyfile")
-
- # Substitute variables to make Sphinx configuration file
- bld(features="subst",
- source="../conf.py.in",
- target="sphinx/conf.py",
- LILV_VERSION=bld.env.LILV_VERSION)
-
- # Copy static documentation files to Sphinx build directory
- for f in files:
- bld(features="subst", is_copy=True, source=f[0], target=f[1])
-
- # Generate Sphinx markup from Doxygen XML
- bld.add_group()
- bld(rule="${PYTHON} " + dox_to_sphinx.abspath() + " -f ${SRC} ${TGT}",
- source=index_xml,
- target="sphinx/api/")
-
- doc_dir = bld.env.DOCDIR + "/lilv-%s/" % bld.env.LILV_MAJOR_VERSION
-
- # Run Sphinx to generate HTML documentation
- for builder in ["html", "singlehtml"]:
- bld(features="sphinx",
- sphinx_source=bld.path.get_bld().make_node("sphinx"),
- sphinx_output_format=builder,
- sphinx_options=["-E", "-q", "-t", builder],
- install_path=doc_dir + "c/%s/" % builder)
diff --git a/doc/c/xml/meson.build b/doc/c/xml/meson.build
new file mode 100644
index 0000000..6de27f9
--- /dev/null
+++ b/doc/c/xml/meson.build
@@ -0,0 +1,18 @@
+doxygen = find_program('doxygen')
+
+config = configuration_data()
+config.set('LILV_SRCDIR', lilv_src_root)
+config.set('DOX_OUTPUT', meson.current_build_dir() / '..')
+
+c_doxyfile = configure_file(
+ configuration: config,
+ input: files('../Doxyfile.in'),
+ output: 'Doxyfile',
+)
+
+c_index_xml = custom_target(
+ 'index.xml',
+ command: [doxygen, '@INPUT0@'],
+ input: [c_doxyfile] + c_headers,
+ output: 'index.xml',
+)
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 0000000..efa9d71
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,19 @@
+# Copyright 2021-2022 David Robillard <d@drobilla.net>
+# SPDX-License-Identifier: CC0-1.0 OR ISC
+
+docdir = get_option('datadir') / 'doc'
+
+doxygen = find_program('doxygen', required: get_option('docs'))
+dox_to_sphinx = files('../scripts/dox_to_sphinx.py')
+sphinx_build = find_program('sphinx-build', required: get_option('docs'))
+
+build_docs = doxygen.found() and sphinx_build.found()
+
+if build_docs
+ subdir('c')
+endif
+
+if not meson.is_subproject()
+ summary('Documentation', build_docs, bool_yn: true)
+endif
+