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