gobject-introspection-1.70.0-build_fix-1.patch 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. Submitted By: Pierre Labastie <pierre dot labastie at neuf dot fr>
  2. Date: 2022-01-15
  3. Initial Package Version: 1.70.0
  4. Origin: Upstream
  5. Upstream Status: Committed
  6. Description: Fix building with meson-0.61+
  7. From effb1e09dee263cdac4ec593e8caf316e6f01fe2 Mon Sep 17 00:00:00 2001
  8. From: Emmanuele Bassi <ebassi@gnome.org>
  9. Date: Tue, 11 Jan 2022 15:51:10 +0000
  10. Subject: [PATCH] build: Avoid the doctemplates hack
  11. MIME-Version: 1.0
  12. Content-Type: text/plain; charset=UTF-8
  13. Content-Transfer-Encoding: 8bit
  14. The hack that copies the doctemplates directory into the build
  15. directory has stopped working with newer versions of Meson; while it's
  16. possible to copy files, custom_target() cannot depend on a directory.
  17. Additionally, the dependency has always been broken.
  18. Instead, we enumerate the template files—after all, it's not like they
  19. change a lot—and then we list them as dependencies for the test targets.
  20. Fixes: #414
  21. ---
  22. giscanner/doctemplates/devdocs/meson.build | 19 +++++++
  23. giscanner/doctemplates/mallard/meson.build | 63 ++++++++++++++++++++++
  24. giscanner/meson.build | 14 ++---
  25. tests/scanner/meson.build | 24 +++++----
  26. 4 files changed, 98 insertions(+), 22 deletions(-)
  27. create mode 100644 giscanner/doctemplates/devdocs/meson.build
  28. create mode 100644 giscanner/doctemplates/mallard/meson.build
  29. diff --git a/giscanner/doctemplates/devdocs/meson.build b/giscanner/doctemplates/devdocs/meson.build
  30. new file mode 100644
  31. index 00000000..2037182a
  32. --- /dev/null
  33. +++ b/giscanner/doctemplates/devdocs/meson.build
  34. @@ -0,0 +1,19 @@
  35. +doc_templates += files([
  36. + 'Gjs/_doc.tmpl',
  37. + 'Gjs/_index.tmpl',
  38. + 'Gjs/_method.tmpl',
  39. + 'Gjs/_methods.tmpl',
  40. + 'Gjs/_properties.tmpl',
  41. + 'Gjs/_signals.tmpl',
  42. + 'Gjs/_staticmethods.tmpl',
  43. + 'Gjs/_vfuncs.tmpl',
  44. + 'Gjs/base.tmpl',
  45. + 'Gjs/callback.tmpl',
  46. + 'Gjs/class.tmpl',
  47. + 'Gjs/default.tmpl',
  48. + 'Gjs/enum.tmpl',
  49. + 'Gjs/function.tmpl',
  50. + 'Gjs/interface.tmpl',
  51. + 'Gjs/method.tmpl',
  52. + 'Gjs/namespace.tmpl',
  53. +])
  54. diff --git a/giscanner/doctemplates/mallard/meson.build b/giscanner/doctemplates/mallard/meson.build
  55. new file mode 100644
  56. index 00000000..5fe4e2af
  57. --- /dev/null
  58. +++ b/giscanner/doctemplates/mallard/meson.build
  59. @@ -0,0 +1,63 @@
  60. +base_templates = files([
  61. + 'base.tmpl',
  62. + 'class.tmpl',
  63. + 'namespace.tmpl',
  64. +])
  65. +
  66. +c_templates = files([
  67. + 'C/callback.tmpl',
  68. + 'C/class.tmpl',
  69. + 'C/constructor.tmpl',
  70. + 'C/default.tmpl',
  71. + 'C/enum.tmpl',
  72. + 'C/field.tmpl',
  73. + 'C/function.tmpl',
  74. + 'C/interface.tmpl',
  75. + 'C/method.tmpl',
  76. + 'C/namespace.tmpl',
  77. + 'C/property.tmpl',
  78. + 'C/record.tmpl',
  79. + 'C/signal.tmpl',
  80. + 'C/vfunc.tmpl',
  81. +])
  82. +
  83. +gjs_templates = files([
  84. + 'Gjs/callback.tmpl',
  85. + 'Gjs/class.tmpl',
  86. + 'Gjs/constructor.tmpl',
  87. + 'Gjs/default.tmpl',
  88. + 'Gjs/enum.tmpl',
  89. + 'Gjs/field.tmpl',
  90. + 'Gjs/function.tmpl',
  91. + 'Gjs/interface.tmpl',
  92. + 'Gjs/method.tmpl',
  93. + 'Gjs/namespace.tmpl',
  94. + 'Gjs/property.tmpl',
  95. + 'Gjs/record.tmpl',
  96. + 'Gjs/signal.tmpl',
  97. + 'Gjs/vfunc.tmpl',
  98. +])
  99. +
  100. +py_templates = files([
  101. + 'Python/callback.tmpl',
  102. + 'Python/class.tmpl',
  103. + 'Python/constructor.tmpl',
  104. + 'Python/default.tmpl',
  105. + 'Python/enum.tmpl',
  106. + 'Python/field.tmpl',
  107. + 'Python/function.tmpl',
  108. + 'Python/interface.tmpl',
  109. + 'Python/method.tmpl',
  110. + 'Python/namespace.tmpl',
  111. + 'Python/property.tmpl',
  112. + 'Python/record.tmpl',
  113. + 'Python/signal.tmpl',
  114. + 'Python/vfunc.tmpl',
  115. +])
  116. +
  117. +doc_templates += [
  118. + base_templates,
  119. + c_templates,
  120. + gjs_templates,
  121. + py_templates,
  122. +]
  123. diff --git a/giscanner/meson.build b/giscanner/meson.build
  124. index 41edcd44..3d7dc678 100644
  125. --- a/giscanner/meson.build
  126. +++ b/giscanner/meson.build
  127. @@ -53,17 +53,9 @@ configure_file(input : '../girepository/gdump.c',
  128. install_subdir('doctemplates', install_dir: giscannerdir)
  129. -# XXX: this doesn't track the input, but there is nothing to copy many files
  130. -# in meson.
  131. -doc_templates = custom_target('copy-templates',
  132. - input : 'doctemplates',
  133. - output : 'doctemplates',
  134. - command : [
  135. - python, '-c',
  136. - 'import sys, shutil;' +
  137. - 'shutil.rmtree(sys.argv[2], ignore_errors=True);' +
  138. - 'shutil.copytree(sys.argv[1], sys.argv[2])',
  139. - '@INPUT@', '@OUTPUT@'])
  140. +doc_templates = []
  141. +subdir('doctemplates/devdocs')
  142. +subdir('doctemplates/mallard')
  143. flex = find_program('flex', 'win_flex')
  144. bison = find_program('bison', 'win_bison')
  145. diff --git a/tests/scanner/meson.build b/tests/scanner/meson.build
  146. index 5176b957..b81b3fd5 100644
  147. --- a/tests/scanner/meson.build
  148. +++ b/tests/scanner/meson.build
  149. @@ -525,19 +525,26 @@ foreach gir : test_girs
  150. endforeach
  151. if has_girdoctool and glib_dep.type_name() == 'pkgconfig'
  152. + doctool_env = environment()
  153. + doctool_env.set('srcdir', meson.current_source_dir())
  154. + doctool_env.set('builddir', meson.current_build_dir())
  155. +
  156. foreach language : ['C', 'Python', 'Gjs']
  157. regress_docs = custom_target(
  158. 'generate-docs-' + language,
  159. input: regress_gir,
  160. - depends: [doc_templates],
  161. + depend_files: doc_templates,
  162. build_by_default: not cairo_deps_found,
  163. + env: doctool_env,
  164. output: 'Regress-1.0-' + language,
  165. command: [
  166. python, girdoctool,
  167. '--add-include-path=' + join_paths(build_root, 'gir'),
  168. '--add-include-path=' + meson.current_build_dir(),
  169. '--language', language,
  170. - '@INPUT@', '-o', '@OUTPUT@'],
  171. + '--templates-dir=' + join_paths(meson.current_source_dir(), '../../giscanner/doctemplates'),
  172. + '@INPUT@', '-o', '@OUTPUT@',
  173. + ],
  174. )
  175. if cairo_deps_found
  176. @@ -546,10 +553,7 @@ if has_girdoctool and glib_dep.type_name() == 'pkgconfig'
  177. python,
  178. args: [gi_tester, 'Regress-1.0-' + language],
  179. depends: [regress_docs],
  180. - env: [
  181. - 'srcdir=' + meson.current_source_dir(),
  182. - 'builddir=' + meson.current_build_dir(),
  183. - ],
  184. + env: doctool_env,
  185. )
  186. endif
  187. endforeach
  188. @@ -557,9 +561,10 @@ if has_girdoctool and glib_dep.type_name() == 'pkgconfig'
  189. regress_sections = custom_target(
  190. 'generate-docs-sections',
  191. input: regress_gir,
  192. - depends: [doc_templates],
  193. + depend_files: [doc_templates],
  194. build_by_default: not cairo_deps_found,
  195. output: 'Regress-1.0-sections.txt',
  196. + env: doctool_env,
  197. command: [
  198. python, girdoctool,
  199. '--add-include-path=' + join_paths(build_root, 'gir'),
  200. @@ -574,10 +579,7 @@ if has_girdoctool and glib_dep.type_name() == 'pkgconfig'
  201. python,
  202. args: [gi_tester, 'Regress-1.0-sections.txt'],
  203. depends: [regress_sections],
  204. - env: [
  205. - 'srcdir=' + meson.current_source_dir(),
  206. - 'builddir=' + meson.current_build_dir(),
  207. - ],
  208. + env: doctool_env,
  209. )
  210. endif
  211. endif
  212. --
  213. GitLab