2013-04-19 20:29:30 +00:00
|
|
|
{ fetchurl, stdenv, curl, openssl, zlib, expat, perl, python, gettext, cpio, gnugrep, gzip
|
2009-11-03 15:57:31 +00:00
|
|
|
, asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_45
|
2013-04-22 13:26:26 +00:00
|
|
|
, libxslt, tcl, tk, makeWrapper
|
2011-09-07 22:52:52 +00:00
|
|
|
, svnSupport, subversionClient, perlLibs, smtpPerlLibs
|
2008-06-11 12:31:44 +00:00
|
|
|
, guiSupport
|
2013-01-28 20:24:04 +00:00
|
|
|
, withManual ? true
|
2010-03-13 06:07:44 +00:00
|
|
|
, pythonSupport ? true
|
2010-05-15 10:38:28 +00:00
|
|
|
, sendEmailSupport
|
2008-06-11 12:31:44 +00:00
|
|
|
}:
|
2008-05-22 08:06:52 +00:00
|
|
|
|
2010-04-02 07:17:11 +00:00
|
|
|
let
|
2012-06-04 15:54:57 +00:00
|
|
|
|
2013-11-14 14:29:52 +00:00
|
|
|
version = "1.8.4.3";
|
2012-08-06 19:26:24 +00:00
|
|
|
|
2011-09-07 22:52:52 +00:00
|
|
|
svn = subversionClient.override { perlBindings = true; };
|
2012-08-06 19:26:24 +00:00
|
|
|
|
2010-04-02 07:17:11 +00:00
|
|
|
in
|
2012-06-04 15:54:57 +00:00
|
|
|
|
2011-10-21 16:50:36 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "git-${version}";
|
2007-04-26 16:14:01 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2011-10-21 16:50:36 +00:00
|
|
|
url = "http://git-core.googlecode.com/files/git-${version}.tar.gz";
|
2013-11-14 14:29:52 +00:00
|
|
|
sha256 = "08fbdxh2cjd4hffm0nydwysh5zh6nrssbi9x01yy0n2y8rqzly0a";
|
2007-04-26 16:14:01 +00:00
|
|
|
};
|
|
|
|
|
2013-04-22 13:55:01 +00:00
|
|
|
patches = [ ./docbook2texi.patch ./symlinks-in-bin.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]
|
2013-01-28 20:24:04 +00:00
|
|
|
++ stdenv.lib.optionals withManual [ asciidoc texinfo xmlto docbook2x
|
2009-11-03 15:57:31 +00:00
|
|
|
docbook_xsl docbook_xml_dtd_45 libxslt ]
|
2008-06-11 12:31:44 +00:00
|
|
|
++ stdenv.lib.optionals guiSupport [tcl tk];
|
2007-04-26 16:14:01 +00:00
|
|
|
|
2013-03-09 22:57:57 +00:00
|
|
|
# required to support pthread_cancel()
|
2013-03-14 13:57:40 +00:00
|
|
|
NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
|
2013-03-09 22:57:57 +00:00
|
|
|
|
2013-07-29 21:40:54 +00:00
|
|
|
makeFlags = "prefix=\${out} sysconfdir=/etc/ PERL_PATH=${perl}/bin/perl SHELL_PATH=${stdenv.shell} "
|
2010-03-13 06:07:44 +00:00
|
|
|
+ (if pythonSupport then "PYTHON_PATH=${python}/bin/python" else "NO_PYTHON=1");
|
2007-11-14 21:41:01 +00:00
|
|
|
|
2008-08-22 21:35:25 +00:00
|
|
|
# FIXME: "make check" requires Sparse; the Makefile must be tweaked
|
|
|
|
# so that `SPARSE_FLAGS' corresponds to the current architecture...
|
|
|
|
#doCheck = true;
|
|
|
|
|
2013-04-22 13:55:01 +00:00
|
|
|
installFlags = "NO_INSTALL_HARDLINKS=1";
|
|
|
|
|
2008-02-22 16:51:51 +00:00
|
|
|
postInstall =
|
2008-06-11 12:31:44 +00:00
|
|
|
''
|
2012-06-21 19:23:40 +00:00
|
|
|
notSupported() {
|
2008-07-03 12:51:23 +00:00
|
|
|
echo -e "#\!/bin/sh\necho '`basename $1` not supported, $2'\nexit 1" > "$1"
|
|
|
|
chmod +x $1
|
|
|
|
}
|
|
|
|
|
2013-08-01 14:36:54 +00:00
|
|
|
# Install git-subtree.
|
|
|
|
pushd contrib/subtree
|
|
|
|
make
|
|
|
|
make install install-doc
|
|
|
|
popd
|
|
|
|
rm -rf contrib/subtree
|
|
|
|
|
2011-07-07 23:48:38 +00:00
|
|
|
# Install contrib stuff.
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/share/git
|
2011-07-07 23:48:38 +00:00
|
|
|
mv contrib $out/share/git/
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/share/emacs/site-lisp
|
2011-07-07 23:48:38 +00:00
|
|
|
ln -s "$out/share/git/contrib/emacs/"*.el $out/share/emacs/site-lisp/
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/etc/bash_completion.d
|
2011-07-07 23:48:38 +00:00
|
|
|
ln -s $out/share/git/contrib/completion/git-completion.bash $out/etc/bash_completion.d/
|
2010-09-18 12:45:04 +00: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-20 22:56:31 +00: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}
|
2013-04-19 20:29:30 +00:00
|
|
|
|
|
|
|
# gzip (and optionally bzip2, xz, zip) are a runtime dependencies for
|
|
|
|
# gitweb.cgi, need to patch so that it's found
|
|
|
|
sed -i -e "s|'compressor' => \['gzip'|'compressor' => ['${gzip}/bin/gzip'|" \
|
|
|
|
$out/share/gitweb/gitweb.cgi
|
2011-07-07 23:48:38 +00:00
|
|
|
''
|
2008-06-28 15:22:31 +00:00
|
|
|
|
2008-05-19 18:29:07 +00:00
|
|
|
+ (if svnSupport then
|
|
|
|
|
|
|
|
''# wrap git-svn
|
2009-04-22 23:04:18 +00:00
|
|
|
gitperllib=$out/lib/perl5/site_perl
|
2010-04-02 07:17:11 +00:00
|
|
|
for i in ${builtins.toString perlLibs} ${svn}; do
|
2009-04-22 23:04:18 +00:00
|
|
|
gitperllib=$gitperllib:$i/lib/perl5/site_perl
|
2008-05-19 18:29:07 +00:00
|
|
|
done
|
2012-06-21 19:23:40 +00:00
|
|
|
wrapProgram $out/libexec/git-core/git-svn \
|
|
|
|
--set GITPERLLIB "$gitperllib" \
|
2010-04-02 07:17:11 +00:00
|
|
|
--prefix PATH : "${svn}/bin" ''
|
2008-07-03 12:51:23 +00:00
|
|
|
else '' # replace git-svn by notification script
|
2012-06-21 19:23:40 +00:00
|
|
|
notSupported $out/libexec/git-core/git-svn "reinstall with config git = { svnSupport = true } set"
|
2008-07-03 12:51:23 +00:00
|
|
|
'')
|
2008-05-22 08:06:52 +00:00
|
|
|
|
2010-05-15 10:38:28 +00: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
|
2012-06-21 19:23:40 +00:00
|
|
|
wrapProgram $out/libexec/git-core/git-send-email \
|
2010-05-15 10:38:28 +00:00
|
|
|
--set GITPERLLIB "$gitperllib" ''
|
|
|
|
else '' # replace git-send-email by notification script
|
2012-06-21 19:23:40 +00:00
|
|
|
notSupported $out/libexec/git-core/git-send-email "reinstall with config git = { sendEmailSupport = true } set"
|
2010-05-15 10:38:28 +00:00
|
|
|
'')
|
|
|
|
|
2013-01-28 20:24:04 +00:00
|
|
|
+ stdenv.lib.optionalString withManual ''# 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 18:51:42 +00:00
|
|
|
make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES 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
|
2011-02-02 11:16:57 +00:00
|
|
|
for prog in bin/gitk libexec/git-core/{git-gui,git-citool,git-gui--askpass}; do
|
2011-01-07 11:03:42 +00:00
|
|
|
sed -i -e "s|exec 'wish'|exec '${tk}/bin/wish'|g" \
|
|
|
|
-e "s|exec wish|exec '${tk}/bin/wish'|g" \
|
2012-08-06 19:26:24 +00:00
|
|
|
"$out/$prog"
|
2011-01-07 11:03:42 +00:00
|
|
|
done
|
2008-07-03 12:51:23 +00:00
|
|
|
'' else ''
|
2011-01-07 11:04:09 +00: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 21:35:25 +00:00
|
|
|
notSupported "$out/$prog" \
|
2009-01-13 16:36:47 +00:00
|
|
|
"reinstall with config git = { guiSupport = true; } set"
|
2008-07-03 12:51:23 +00:00
|
|
|
done
|
2013-04-22 13:55:01 +00:00
|
|
|
'');
|
2008-02-20 10:29:32 +00: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 18:51:42 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2007-11-14 21:41:01 +00:00
|
|
|
meta = {
|
2013-04-22 13:26:26 +00:00
|
|
|
homepage = http://git-scm.com/;
|
2008-03-30 22:19:20 +00:00
|
|
|
description = "Git, a popular distributed version control system";
|
2013-03-25 11:21:45 +00:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2008-03-30 22:19:20 +00:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Git, a popular distributed version control system designed to
|
|
|
|
handle very large projects with speed and efficiency.
|
|
|
|
'';
|
|
|
|
|
2010-05-18 14:41:18 +00:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
2013-08-16 21:44:33 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.simons ];
|
2007-11-14 21:41:01 +00:00
|
|
|
};
|
2007-04-26 16:14:01 +00:00
|
|
|
}
|