aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-02-18 08:45:54 +0100
committerJunio C Hamano <gitster@pobox.com>2025-02-18 11:40:03 -0800
commit1cee22ebff9621c849afa8d766d7627b291ec9d0 (patch)
treea34f630b31f560c5f3d08df66511aecbeef16b2f
parent3f22889276ee75195f56bb3779ee8af5acbedbf0 (diff)
downloadgit-1cee22ebff9621c849afa8d766d7627b291ec9d0.tar.gz
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>
-rw-r--r--contrib/credential/libsecret/meson.build9
-rw-r--r--contrib/credential/meson.build3
-rw-r--r--contrib/credential/netrc/meson.build20
-rw-r--r--contrib/credential/osxkeychain/meson.build9
-rw-r--r--contrib/credential/wincred/meson.build5
-rw-r--r--contrib/meson.build2
-rw-r--r--meson.build2
-rw-r--r--meson_options.txt2
8 files changed, 51 insertions, 1 deletions
diff --git a/contrib/credential/libsecret/meson.build b/contrib/credential/libsecret/meson.build
new file mode 100644
index 0000000000..0137660fe0
--- /dev/null
+++ b/contrib/credential/libsecret/meson.build
@@ -0,0 +1,9 @@
+executable('git-credential-libsecret',
+ sources: 'git-credential-libsecret.c',
+ dependencies: [
+ dependency('glib-2.0'),
+ dependency('libsecret-1'),
+ ],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
diff --git a/contrib/credential/meson.build b/contrib/credential/meson.build
new file mode 100644
index 0000000000..4216296ae0
--- /dev/null
+++ b/contrib/credential/meson.build
@@ -0,0 +1,3 @@
+foreach helper : get_option('credential_helpers')
+ subdir(helper)
+endforeach
diff --git a/contrib/credential/netrc/meson.build b/contrib/credential/netrc/meson.build
new file mode 100644
index 0000000000..a990dbb86d
--- /dev/null
+++ b/contrib/credential/netrc/meson.build
@@ -0,0 +1,20 @@
+credential_netrc = custom_target(
+ input: 'git-credential-netrc.perl',
+ output: 'git-credential-netrc',
+ command: generate_perl_command,
+ depends: [git_version_file],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
+
+credential_netrc_testenv = test_environment
+credential_netrc_testenv.set('CREDENTIAL_NETRC_PATH', credential_netrc.full_path())
+
+test('t-git-credential-netrc',
+ shell,
+ args: [ meson.current_source_dir() / 't-git-credential-netrc.sh' ],
+ workdir: meson.current_source_dir(),
+ env: credential_netrc_testenv,
+ depends: test_dependencies + bin_wrappers + [credential_netrc],
+ timeout: 0,
+)
diff --git a/contrib/credential/osxkeychain/meson.build b/contrib/credential/osxkeychain/meson.build
new file mode 100644
index 0000000000..3c7677f736
--- /dev/null
+++ b/contrib/credential/osxkeychain/meson.build
@@ -0,0 +1,9 @@
+executable('git-credential-osxkeychain',
+ sources: 'git-credential-osxkeychain.c',
+ dependencies: [
+ dependency('CoreFoundation'),
+ dependency('Security'),
+ ],
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
diff --git a/contrib/credential/wincred/meson.build b/contrib/credential/wincred/meson.build
new file mode 100644
index 0000000000..6de23ca17d
--- /dev/null
+++ b/contrib/credential/wincred/meson.build
@@ -0,0 +1,5 @@
+executable('git-credential-wincred',
+ sources: 'git-credential-wincred.c',
+ install: true,
+ install_dir: get_option('libexecdir') / 'git-core',
+)
diff --git a/contrib/meson.build b/contrib/meson.build
index d74b64a518..569c23ee76 100644
--- a/contrib/meson.build
+++ b/contrib/meson.build
@@ -1,3 +1,5 @@
foreach feature : get_option('contrib')
subdir(feature)
endforeach
+
+subdir('credential')
diff --git a/meson.build b/meson.build
index d77d7b6b60..20159cef83 100644
--- a/meson.build
+++ b/meson.build
@@ -771,7 +771,7 @@ endif
# features. It is optional if you want to neither execute tests nor use any of
# these optional features.
perl_required = get_option('perl')
-if get_option('tests') or get_option('gitweb').enabled()
+if get_option('tests') or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers')
perl_required = true
endif
diff --git a/meson_options.txt b/meson_options.txt
index 5c12e9055e..0b0708dd0e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -29,6 +29,8 @@ option('version', type: 'string', value: '',
# Features supported by Git.
option('contrib', type: 'array', value: [ 'completion' ], choices: [ 'completion', 'subtree' ],
description: 'Contributed features to include.')
+option('credential_helpers', type: 'array', value: [ ], choices: [ 'libsecret', 'netrc', 'osxkeychain', 'wincred' ],
+ description: 'Contributed features to include.')
option('curl', type: 'feature', value: 'enabled',
description: 'Build helpers used to access remotes with the HTTP transport.')
option('expat', type: 'feature', value: 'enabled',