[gdk-pixbuf] meson: Generate documentation
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] meson: Generate documentation
- Date: Wed, 2 Aug 2017 11:00:49 +0000 (UTC)
commit d08ae184354dd6cb191f70425292639109d1a219
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Aug 2 11:30:59 2017 +0100
meson: Generate documentation
Both API reference and man pages.
docs/reference/gdk-pixbuf/meson.build | 85 +++++++++++++++++++++++++++++++++
meson.build | 4 +-
meson_options.txt | 4 ++
3 files changed, 90 insertions(+), 3 deletions(-)
---
diff --git a/docs/reference/gdk-pixbuf/meson.build b/docs/reference/gdk-pixbuf/meson.build
new file mode 100644
index 0000000..f974b60
--- /dev/null
+++ b/docs/reference/gdk-pixbuf/meson.build
@@ -0,0 +1,85 @@
+version_xml = configuration_data()
+version_xml.set('GDK_PIXBUF_VERSION', meson.project_version())
+configure_file(input: 'version.xml.in',
+ output: 'version.xml',
+ configuration: version_xml)
+
+glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
+glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
+docpath = join_paths(gdk_pixbuf_datadir, 'gtk-doc', 'html')
+
+private_headers = [
+ 'pixops',
+ 'gdk-pixbuf-alias.h',
+ 'gdk-pixbuf-marshal.h',
+ 'gdk-pixbuf-private.h',
+ 'gdk-pixbuf-xlib-private.h',
+ 'io-gif-animation.h',
+ 'io-ani-animation.h',
+ 'xpm-color-table.h',
+ 'test-images.h',
+]
+
+if get_option('with_docs')
+ gnome.gtkdoc('gdk-pixbuf',
+ main_xml: 'gdk-pixbuf.xml',
+ src_dir: [
+ join_paths(meson.source_root(), 'gdk-pixbuf'),
+ join_paths(meson.build_root(), 'gdk-pixbuf'),
+ ],
+ dependencies: gdk_pixbuf_deps,
+ gobject_typesfile: 'gdk-pixbuf.types',
+ scan_args: [
+ '--deprecated-guards="GDK_PIXBUF_ENABLE_BROKEN|GDK_PIXBUF_DISABLE_DEPRECATED"',
+ '--ignore-headers=' + ' '.join(private_headers),
+ ],
+ fixxref_args: [
+ '--html-dir=@0@'.format(docpath),
+ '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
+ '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
+ '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
+ ],
+ html_images: [
+ 'composite.png',
+ ],
+ content_files: [
+ 'gdk-pixbuf-from-drawables.xml',
+ 'gdk-pixbuf-rendering.xml',
+ 'gdk-pixbuf.xml',
+ 'gdk-pixbuf-csource.xml',
+ 'gdk-pixbuf-query-loaders.xml',
+ ],
+ install: true)
+endif
+
+xsltproc = find_program('xsltproc', required: false)
+if get_option('with_man') and xsltproc.found()
+ xlstproc_flags = [
+ '--nonet',
+ '--stringparam', 'man.output.quietly', '1',
+ '--stringparam', 'funcsynopsis.style', 'ansi',
+ '--stringparam', 'man.th.extra1.suppress', '1',
+ '--stringparam', 'man.authors.section.enabled', '0',
+ '--stringparam', 'man.copyright.section.enabled', '0',
+ ]
+
+ man_files = [
+ 'gdk-pixbuf-csource',
+ 'gdk-pixbuf-query-loaders',
+ ]
+
+ foreach m: man_files
+ custom_target(m + '-man',
+ input: '@0@.xml'.format(m),
+ output: '@0@.1'.format(m),
+ command: [
+ xsltproc,
+ xlstproc_flags,
+ '-o', '@OUTPUT@',
+ 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
+ '@INPUT@',
+ ],
+ install: true,
+ install_dir: join_paths(gdk_pixbuf_mandir, 'man1'))
+ endforeach
+endif
diff --git a/meson.build b/meson.build
index 7cdb4fc..f182340 100644
--- a/meson.build
+++ b/meson.build
@@ -290,6 +290,4 @@ subdir('po')
subdir('tests')
# Documentation
-#if get_option('with_docs')
-# subdir('docs/reference/gdk-pixbuf')
-#endif
+subdir('docs/reference/gdk-pixbuf')
diff --git a/meson_options.txt b/meson_options.txt
index b910c96..0006cd7 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -26,3 +26,7 @@ option('with_gir',
description: 'Whether to generate the API introspection data (requires GObject-Introspection)',
type: 'boolean',
value: true)
+option('with_man',
+ description: 'Whether to generate man pages (requires xlstproc)',
+ type: 'boolean',
+ value: true)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]