2018-07-21 01:44:44 +01:00
|
|
|
{stdenv, fetchgit, mercurial, makeWrapper, subversion}:
|
2011-10-22 16:41:20 +01:00
|
|
|
|
2014-12-30 13:45:30 +00:00
|
|
|
with stdenv.lib;
|
2009-10-27 17:46:37 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "fast-export";
|
|
|
|
|
2011-10-22 16:41:20 +01:00
|
|
|
src = fetchgit {
|
2014-12-30 13:45:30 +00:00
|
|
|
url = git://repo.or.cz/fast-export.git;
|
|
|
|
rev = "d202200fd9daa75cdb37d4cf067d4ca00e269535";
|
2016-06-02 12:26:44 +01:00
|
|
|
sha256 = "0m4llsg9rx4sza1kf39kxsdvhi6y87a18wm5k19c5r2h3vpylwcc";
|
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
|
|
|
|
2016-05-04 11:08:35 +01:00
|
|
|
dontBuild = true; # skip svn for now
|
2009-10-27 17:46:37 +00:00
|
|
|
|
|
|
|
# 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 \
|
2016-10-13 23:03:12 +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 or []}" \
|
2009-10-27 17:46:37 +00:00
|
|
|
--prefix PATH : "$(dirname $(type -p python))":$l
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2014-12-30 13:45:30 +00:00
|
|
|
description = "Import svn, mercurial into git";
|
2018-11-24 18:21:12 +00:00
|
|
|
homepage = https://repo.or.cz/w/fast-export.git;
|
2014-12-30 13:45:30 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.koral ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2009-10-27 17:46:37 +00:00
|
|
|
};
|
|
|
|
}
|