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