Merge pull request #14207 from zimbatm/git-and-ssh

git: add openssh as a runtime dependency
This commit is contained in:
zimbatm 2016-03-30 10:23:55 +01:00
commit 0592eb377e
3 changed files with 37 additions and 2 deletions

View File

@ -8,7 +8,7 @@ let
gitBase = lib.makeOverridable (import ./git) {
inherit fetchurl stdenv curl openssl zlib expat perl python gettext gnugrep
asciidoc xmlto docbook2x docbook_xsl docbook_xml_dtd_45 libxslt cpio tcl
tk makeWrapper subversionClient gzip libiconv;
tk makeWrapper subversionClient gzip openssh libiconv;
texinfo = texinfo5;
svnSupport = false; # for git-svn support
guiSupport = false; # requires tcl/tk

View File

@ -1,4 +1,5 @@
{ fetchurl, stdenv, curl, openssl, zlib, expat, perl, python, gettext, cpio, gnugrep, gzip
{ fetchurl, stdenv, curl, openssl, zlib, expat, perl, python, gettext, cpio
, gnugrep, gzip, openssh
, asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_45
, libxslt, tcl, tk, makeWrapper, libiconv
, svnSupport, subversionClient, perlLibs, smtpPerlLibs
@ -25,8 +26,16 @@ stdenv.mkDerivation {
./docbook2texi.patch
./symlinks-in-bin.patch
./git-sh-i18n.patch
./ssh-path.patch
];
postPatch = ''
for x in connect.c git-gui/lib/remote_add.tcl ; do
substituteInPlace "$x" \
--subst-var-by ssh "${openssh}/bin/ssh"
done
'';
buildInputs = [curl openssl zlib expat gettext cpio makeWrapper libiconv]
++ stdenv.lib.optionals withManual [ asciidoc texinfo xmlto docbook2x
docbook_xsl docbook_xml_dtd_45 libxslt ]

View File

@ -0,0 +1,26 @@
diff --git a/connect.c b/connect.c
index fd7ffe1..20cd992 100644
--- a/connect.c
+++ b/connect.c
@@ -768,7 +768,7 @@ struct child_process *git_connect(int fd[2], const char *url,
ssh = getenv("GIT_SSH");
if (!ssh)
- ssh = "ssh";
+ ssh = "@ssh@";
ssh_dup = xstrdup(ssh);
base = basename(ssh_dup);
diff --git a/git-gui/lib/remote_add.tcl b/git-gui/lib/remote_add.tcl
index 50029d0..17b9594 100644
--- a/git-gui/lib/remote_add.tcl
+++ b/git-gui/lib/remote_add.tcl
@@ -139,7 +139,7 @@ method _add {} {
# Parse the location
if { [regexp {(?:git\+)?ssh://([^/]+)(/.+)} $location xx host path]
|| [regexp {([^:][^:]+):(.+)} $location xx host path]} {
- set ssh ssh
+ set ssh @ssh@
if {[info exists env(GIT_SSH)]} {
set ssh $env(GIT_SSH)
}