[gexiv2/wip/phako/gi-docgen: 11/12] wip: Experimental gi-docgen support




commit d1a9d17586a88fabdea35eaf62548f7a71b41f3e
Author: Jens Georg <mail jensge org>
Date:   Sun May 16 11:08:18 2021 +0200

    wip: Experimental gi-docgen support

 docs/reference/meson.build | 42 ++++++++++++++++++++++++++++++++++--------
 meson.build                |  5 +++++
 subprojects/gi-docgen.wrap |  7 +++++++
 3 files changed, 46 insertions(+), 8 deletions(-)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 5ba90cd..399bf63 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -1,8 +1,34 @@
-subdir('xml')
-gnome.gtkdoc('gexiv2',
-             main_xml : 'gexiv2-docs.xml',
-             gobject_typesfile : 'gexiv2.types',
-             src_dir : ['gexiv2'],
-             ignore_headers: ['gexiv2-stream-io.h'],
-             dependencies : libgexiv2,
-             install : true)
+entities = configuration_data()
+entities.set('VERSION', meson.project_version())
+
+
+gidocgen = find_program('gi-docgen', required: true)
+
+gssdp_toml = configure_file (
+    input: 'gexiv2.toml.in',
+    output: 'gexiv2.toml',
+    configuration: entities
+)
+
+docs_dir = join_paths(get_option('prefix'), get_option('datadir')) / 'doc/gexiv2-0.10/reference'
+
+custom_target(
+    'gexiv2-doc',
+    input: gir[0],
+    output: 'GExiv2',
+    command : [
+        gidocgen,
+        'generate',
+        '--quiet',
+        '--add-include-path=@0@'.format(meson.current_build_dir() / '../libgssdp'),
+        '--config', gssdp_toml,
+        '--output-dir=@OUTPUT@',
+        '--no-namespace-dir',
+        '--content-dir=@0@'.format(meson.current_source_dir()),
+        '@INPUT@',
+    ],
+    depend_files : gssdp_toml,
+    build_by_default: true,
+    install: true,
+    install_dir : docs_dir,
+)
diff --git a/meson.build b/meson.build
index 28f8ad5..ff5e561 100644
--- a/meson.build
+++ b/meson.build
@@ -32,6 +32,11 @@ vapi_available = introspection_available and add_languages('vala', required: get
 
 subdir('gexiv2')
 
+gidocgen_dep = dependency('gi-docgen', version: '>= 2021.1',
+                          fallback: ['gi-docgen', 'dummy_dep'],
+                          required: get_option('gtk_doc') and get_option('introspection')
+                      )
+
 if get_option('gtk_doc')
   subdir('docs')
 endif
diff --git a/subprojects/gi-docgen.wrap b/subprojects/gi-docgen.wrap
new file mode 100644
index 0000000..fb001c2
--- /dev/null
+++ b/subprojects/gi-docgen.wrap
@@ -0,0 +1,7 @@
+[wrap-git]
+directory=gi-docgen
+url=https://gitlab.gnome.org/GNOME/gi-docgen.git
+push-url=ssh://git gitlab gnome org:GNOME/gi-docgen.git
+revision=main
+depth=1
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]