Skip to content

Commit 8454b42

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 07892da commit 8454b42

File tree

2 files changed

+73
-1
lines changed

2 files changed

+73
-1
lines changed

contrib/subtree/meson.build

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
git_subtree = custom_target(
2+
input: 'git-subtree.sh',
3+
output: 'git-subtree',
4+
command: [
5+
shell,
6+
meson.project_source_root() / 'generate-script.sh',
7+
'@INPUT@',
8+
'@OUTPUT@',
9+
meson.project_build_root() / 'GIT-BUILD-OPTIONS',
10+
],
11+
install: true,
12+
install_dir: get_option('libexecdir') / 'git-core',
13+
)
14+
15+
subtree_test_environment = test_environment
16+
subtree_test_environment.prepend('PATH', meson.current_build_dir())
17+
18+
test('t7900-subtree', shell,
19+
args: [ 't7900-subtree.sh' ],
20+
env: subtree_test_environment,
21+
workdir: meson.current_source_dir() / 't',
22+
depends: test_dependencies + bin_wrappers + [ git_subtree ],
23+
timeout: 0,
24+
)
25+
26+
if get_option('docs').contains('man')
27+
subtree_xml = custom_target(
28+
command: asciidoc_common_options + [
29+
'--backend=' + asciidoc_docbook,
30+
'--doctype=manpage',
31+
'--out-file=@OUTPUT@',
32+
'@INPUT@',
33+
],
34+
depends: documentation_deps,
35+
input: 'git-subtree.txt',
36+
output: 'git-subtree.xml',
37+
)
38+
39+
custom_target(
40+
command: [
41+
xmlto,
42+
'-m', '@INPUT@',
43+
'man',
44+
subtree_xml,
45+
'-o',
46+
meson.current_build_dir(),
47+
] + xmlto_extra,
48+
input: [
49+
'../../Documentation/manpage-normal.xsl',
50+
],
51+
output: 'git-subtree.1',
52+
install: true,
53+
install_dir: get_option('mandir') / 'man1',
54+
)
55+
endif
56+
57+
if get_option('docs').contains('html')
58+
custom_target(
59+
command: asciidoc_common_options + [
60+
'--backend=' + asciidoc_html,
61+
'--doctype=manpage',
62+
'--out-file=@OUTPUT@',
63+
'@INPUT@',
64+
],
65+
depends: documentation_deps,
66+
input: 'git-subtree.txt',
67+
output: 'git-subtree.html',
68+
install: true,
69+
install_dir: get_option('datadir') / 'doc/git-doc',
70+
)
71+
endif

meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,6 @@ endforeach
18571857
if intl.found()
18581858
subdir('po')
18591859
endif
1860-
subdir('contrib')
18611860

18621861
# Gitweb requires Perl, so we disable the auto-feature if Perl was not found.
18631862
# We make sure further up that Perl is required in case the gitweb option is
@@ -1884,6 +1883,8 @@ if get_option('docs') != []
18841883
subdir('Documentation')
18851884
endif
18861885

1886+
subdir('contrib')
1887+
18871888
foreach key, value : {
18881889
'DIFF': diff.full_path(),
18891890
'GIT_TEST_CMP': diff.full_path() + ' -u',

0 commit comments

Comments
 (0)