From 748dd33b2546fb840da4c9f3258d72a8856f62b7 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Tue, 27 Oct 2009 17:46:37 +0000 Subject: [PATCH] hg2git has been put into repo fast-export. make it work again svn path=/nixpkgs/trunk/; revision=17977 --- .../git-and-tools/default.nix | 6 ++-- .../git-and-tools/fast-export/default.nix | 35 +++++++++++++++++++ .../git-and-tools/hg2git/default.nix | 26 -------------- .../misc/bleeding-edge-repos/default.nix | 2 +- 4 files changed, 39 insertions(+), 30 deletions(-) create mode 100644 pkgs/applications/version-management/git-and-tools/fast-export/default.nix delete mode 100644 pkgs/applications/version-management/git-and-tools/hg2git/default.nix diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix index 86dfc77c4ae9..9e6c1043f0a7 100644 --- a/pkgs/applications/version-management/git-and-tools/default.nix +++ b/pkgs/applications/version-management/git-and-tools/default.nix @@ -3,7 +3,7 @@ */ args: with args; with pkgs; let - inherit (pkgs) stdenv fetchurl getConfig; + inherit (pkgs) stdenv fetchurl getConfig subversion; inherit (pkgs.bleedingEdgeRepos) sourceByName; in rec { @@ -83,8 +83,8 @@ rec { }; }; - hg2git = import ./hg2git { - inherit fetchurl stdenv mercurial coreutils git makeWrapper; + gitFastExport = import ./fast-export { + inherit fetchurl stdenv mercurial coreutils git makeWrapper subversion; inherit (bleedingEdgeRepos) sourceByName; }; diff --git a/pkgs/applications/version-management/git-and-tools/fast-export/default.nix b/pkgs/applications/version-management/git-and-tools/fast-export/default.nix new file mode 100644 index 000000000000..2c1b055f3116 --- /dev/null +++ b/pkgs/applications/version-management/git-and-tools/fast-export/default.nix @@ -0,0 +1,35 @@ +args: with args; +stdenv.mkDerivation { + name = "fast-export"; + + src = sourceByName "git_fast_export"; + + buildInputs =([mercurial.python mercurial makeWrapper subversion]); + + 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 + ensureDir $out/{bin,doc/git-fast-export} $l + mv *.txt $out/doc/git-fast-export + sed -i "s@ROOT=.*@ROOT=$l@" *.sh + mv *.sh $out/bin + mv *.py $l + for p in $out/bin/*.sh; do + wrapProgram $p \ + --set PYTHONPATH "$(echo ${mercurial}/lib/python*/site-packages)" \ + --prefix PATH : "$(dirname $(type -p python))":$l + done + ''; + + # usage: + meta = { + description = "import svn, mercurial into git"; + homepage = "http://repo.or.cz/w/fast-export.git"; + license = "?"; # the .py file is GPLv2 + }; +} diff --git a/pkgs/applications/version-management/git-and-tools/hg2git/default.nix b/pkgs/applications/version-management/git-and-tools/hg2git/default.nix deleted file mode 100644 index 291391b67191..000000000000 --- a/pkgs/applications/version-management/git-and-tools/hg2git/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -args: with args; -stdenv.mkDerivation { - name = "hg2git"; - - src = sourceByName "hg2git"; - - buildInputs =([mercurial.python mercurial makeWrapper]); - - installPhase = '' - ensureDir $out/bin; - cp hg2git.sh hg2git.py $out/bin - cat >> $out/bin/hg2git-doc << EOF - #!${coreutils}/bin/cat - $(cat hg2git.txt) - EOF - chmod +x $out/bin/hg2git-doc - wrapProgram $out/bin/hg2git.sh \ - --set PYTHONPATH "$(echo ${mercurial}/lib/python*/site-packages)" - ''; - - meta = { - description = "mercurial to git one way conversion"; - homepage = "http://git.grml.org/?p=hg-to-git.git;a=summary"; - license = "?"; # the .py file is GPLv2 - }; -} diff --git a/pkgs/development/misc/bleeding-edge-repos/default.nix b/pkgs/development/misc/bleeding-edge-repos/default.nix index e73d8b5a0779..386ed2d08d65 100644 --- a/pkgs/development/misc/bleeding-edge-repos/default.nix +++ b/pkgs/development/misc/bleeding-edge-repos/default.nix @@ -41,7 +41,7 @@ args: plugins = { type = "darcs"; url="http://code.haskell.org/~dons/code/hs-plugins/"; groups="haskell"; }; - hg2git = { type = "git"; url="git://repo.or.cz/hg2git.git"; }; + git_fast_export = { type = "git"; url="git://repo.or.cz/hg2git.git"; }; MPlayer = { type = "svn"; url="svn://svn.mplayerhq.hu/mplayer/trunk"; };