meson: properly wire up dependencies for our docs

A couple of Meson documentation targets use `meson.current_source_dir()` to resolve inputs. This has the downside that it does not automagically make Meson track these inputs as a dependency. After all, string arguments really can be anything, even if they happen to match an actual filesystem path. Adapt these build targets to instead use inputs. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Dec 27, 2024 at 14:59 UTC 2a8bd34c5576e02fed38d85dc5c90ffb9d4ecfb3
1 file changed +16 -10
Documentation/meson.build
+16 -10
@@ -229,7 +229,7 @@ if docs_backend == 'asciidoc'
229 '@INPUT@',
230 '@OUTPUT@',
231 ],
232 - input: meson.current_source_dir() / 'asciidoc.conf.in',
232 + input: 'asciidoc.conf.in',
233 output: 'asciidoc.conf',
234 depends: [git_version_file],
235 env: version_gen_environment,
@@ -261,7 +261,7 @@ elif docs_backend == 'asciidoctor'
261 '@INPUT@',
262 '@OUTPUT@',
263 ],
264 - input: meson.current_source_dir() / 'asciidoctor-extensions.rb.in',
264 + input: 'asciidoctor-extensions.rb.in',
265 output: 'asciidoctor-extensions.rb',
266 depends: [git_version_file],
267 env: version_gen_environment,
@@ -304,10 +304,11 @@ cmd_lists = [
304 documentation_deps += custom_target(
305 command: [
306 perl,
307 - meson.current_source_dir() / 'cmd-list.perl',
307 + '@INPUT@',
308 meson.project_source_root(),
309 meson.current_build_dir(),
310 ] + cmd_lists,
311 + input: 'cmd-list.perl',
312 output: cmd_lists
313 )
314
@@ -315,7 +316,7 @@ foreach mode : [ 'diff', 'merge' ]
316 documentation_deps += custom_target(
317 command: [
318 shell,
318 - meson.current_source_dir() / 'generate-mergetool-list.sh',
319 + '@INPUT@',
320 '..',
321 'diff',
322 '@OUTPUT@'
@@ -324,6 +325,7 @@ foreach mode : [ 'diff', 'merge' ]
325 'MERGE_TOOLS_DIR=' + meson.project_source_root() / 'mergetools',
326 'TOOL_MODE=' + mode,
327 ],
328 + input: 'generate-mergetool-list.sh',
329 output: 'mergetools-' + mode + '.txt',
330 )
331 endforeach
@@ -335,9 +337,10 @@ foreach manpage, category : manpages
337 '--backend=' + asciidoc_docbook,
338 '--doctype=manpage',
339 '--out-file=@OUTPUT@',
338 - meson.current_source_dir() / manpage,
340 + '@INPUT@',
341 ],
342 depends: documentation_deps,
343 + input: manpage,
344 output: fs.stem(manpage) + '.xml',
345 )
346
@@ -345,10 +348,8 @@ foreach manpage, category : manpages
348 manpage_target = custom_target(
349 command: [
350 xmlto,
348 - '-m',
349 - meson.current_source_dir() / 'manpage-normal.xsl',
350 - '-m',
351 - meson.current_source_dir() / 'manpage-bold-literal.xsl',
351 + '-m', '@INPUT0@',
352 + '-m', '@INPUT1@',
353 '--stringparam',
354 'man.base.url.for.relative.links=' + get_option('prefix') / get_option('mandir'),
355 'man',
@@ -356,6 +357,10 @@ foreach manpage, category : manpages
357 '-o',
358 meson.current_build_dir(),
359 ] + xmlto_extra,
360 + input: [
361 + 'manpage-normal.xsl',
362 + 'manpage-bold-literal.xsl',
363 + ],
364 output: manpage_path,
365 install: true,
366 install_dir: get_option('mandir') / 'man' + category.to_string(),
@@ -368,9 +373,10 @@ foreach manpage, category : manpages
373 '--backend=' + asciidoc_html,
374 '--doctype=manpage',
375 '--out-file=@OUTPUT@',
371 - meson.current_source_dir() / manpage,
376 + '@INPUT@',
377 ],
378 depends: documentation_deps,
379 + input: manpage,
380 output: fs.stem(manpage) + '.html',
381 install: true,
382 install_dir: get_option('datadir') / 'doc/git-doc',