0003-meson-wrap-html-documentation-generation-with-gtk_do.patch 3.0 KB

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