Skip to content

Commit 1cee22e

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

File tree

8 files changed

+51
-1
lines changed

8 files changed

+51
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
foreach helper : get_option('credential_helpers')
2+
subdir(helper)
3+
endforeach

contrib/credential/netrc/meson.build

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
foreach feature : get_option('contrib')
22
subdir(feature)
33
endforeach
4+
5+
subdir('credential')

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ endif
771771
# features. It is optional if you want to neither execute tests nor use any of
772772
# these optional features.
773773
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')
775775
perl_required = true
776776
endif
777777

meson_options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ option('version', type: 'string', value: '',
2929
# Features supported by Git.
3030
option('contrib', type: 'array', value: [ 'completion' ], choices: [ 'completion', 'subtree' ],
3131
description: 'Contributed features to include.')
32+
option('credential_helpers', type: 'array', value: [ ], choices: [ 'libsecret', 'netrc', 'osxkeychain', 'wincred' ],
33+
description: 'Contributed features to include.')
3234
option('curl', type: 'feature', value: 'enabled',
3335
description: 'Build helpers used to access remotes with the HTTP transport.')
3436
option('expat', type: 'feature', value: 'enabled',

0 commit comments

Comments
 (0)