2011-10-22 16:41:20 +01:00
|
|
|
{stdenv, fetchgit, mercurial, coreutils, git, makeWrapper, subversion}:
|
|
|
|
|
2009-10-27 17:46:37 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "fast-export";
|
|
|
|
|
2011-10-22 16:41:20 +01:00
|
|
|
src = fetchgit {
|
|
|
|
url = "git://repo.or.cz/fast-export.git";
|
2013-09-28 23:25:20 +01:00
|
|
|
rev = "aaccfba";
|
|
|
|
sha256 = "c9d1498e31d32b8271c1e651175794718611f93b4843dea569d831005de0a750";
|
2011-10-22 16:41:20 +01:00
|
|
|
};
|
2009-10-27 17:46:37 +00:00
|
|
|
|
2011-10-22 16:41:20 +01:00
|
|
|
buildInputs = [mercurial.python mercurial makeWrapper subversion];
|
2009-10-27 17:46:37 +00:00
|
|
|
|
|
|
|
buildPhase="true"; # skip svn for now
|
|
|
|
|
|
|
|
# TODO also support svn stuff
|
|
|
|
# moving .py files into lib directory so that you can't pick the wrong file from PATH.
|
|
|
|
# This requires redefining ROOT
|
|
|
|
installPhase = ''
|
|
|
|
sed -i "s@/usr/bin/env.*@$(type -p python)@" *.py
|
|
|
|
l=$out/libexec/git-fast-export
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/{bin,doc/git-fast-export} $l
|
2009-10-27 17:46:37 +00:00
|
|
|
sed -i "s@ROOT=.*@ROOT=$l@" *.sh
|
|
|
|
mv *.sh $out/bin
|
|
|
|
mv *.py $l
|
|
|
|
for p in $out/bin/*.sh; do
|
|
|
|
wrapProgram $p \
|
2011-10-22 16:41:20 +01:00
|
|
|
--prefix PYTHONPATH : "$(echo ${mercurial}/lib/python*/site-packages):$(echo ${mercurial.python}/lib/python*/site-packages)${stdenv.lib.concatMapStrings (x: ":$(echo ${x}/lib/python*/site-packages)") mercurial.pythonPackages}" \
|
2009-10-27 17:46:37 +00:00
|
|
|
--prefix PATH : "$(dirname $(type -p python))":$l
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2014-11-06 00:44:33 +00:00
|
|
|
# usage:
|
2009-10-27 17:46:37 +00:00
|
|
|
meta = {
|
|
|
|
description = "import svn, mercurial into git";
|
|
|
|
homepage = "http://repo.or.cz/w/fast-export.git";
|
2014-11-06 00:44:33 +00:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2009-10-27 17:46:37 +00:00
|
|
|
};
|
|
|
|
}
|