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

View file

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