2008-06-11 12:31:44 +00:00
|
|
|
{ fetchurl, stdenv, curl, openssl, zlib, expat, perl, gettext, cpio
|
2008-03-11 14:07:58 +00:00
|
|
|
, asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_42
|
2008-05-22 08:06:52 +00:00
|
|
|
, libxslt, tcl, tk, makeWrapper
|
2008-06-11 12:31:44 +00:00
|
|
|
, svnSupport, subversion, perlLibs
|
|
|
|
, guiSupport
|
|
|
|
}:
|
2008-05-22 08:06:52 +00:00
|
|
|
|
|
|
|
# `git-svn' support requires Subversion and various Perl libraries.
|
2008-08-03 12:23:27 +00:00
|
|
|
assert svnSupport -> (subversion != null && perlLibs != [] && subversion.perlBindings);
|
2008-05-22 08:06:52 +00:00
|
|
|
|
2007-04-26 16:14:01 +00:00
|
|
|
|
2007-11-14 21:41:01 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2008-07-11 14:35:14 +00:00
|
|
|
name = "git-1.5.6.2";
|
2007-04-26 16:14:01 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2007-11-14 21:41:01 +00:00
|
|
|
url = "mirror://kernel/software/scm/git/${name}.tar.bz2";
|
2008-07-11 14:35:14 +00:00
|
|
|
sha256 = "0bq4rwa9kfn5z1daszb1qvqjzy1hk3ir392bpikhmsqp9hi5yc0j";
|
2007-04-26 16:14:01 +00:00
|
|
|
};
|
|
|
|
|
2008-03-30 22:19:20 +00:00
|
|
|
patches = [ ./pwd.patch ./docbook2texi.patch ];
|
2008-03-12 15:21:45 +00:00
|
|
|
|
2008-06-11 12:31:44 +00:00
|
|
|
buildInputs = [curl openssl zlib expat gettext cpio makeWrapper]
|
2008-03-11 14:07:58 +00:00
|
|
|
++ # documentation tools
|
|
|
|
[ asciidoc texinfo xmlto docbook2x
|
2008-03-15 20:52:21 +00:00
|
|
|
docbook_xsl docbook_xml_dtd_42 libxslt ]
|
2008-06-11 12:31:44 +00:00
|
|
|
++ stdenv.lib.optionals guiSupport [tcl tk];
|
2007-04-26 16:14:01 +00:00
|
|
|
|
2008-06-11 12:31:44 +00:00
|
|
|
makeFlags = "prefix=\${out} PERL_PATH=${perl}/bin/perl SHELL_PATH=${stdenv.shell}";
|
2007-11-14 21:41:01 +00:00
|
|
|
|
2008-02-22 16:51:51 +00:00
|
|
|
postInstall =
|
2008-06-11 12:31:44 +00:00
|
|
|
''
|
2008-07-03 12:51:23 +00:00
|
|
|
notSupported(){
|
|
|
|
echo -e "#\!/bin/sh\necho '`basename $1` not supported, $2'\nexit 1" > "$1"
|
|
|
|
chmod +x $1
|
|
|
|
}
|
|
|
|
|
2008-06-11 12:31:44 +00:00
|
|
|
# Install Emacs mode.
|
|
|
|
echo "installing Emacs mode..."
|
|
|
|
ensureDir $out/share/emacs/site-lisp
|
|
|
|
cp -p contrib/emacs/*.el $out/share/emacs/site-lisp
|
|
|
|
'' # */
|
2008-06-28 15:22:31 +00:00
|
|
|
|
2008-05-19 18:29:07 +00:00
|
|
|
+ (if svnSupport then
|
|
|
|
|
|
|
|
''# wrap git-svn
|
|
|
|
gitperllib=$out/lib/site_perl
|
|
|
|
for i in ${builtins.toString perlLibs}; do
|
|
|
|
gitperllib=$gitperllib:$i/lib/site_perl
|
|
|
|
done
|
2008-06-11 12:31:44 +00:00
|
|
|
wrapProgram "$out/bin/git-svn" \
|
|
|
|
--set GITPERLLIB "$gitperllib" \
|
|
|
|
--prefix PATH : "${subversion}/bin" ''
|
2008-07-03 12:51:23 +00:00
|
|
|
else '' # replace git-svn by notification script
|
|
|
|
notSupported $out/bin/git-svn "reinstall with config git = { svnSupport = true } set"
|
|
|
|
'')
|
2008-05-22 08:06:52 +00:00
|
|
|
|
2008-03-11 14:07:58 +00:00
|
|
|
+ ''# Install man pages and Info manual
|
|
|
|
make PERL_PATH="${perl}/bin/perl" cmd-list.made install install-info \
|
2008-03-15 20:52:21 +00:00
|
|
|
-C Documentation ''
|
|
|
|
|
2008-06-11 12:31:44 +00:00
|
|
|
+ (if guiSupport then ''
|
|
|
|
# Wrap Tcl/Tk programs
|
2008-04-15 12:37:44 +00:00
|
|
|
for prog in gitk git-gui git-citool
|
2008-04-12 12:52:31 +00:00
|
|
|
do
|
2008-06-11 12:31:44 +00:00
|
|
|
wrapProgram "$out/bin/$prog" \
|
|
|
|
--set TK_LIBRARY "${tk}/lib/tk8.4" \
|
|
|
|
--prefix PATH : "${tk}/bin"
|
|
|
|
done
|
2008-07-03 12:51:23 +00:00
|
|
|
'' else ''
|
|
|
|
# don not wrap Tcl/Tk, replace them by notification scripts
|
|
|
|
for prog in gitk git-gui git-citool
|
|
|
|
do
|
|
|
|
notSupported "$out/bin/$prog" "reinstall with config git = { guiSupport = true } set"
|
|
|
|
done
|
|
|
|
'')
|
2008-04-10 22:12:11 +00:00
|
|
|
|
2008-03-30 22:19:20 +00:00
|
|
|
+ ''# Wrap `git-clone'
|
2008-06-11 12:31:44 +00:00
|
|
|
wrapProgram $out/bin/git-clone \
|
2008-03-30 22:19:20 +00:00
|
|
|
--prefix PATH : "${cpio}/bin" '';
|
2008-02-20 10:29:32 +00:00
|
|
|
|
2007-11-14 21:41:01 +00:00
|
|
|
meta = {
|
2008-02-20 10:29:32 +00:00
|
|
|
license = "GPLv2";
|
|
|
|
homepage = http://git.or.cz;
|
2008-03-30 22:19:20 +00:00
|
|
|
description = "Git, a popular distributed version control system";
|
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Git, a popular distributed version control system designed to
|
|
|
|
handle very large projects with speed and efficiency.
|
|
|
|
'';
|
|
|
|
|
2007-11-14 21:41:01 +00:00
|
|
|
};
|
2007-04-26 16:14:01 +00:00
|
|
|
}
|