meson: wire up credential helpers

We've got a couple of credential helpers in "contrib/credential", all of which aren't yet wired up via Meson. Do so. Note that ideally, we'd also wire up t0303 to be executed with each of the credential helpers to verify their functionality. Unfortunately though, none of them pass the test suite right now, so this is left for a future change. 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 1cee22ebff9621c849afa8d766d7627b291ec9d0
8 files changed +51 -1
contrib/credential/libsecret/meson.build new
+9
@@ -0,0 +1,9 @@
1 +executable('git-credential-libsecret',
2 + sources: 'git-credential-libsecret.c',
3 + dependencies: [
4 + dependency('glib-2.0'),
5 + dependency('libsecret-1'),
6 + ],
7 + install: true,
8 + install_dir: get_option('libexecdir') / 'git-core',
9 +)
contrib/credential/meson.build new
+3
@@ -0,0 +1,3 @@
1 +foreach helper : get_option('credential_helpers')
2 + subdir(helper)
3 +endforeach
contrib/credential/netrc/meson.build new
+20
@@ -0,0 +1,20 @@
1 +credential_netrc = custom_target(
2 + input: 'git-credential-netrc.perl',
3 + output: 'git-credential-netrc',
4 + command: generate_perl_command,
5 + depends: [git_version_file],
6 + install: true,
7 + install_dir: get_option('libexecdir') / 'git-core',
8 +)
9 +
10 +credential_netrc_testenv = test_environment
11 +credential_netrc_testenv.set('CREDENTIAL_NETRC_PATH', credential_netrc.full_path())
12 +
13 +test('t-git-credential-netrc',
14 + shell,
15 + args: [ meson.current_source_dir() / 't-git-credential-netrc.sh' ],
16 + workdir: meson.current_source_dir(),
17 + env: credential_netrc_testenv,
18 + depends: test_dependencies + bin_wrappers + [credential_netrc],
19 + timeout: 0,
20 +)
contrib/credential/osxkeychain/meson.build new
+9
@@ -0,0 +1,9 @@
1 +executable('git-credential-osxkeychain',
2 + sources: 'git-credential-osxkeychain.c',
3 + dependencies: [
4 + dependency('CoreFoundation'),
5 + dependency('Security'),
6 + ],
7 + install: true,
8 + install_dir: get_option('libexecdir') / 'git-core',
9 +)
contrib/credential/wincred/meson.build new
+5
@@ -0,0 +1,5 @@
1 +executable('git-credential-wincred',
2 + sources: 'git-credential-wincred.c',
3 + install: true,
4 + install_dir: get_option('libexecdir') / 'git-core',
5 +)
contrib/meson.build
+2
@@ -1,3 +1,5 @@
1 foreach feature : get_option('contrib')
2 subdir(feature)
3 endforeach
4 +
5 +subdir('credential')
meson.build
+1 -1
@@ -771,7 +771,7 @@ endif
771 # features. It is optional if you want to neither execute tests nor use any of
772 # these optional features.
773 perl_required = get_option('perl')
774 -if get_option('tests') or get_option('gitweb').enabled()
774 +if get_option('tests') or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers')
775 perl_required = true
776 endif
777
meson_options.txt
+2
@@ -29,6 +29,8 @@ option('version', type: 'string', value: '',
29 # Features supported by Git.
30 option('contrib', type: 'array', value: [ 'completion' ], choices: [ 'completion', '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.')
34 option('curl', type: 'feature', value: 'enabled',
35 description: 'Build helpers used to access remotes with the HTTP transport.')
36 option('expat', type: 'feature', value: 'enabled',