meson: wire up git-contacts(1)

Wire up the build for git-contacts(1) in Meson. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Feb 18, 2025 at 08:45 UTC e9e924e581c8b6d07ab6429eba4684e35c108666
2 files changed +56 -1
contrib/contacts/meson.build new
+55
@@ -0,0 +1,55 @@
1 +custom_target(
2 + input: 'git-contacts',
3 + output: 'git-contacts',
4 + command: generate_perl_command,
5 + depends: [git_version_file],
6 + install: true,
7 + install_dir: get_option('libexecdir') / 'git-core',
8 +)
9 +
10 +if get_option('docs').contains('man')
11 + contacts_xml = custom_target(
12 + command: asciidoc_common_options + [
13 + '--backend=' + asciidoc_docbook,
14 + '--doctype=manpage',
15 + '--out-file=@OUTPUT@',
16 + '@INPUT@',
17 + ],
18 + depends: documentation_deps,
19 + input: 'git-contacts.txt',
20 + output: 'git-contacts.xml',
21 + )
22 +
23 + custom_target(
24 + command: [
25 + xmlto,
26 + '-m', '@INPUT@',
27 + 'man',
28 + contacts_xml,
29 + '-o',
30 + meson.current_build_dir(),
31 + ] + xmlto_extra,
32 + input: [
33 + '../../Documentation/manpage-normal.xsl',
34 + ],
35 + output: 'git-contacts.1',
36 + install: true,
37 + install_dir: get_option('mandir') / 'man1',
38 + )
39 +endif
40 +
41 +if get_option('docs').contains('html')
42 + custom_target(
43 + command: asciidoc_common_options + [
44 + '--backend=' + asciidoc_html,
45 + '--doctype=manpage',
46 + '--out-file=@OUTPUT@',
47 + '@INPUT@',
48 + ],
49 + depends: documentation_deps,
50 + input: 'git-contacts.txt',
51 + output: 'git-contacts.html',
52 + install: true,
53 + install_dir: get_option('datadir') / 'doc/git-doc',
54 + )
55 +endif
meson_options.txt
+1 -1
@@ -27,7 +27,7 @@ option('version', type: 'string', value: '',
27 description: 'Version string reported by git-version(1) and other tools.')
28
29 # Features supported by Git.
30 -option('contrib', type: 'array', value: [ 'completion' ], choices: [ 'completion', 'subtree' ],
30 +option('contrib', type: 'array', value: [ 'completion' ], choices: [ 'completion', 'contacts', 'subtree' ],
31 description: 'Contributed features to include.')
32 option('credential_helpers', type: 'array', value: [ ], choices: [ 'libsecret', 'netrc', 'osxkeychain', 'wincred' ],
33 description: 'Contributed features to include.')