1From 0fa17ec3c7152cf0e1cbf965acf1426ac203bb1d Mon Sep 17 00:00:00 2001
2From: James Knight <james.d.knight@live.com>
3Date: Thu, 27 Apr 2023 20:23:30 -0400
4Subject: [PATCH] meson: wrap html documentation generation with gtk_doc option
5
6By default, if a host environment has the `rst2html5` application
7available, builds will automatically perform some HTML documentation
8generation from the documentation's glib reference content (e.g.
9creating `gvariant-specification-1.0.html`). The creation of this
10documentation is not required for all use cases.
11
12This commit tweaks the building of the HTML-based GLIB specification
13document to be guarded by `gtk_doc`.
14
15Signed-off-by: James Knight <james.d.knight@live.com>
16Upstream: https://gitlab.gnome.org/GNOME/glib/-/commit/0fa17ec3c7152cf0e1cbf965acf1426ac203bb1d
17[yann.morin.1998@free.fr: backport from upstream]
18Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
19---
20 docs/reference/glib/meson.build | 58 +++++++++++++++++----------------
21 1 file changed, 30 insertions(+), 28 deletions(-)
22
23diff --git a/docs/reference/glib/meson.build b/docs/reference/glib/meson.build
24index 114de49da..3cfff2f0b 100644
25--- a/docs/reference/glib/meson.build
26+++ b/docs/reference/glib/meson.build
27@@ -113,35 +113,37 @@ if get_option('man')
28   endforeach
29 endif
30
31-# GVariant specification is currently standalone
32-rst2html5 = find_program('rst2html5', 'rst2html5.py', required: false)
33+if get_option('gtk_doc')
34+  # GVariant specification is currently standalone
35+  rst2html5 = find_program('rst2html5', 'rst2html5.py', required: false)
36
37-if rst2html5.found()
38-  spec_path = glib_datadir / 'doc' / 'glib-2.0'
39+  if rst2html5.found()
40+    spec_path = glib_datadir / 'doc' / 'glib-2.0'
41
42-  figures = files(
43-    'gvariant-byte-boundaries.svg',
44-    'gvariant-integer-and-string-structure.svg',
45-    'gvariant-integer-array.svg',
46-    'gvariant-string-array.svg',
47-  )
48+    figures = files(
49+      'gvariant-byte-boundaries.svg',
50+      'gvariant-integer-and-string-structure.svg',
51+      'gvariant-integer-array.svg',
52+      'gvariant-string-array.svg',
53+    )
54
55-  custom_target('gvariant-specification-1.0',
56-    input: 'gvariant-specification-1.0.rst',
57-    output: 'gvariant-specification-1.0.html',
58-    command: [
59-      rst2html5,
60-      '@INPUT@',
61-    ],
62-    capture: true,
63-    install: true,
64-    install_dir: spec_path,
65-    install_tag: 'doc',
66-    depend_files: figures,
67-  )
68+    custom_target('gvariant-specification-1.0',
69+      input: 'gvariant-specification-1.0.rst',
70+      output: 'gvariant-specification-1.0.html',
71+      command: [
72+        rst2html5,
73+        '@INPUT@',
74+      ],
75+      capture: true,
76+      install: true,
77+      install_dir: spec_path,
78+      install_tag: 'doc',
79+      depend_files: figures,
80+    )
81
82-  install_data(figures,
83-    install_dir : spec_path,
84-    install_tag : 'doc',
85-  )
86-endif
87\ No newline at end of file
88+    install_data(figures,
89+      install_dir : spec_path,
90+      install_tag : 'doc',
91+    )
92+  endif
93+endif
94--
952.25.1
96
97