summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2021-08-30 13:11:42 +0200
committerBastien Nocera <hadess@hadess.net>2021-09-02 17:47:30 +0200
commitf2e702d4dc22a04e6b660c63e77c93f269fb3818 (patch)
tree94bf38696e2342c163ecf629fb68808cee483011 /doc
parent46ed29945125c241fe9a103e8b4f565472d453ef (diff)
downloadupower-f2e702d4dc22a04e6b660c63e77c93f269fb3818.tar.gz
build: Support building upower with meson
Diffstat (limited to 'doc')
-rw-r--r--doc/man/meson.build18
-rw-r--r--doc/meson.build46
2 files changed, 64 insertions, 0 deletions
diff --git a/doc/man/meson.build b/doc/man/meson.build
new file mode 100644
index 0000000..bd1408d
--- /dev/null
+++ b/doc/man/meson.build
@@ -0,0 +1,18 @@
+
+man_pages = [
+ [ 'upower', 1 ],
+ [ 'upowerd', 8 ],
+ [ 'UPower', 7 ],
+]
+
+foreach man: man_pages
+ custom_target(
+ '@0@.@1@'.format(man[0], man[1]),
+ input: files(join_paths(man[0] + '.xml')),
+ output: '@0@.@1@'.format(man[0], man[1]),
+ command: [xsltproc, '--output', '@OUTPUT@', '-nonet', 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl', '@INPUT@'],
+ build_by_default: get_option('man'),
+ install: get_option('man'),
+ install_dir: get_option('prefix') / get_option('mandir') / 'man@0@'.format(man[1]),
+ )
+endforeach
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 0000000..636ef8f
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,46 @@
+subdir('man')
+
+ifaces_refs = []
+
+dbus_dir = join_paths(meson.source_root(), 'dbus')
+spec_to_docbook = files('spec-to-docbook.xsl')
+
+foreach iface: upowerd_dbus_interfaces
+ iface = iface[1]
+ iface_ref = iface + '.ref.xml'
+
+ ifaces_refs += custom_target(
+ iface_ref,
+ input: files(dbus_dir / iface + '.xml'),
+ output: iface_ref,
+ command: [xsltproc, '--output', '@OUTPUT@', spec_to_docbook, '@INPUT@'],
+ # XXX: This appears to be needed so that "ninja -C _build install" works
+ build_by_default: get_option('gtk-doc'),
+ )
+endforeach
+
+cdata = configuration_data()
+cdata.set('VERSION', meson.project_version())
+version_xml = configure_file(
+ output: 'version.xml',
+ input: 'version.xml.in',
+ configuration: cdata)
+
+gnome.gtkdoc('UPower',
+ main_xml: 'upower-docs.xml',
+ src_dir: meson.source_root() / 'libupower-glib',
+ dependencies: [ libupower_glib_dep ],
+ scan_args: ['--rebuild-types', '--rebuild-sections'],
+ content_files: [
+ version_xml,
+ ifaces_refs,
+ 'man/UPower.xml',
+ 'man/upowerd.xml',
+ 'man/upower.xml',
+ '../COPYING',
+ ],
+ ignore_headers: [
+ 'config.h',
+ ],
+ install: get_option('gtk-doc')
+)