aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/subtree/meson.build
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-01-17 10:56:07 +0100
committerJunio C Hamano <gitster@pobox.com>2025-01-17 09:56:38 -0800
commit8454b42f947e185a65b2950123493928558f2f5e (patch)
treea57b4736d8f653386f58254d3761b6f00268f42b /contrib/subtree/meson.build
parent07892da045c51eb97ad77aabe1ae4c34170ab3b4 (diff)
downloadgit-8454b42f947e185a65b2950123493928558f2f5e.tar.gz
meson: wire up the git-subtree(1) command
Wire up the git-subtree(1) command, which is part of "contrib/". Note that we have to move around the exact location where we include the "contrib/" subdirectory so that it comes after building the docs so that we have access to some of the common functionality. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/subtree/meson.build')
-rw-r--r--contrib/subtree/meson.build71
1 files changed, 71 insertions, 0 deletions
diff --git a/contrib/subtree/meson.build b/contrib/subtree/meson.build
new file mode 100644
index 0000000000..a752a188df
--- /dev/null
+++ b/contrib/subtree/meson.build
@@ -0,0 +1,71 @@
+git_subtree = custom_target(
+ input: 'git-subtree.sh',
+ output: 'git-subtree',
+ command: [
+ shell,
+ meson.project_source_root() / 'generate-script.sh',
+ '@INPUT@',
+ '@OUTPUT@',
+ meson.project_build_root() / 'GIT-BUILD-OPTIONS',
+ ],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
+
+subtree_test_environment = test_environment
+subtree_test_environment.prepend('PATH', meson.current_build_dir())
+
+test('t7900-subtree', shell,
+ args: [ 't7900-subtree.sh' ],
+ env: subtree_test_environment,
+ workdir: meson.current_source_dir() / 't',
+ depends: test_dependencies + bin_wrappers + [ git_subtree ],
+ timeout: 0,
+)
+
+if get_option('docs').contains('man')
+ subtree_xml = custom_target(
+ command: asciidoc_common_options + [
+ '--backend=' + asciidoc_docbook,
+ '--doctype=manpage',
+ '--out-file=@OUTPUT@',
+ '@INPUT@',
+ ],
+ depends: documentation_deps,
+ input: 'git-subtree.txt',
+ output: 'git-subtree.xml',
+ )
+
+ custom_target(
+ command: [
+ xmlto,
+ '-m', '@INPUT@',
+ 'man',
+ subtree_xml,
+ '-o',
+ meson.current_build_dir(),
+ ] + xmlto_extra,
+ input: [
+ '../../Documentation/manpage-normal.xsl',
+ ],
+ output: 'git-subtree.1',
+ install: true,
+ install_dir: get_option('mandir') / 'man1',
+ )
+endif
+
+if get_option('docs').contains('html')
+ custom_target(
+ command: asciidoc_common_options + [
+ '--backend=' + asciidoc_html,
+ '--doctype=manpage',
+ '--out-file=@OUTPUT@',
+ '@INPUT@',
+ ],
+ depends: documentation_deps,
+ input: 'git-subtree.txt',
+ output: 'git-subtree.html',
+ install: true,
+ install_dir: get_option('datadir') / 'doc/git-doc',
+ )
+endif