Improve git-svn support

svn path=/nixpkgs/trunk/; revision=20925
This commit is contained in:
Yury G. Kudryashov 2010-04-02 07:17:11 +00:00
parent 7531041ca4
commit 7af927d96b
2 changed files with 13 additions and 15 deletions

View File

@ -3,7 +3,8 @@
*/
args: with args; with pkgs;
let
inherit (pkgs) stdenv fetchurl getConfig subversion;
inherit (pkgs) stdenv fetchurl subversion;
config = getPkgConfig "git";
in
rec {
@ -12,9 +13,9 @@ rec {
asciidoc texinfo xmlto docbook2x
docbook_xsl docbook_xml_dtd_45 libxslt
cpio tcl tk makeWrapper subversion;
svnSupport = getConfig ["git" "svnSupport"] false; # for git-svn support
guiSupport = getConfig ["git" "guiSupport"] false;
perlLibs = [perlPackages.LWP perlPackages.URI perlPackages.TermReadKey subversion];
svnSupport = config "svnSupport" false; # for git-svn support
guiSupport = config "guiSupport" false;
perlLibs = [perlPackages.LWP perlPackages.URI perlPackages.TermReadKey];
};
# The full-featured Git.
@ -25,11 +26,7 @@ rec {
cpio tcl tk makeWrapper;
svnSupport = true;
guiSupport = true;
perlLibs = [perlPackages.LWP perlPackages.URI perlPackages.TermReadKey subversion];
# gitFull requires subversion with perlBindings enabled at least
subversion = pkgs.subversion.override {
perlBindings = true;
};
perlLibs = [perlPackages.LWP perlPackages.URI perlPackages.TermReadKey];
};
gitGit = import ./git/git-git.nix {
@ -37,8 +34,8 @@ rec {
asciidoc texinfo xmlto docbook2x
docbook_xsl docbook_xml_dtd_45 libxslt
cpio tcl tk makeWrapper subversion autoconf;
svnSupport = getConfig ["git" "svnSupport"] false; # for git-svn support
guiSupport = getConfig ["git" "guiSupport"] false;
svnSupport = config "svnSupport" false; # for git-svn support
guiSupport = config "guiSupport" false;
perlLibs = [perlPackages.LWP perlPackages.URI perlPackages.TermReadKey subversion];
};

View File

@ -6,8 +6,9 @@
, pythonSupport ? true
}:
# `git-svn' support requires Subversion and various Perl libraries.
assert svnSupport -> (subversion != null && perlLibs != [] && subversion.perlBindings);
let
svn = subversion.override { perlBindings = true; };
in
stdenv.mkDerivation rec {
name = "git-1.7.0.3";
@ -49,12 +50,12 @@ stdenv.mkDerivation rec {
''# wrap git-svn
gitperllib=$out/lib/perl5/site_perl
for i in ${builtins.toString perlLibs}; do
for i in ${builtins.toString perlLibs} ${svn}; do
gitperllib=$gitperllib:$i/lib/perl5/site_perl
done
wrapProgram "$out/libexec/git-core/git-svn" \
--set GITPERLLIB "$gitperllib" \
--prefix PATH : "${subversion}/bin" ''
--prefix PATH : "${svn}/bin" ''
else '' # replace git-svn by notification script
notSupported $out/bin/git-svn "reinstall with config git = { svnSupport = true } set"
'')