2010-09-18 14:45:04 +02:00
|
|
|
{ fetchurl, stdenv, curl, openssl, zlib, expat, perl, python, gettext, cpio, gnugrep
|
2009-11-03 16:57:31 +01:00
|
|
|
, asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_45
|
2008-05-22 10:06:52 +02:00
|
|
|
, libxslt, tcl, tk, makeWrapper
|
2010-05-15 12:38:28 +02:00
|
|
|
, svnSupport, subversion, perlLibs, smtpPerlLibs
|
2008-06-11 14:31:44 +02:00
|
|
|
, guiSupport
|
2010-03-13 07:07:44 +01:00
|
|
|
, pythonSupport ? true
|
2010-05-15 12:38:28 +02:00
|
|
|
, sendEmailSupport
|
2008-06-11 14:31:44 +02:00
|
|
|
}:
|
2008-05-22 10:06:52 +02:00
|
|
|
|
2010-04-02 09:17:11 +02:00
|
|
|
let
|
|
|
|
svn = subversion.override { perlBindings = true; };
|
|
|
|
in
|
2008-05-22 10:06:52 +02:00
|
|
|
|
2007-11-14 22:41:01 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2011-07-08 01:48:34 +02:00
|
|
|
name = "git-1.7.6";
|
2007-04-26 18:14:01 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2007-11-14 22:41:01 +01:00
|
|
|
url = "mirror://kernel/software/scm/git/${name}.tar.bz2";
|
2011-07-08 01:48:34 +02:00
|
|
|
sha256 = "778795cece63cd758192378f3a999870cea290181b3a4c9de573c77192561082";
|
2007-04-26 18:14:01 +02:00
|
|
|
};
|
|
|
|
|
2009-12-12 19:10:26 +01:00
|
|
|
patches = [ ./docbook2texi.patch ];
|
2008-03-12 16:21:45 +01:00
|
|
|
|
2008-06-11 14:31:44 +02:00
|
|
|
buildInputs = [curl openssl zlib expat gettext cpio makeWrapper]
|
2008-03-11 15:07:58 +01:00
|
|
|
++ # documentation tools
|
|
|
|
[ asciidoc texinfo xmlto docbook2x
|
2009-11-03 16:57:31 +01:00
|
|
|
docbook_xsl docbook_xml_dtd_45 libxslt ]
|
2008-06-11 14:31:44 +02:00
|
|
|
++ stdenv.lib.optionals guiSupport [tcl tk];
|
2007-04-26 18:14:01 +02:00
|
|
|
|
2010-03-13 07:07:44 +01:00
|
|
|
makeFlags = "prefix=\${out} PERL_PATH=${perl}/bin/perl SHELL_PATH=${stdenv.shell} "
|
|
|
|
+ (if pythonSupport then "PYTHON_PATH=${python}/bin/python" else "NO_PYTHON=1");
|
2007-11-14 22:41:01 +01:00
|
|
|
|
2008-08-22 23:35:25 +02:00
|
|
|
# FIXME: "make check" requires Sparse; the Makefile must be tweaked
|
|
|
|
# so that `SPARSE_FLAGS' corresponds to the current architecture...
|
|
|
|
#doCheck = true;
|
|
|
|
|
2008-02-22 17:51:51 +01:00
|
|
|
postInstall =
|
2008-06-11 14:31:44 +02:00
|
|
|
''
|
2008-07-03 14:51:23 +02:00
|
|
|
notSupported(){
|
|
|
|
echo -e "#\!/bin/sh\necho '`basename $1` not supported, $2'\nexit 1" > "$1"
|
|
|
|
chmod +x $1
|
|
|
|
}
|
|
|
|
|
2011-07-08 01:48:38 +02:00
|
|
|
# Install contrib stuff.
|
|
|
|
ensureDir $out/share/git
|
|
|
|
mv contrib $out/share/git/
|
2008-06-11 14:31:44 +02:00
|
|
|
ensureDir $out/share/emacs/site-lisp
|
2011-07-08 01:48:38 +02:00
|
|
|
ln -s "$out/share/git/contrib/emacs/"*.el $out/share/emacs/site-lisp/
|
|
|
|
ensureDir $out/etc/bash_completion.d
|
|
|
|
ln -s $out/share/git/contrib/completion/git-completion.bash $out/etc/bash_completion.d/
|
2010-09-18 14:45:04 +02:00
|
|
|
|
|
|
|
# grep is a runtime dependence, need to patch so that it's found
|
|
|
|
substituteInPlace $out/libexec/git-core/git-sh-setup \
|
|
|
|
--replace ' grep' ' ${gnugrep}/bin/grep' \
|
|
|
|
--replace ' egrep' ' ${gnugrep}/bin/egrep'
|
2011-07-21 00:56:31 +02:00
|
|
|
|
|
|
|
# Fix references to the perl binary. Note that the tab character
|
|
|
|
# in the patterns is important.
|
|
|
|
sed -i -e 's| perl -ne| ${perl}/bin/perl -ne|g' \
|
|
|
|
-e 's| perl -e| ${perl}/bin/perl -e|g' \
|
|
|
|
$out/libexec/git-core/{git-am,git-submodule}
|
2011-07-08 01:48:38 +02:00
|
|
|
''
|
2008-06-28 17:22:31 +02:00
|
|
|
|
2008-05-19 20:29:07 +02:00
|
|
|
+ (if svnSupport then
|
|
|
|
|
|
|
|
''# wrap git-svn
|
2009-04-23 01:04:18 +02:00
|
|
|
gitperllib=$out/lib/perl5/site_perl
|
2010-04-02 09:17:11 +02:00
|
|
|
for i in ${builtins.toString perlLibs} ${svn}; do
|
2009-04-23 01:04:18 +02:00
|
|
|
gitperllib=$gitperllib:$i/lib/perl5/site_perl
|
2008-05-19 20:29:07 +02:00
|
|
|
done
|
2008-08-22 23:35:25 +02:00
|
|
|
wrapProgram "$out/libexec/git-core/git-svn" \
|
2008-06-11 14:31:44 +02:00
|
|
|
--set GITPERLLIB "$gitperllib" \
|
2010-04-02 09:17:11 +02:00
|
|
|
--prefix PATH : "${svn}/bin" ''
|
2008-07-03 14:51:23 +02:00
|
|
|
else '' # replace git-svn by notification script
|
|
|
|
notSupported $out/bin/git-svn "reinstall with config git = { svnSupport = true } set"
|
|
|
|
'')
|
2008-05-22 10:06:52 +02:00
|
|
|
|
2010-05-15 12:38:28 +02:00
|
|
|
+ (if sendEmailSupport then
|
|
|
|
''# wrap git-send-email
|
|
|
|
gitperllib=$out/lib/perl5/site_perl
|
|
|
|
for i in ${builtins.toString smtpPerlLibs}; do
|
|
|
|
gitperllib=$gitperllib:$i/lib/perl5/site_perl
|
|
|
|
done
|
|
|
|
wrapProgram "$out/libexec/git-core/git-send-email" \
|
|
|
|
--set GITPERLLIB "$gitperllib" ''
|
|
|
|
else '' # replace git-send-email by notification script
|
|
|
|
notSupported $out/bin/git-send-email "reinstall with config git = { sendEmailSupport = true } set"
|
|
|
|
'')
|
|
|
|
|
2008-03-11 15:07:58 +01:00
|
|
|
+ ''# Install man pages and Info manual
|
Enable parallel building of gcc, glibc, gmp, mpfr, ncurses, coreutils, perl, python, git, and qt4.
If a build expressions has set "enableParallelBuilding = true", then the
generic builder may utilize more than one CPU core to build that particular
expression. This feature works out of the box for GNU Make. Expressions that
use other build drivers like Boost.Jam or SCons have to specify appropriate
flags such as "-j${NIX_BUILD_CORES}" themselves.
svn path=/nixpkgs/trunk/; revision=23042
2010-08-08 20:51:42 +02:00
|
|
|
make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES PERL_PATH="${perl}/bin/perl" cmd-list.made install install-info \
|
2008-03-15 21:52:21 +01:00
|
|
|
-C Documentation ''
|
|
|
|
|
2008-06-11 14:31:44 +02:00
|
|
|
+ (if guiSupport then ''
|
|
|
|
# Wrap Tcl/Tk programs
|
2011-02-02 12:16:57 +01:00
|
|
|
for prog in bin/gitk libexec/git-core/{git-gui,git-citool,git-gui--askpass}; do
|
2011-01-07 12:03:42 +01:00
|
|
|
sed -i -e "s|exec 'wish'|exec '${tk}/bin/wish'|g" \
|
|
|
|
-e "s|exec wish|exec '${tk}/bin/wish'|g" \
|
2011-02-02 12:16:57 +01:00
|
|
|
"$out/$prog"
|
2011-01-07 12:03:42 +01:00
|
|
|
done
|
2008-07-03 14:51:23 +02:00
|
|
|
'' else ''
|
2011-01-07 12:04:09 +01:00
|
|
|
# Don't wrap Tcl/Tk, replace them by notification scripts
|
|
|
|
for prog in bin/gitk libexec/git-core/git-gui; do
|
2008-08-22 23:35:25 +02:00
|
|
|
notSupported "$out/$prog" \
|
2009-01-13 17:36:47 +01:00
|
|
|
"reinstall with config git = { guiSupport = true; } set"
|
2008-07-03 14:51:23 +02:00
|
|
|
done
|
|
|
|
'')
|
2008-04-11 00:12:11 +02:00
|
|
|
|
2009-10-20 16:08:58 +02:00
|
|
|
# Don't know why hardlinks aren't created. git installs the same executable
|
|
|
|
# multiple times into $out so replace duplicates by symlinks because I
|
|
|
|
# haven't tested whether the nix distribution system can handle hardlinks.
|
|
|
|
# This reduces the size of $out from 115MB down to 13MB on x86_64-linux!
|
2011-01-07 12:04:09 +01:00
|
|
|
+ ''
|
2009-09-27 01:33:11 +02:00
|
|
|
declare -A seen
|
2011-01-07 12:03:57 +01:00
|
|
|
shopt -s globstar
|
|
|
|
for f in "$out/"**; do
|
2011-07-08 01:48:38 +02:00
|
|
|
if [ -L "$f" ]; then continue; fi
|
2011-01-07 12:03:57 +01:00
|
|
|
test -f "$f" || continue
|
2009-09-27 01:33:11 +02:00
|
|
|
sum=$(md5sum "$f");
|
|
|
|
sum=''\${sum/ */}
|
|
|
|
if [ -z "''\${seen["$sum"]}" ]; then
|
|
|
|
seen["$sum"]="$f"
|
|
|
|
else
|
2011-01-07 12:04:04 +01:00
|
|
|
rm "$f"; ln -v -s "''\${seen["$sum"]}" "$f"
|
2009-09-27 01:33:11 +02:00
|
|
|
fi
|
|
|
|
done
|
2008-08-07 19:30:35 +02:00
|
|
|
'';
|
2008-02-20 11:29:32 +01:00
|
|
|
|
Enable parallel building of gcc, glibc, gmp, mpfr, ncurses, coreutils, perl, python, git, and qt4.
If a build expressions has set "enableParallelBuilding = true", then the
generic builder may utilize more than one CPU core to build that particular
expression. This feature works out of the box for GNU Make. Expressions that
use other build drivers like Boost.Jam or SCons have to specify appropriate
flags such as "-j${NIX_BUILD_CORES}" themselves.
svn path=/nixpkgs/trunk/; revision=23042
2010-08-08 20:51:42 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2007-11-14 22:41:01 +01:00
|
|
|
meta = {
|
2008-02-20 11:29:32 +01:00
|
|
|
license = "GPLv2";
|
2010-01-18 17:07:48 +01:00
|
|
|
homepage = http://git-scm.com/;
|
2008-03-31 00:19:20 +02: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.
|
|
|
|
'';
|
|
|
|
|
2010-01-18 17:07:48 +01:00
|
|
|
maintainers =
|
|
|
|
[ # Add your name here!
|
|
|
|
stdenv.lib.maintainers.ludo
|
2010-02-18 01:28:15 +01:00
|
|
|
stdenv.lib.maintainers.simons
|
2010-01-18 17:07:48 +01:00
|
|
|
];
|
|
|
|
|
2010-05-18 16:41:18 +02:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
2007-11-14 22:41:01 +01:00
|
|
|
};
|
2007-04-26 18:14:01 +02:00
|
|
|
}
|