Git: Don't depend on Perl libs and Subversion when no Subversion support is built.

svn path=/nixpkgs/trunk/; revision=11877
This commit is contained in:
Ludovic Courtès 2008-05-22 08:06:52 +00:00
parent bd0df285fa
commit 392d2f5acf
2 changed files with 30 additions and 15 deletions

View File

@ -1,6 +1,12 @@
{ fetchurl, stdenv, curl, openssl, zlib, expat, perl, gettext, emacs, cpio
, asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_42
, libxslt, tcl, tk, makeWrapper, svnSupport, subversion, perlLibs }:
, libxslt, tcl, tk, makeWrapper
, svnSupport, subversion, perlLibs }:
# `git-svn' support requires Subversion and various Perl libraries.
# FIXME: We should make sure Subversion comes with its Perl bindings.
assert svnSupport -> (subversion != null && perlLibs != []);
stdenv.mkDerivation rec {
name = "git-1.5.5";
@ -33,6 +39,7 @@ stdenv.mkDerivation rec {
else
''echo "NOT installing Emacs mode. Set \`git.useEmacs' to \`true' in your"
echo "\`~/.nixpkgs/config.nix' file to change it." '')
+ (if svnSupport then
''# wrap git-svn
@ -41,10 +48,12 @@ stdenv.mkDerivation rec {
gitperllib=$gitperllib:$i/lib/site_perl
done
wrapProgram "$out/bin/git-svn" \
--set GITPERLLIB "$gitperllib" \
--set GITPERLLIB "$gitperllib" \
--prefix PATH : "${subversion}/bin" ''
else ''# rm git-svn
rm $out/bin/git-svn '' )
else ''
echo "NOT installing \`git-svn' since \`svnSupport' is false."
rm $out/bin/git-svn '')
+ ''# Install man pages and Info manual
make PERL_PATH="${perl}/bin/perl" cmd-list.made install install-info \
-C Documentation ''

View File

@ -5323,19 +5323,25 @@ let pkgs = rec {
inherit (gnome) gtk libgtkhtml libart_lgpl;
};
git = import ../applications/version-management/git {
inherit fetchurl stdenv curl openssl zlib expat perl gettext
asciidoc texinfo xmlto docbook2x
docbook_xsl docbook_xml_dtd_42 libxslt
cpio tcl tk makeWrapper;
git =
let svnSupport = getConfig [ "git" "svnSupport" ] false;
in
import ../applications/version-management/git {
inherit fetchurl stdenv curl openssl zlib expat perl gettext
asciidoc texinfo xmlto docbook2x
docbook_xsl docbook_xml_dtd_42 libxslt
cpio tcl tk makeWrapper;
# for git-svn support:
svnSupport = getConfig [ "git" "svnSupport" ] false;
inherit subversion ;
perlLibs = [ perlLWP perlURI perlTermReadKey subversion ];
# `git-svn' support
inherit svnSupport;
subversion = (if svnSupport then subversion else null) ;
perlLibs = (if svnSupport
then [ perlLWP perlURI perlTermReadKey subversion ]
else []);
emacs = if (getConfig ["git" "useEmacs"] true) then emacs else null;
};
# Emacs support
emacs = if (getConfig ["git" "useEmacs"] true) then emacs else null;
};
gkrellm = import ../applications/misc/gkrellm {
inherit fetchurl stdenv gettext pkgconfig;