about summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-and-tools/svn2git/default.nix
blob: 562658a6e99fe901c291e47050b5362ecdb61983 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib, stdenv, fetchFromGitHub, ruby, makeWrapper, git }:

stdenv.mkDerivation rec {
  pname = "svn2git";
  version = "2.4.0";

  src = fetchFromGitHub {
    owner = "nirvdrum";
    repo = "svn2git";
    rev = "v${version}";
    sha256 = "sha256-w649l/WO68vYYxZOBKzI8XhGFkaSwWx/O3oVOtnGg6w=";
  };

  nativeBuildInputs = [ ruby makeWrapper ];

  dontBuild = true;

  installPhase = ''
    mkdir -p $out
    cp -r lib $out/

    mkdir -p $out/bin
    substituteInPlace bin/svn2git --replace '/usr/bin/env ruby' ${ruby}/bin/ruby
    cp bin/svn2git $out/bin/
    chmod +x $out/bin/svn2git

    wrapProgram $out/bin/svn2git \
      --set RUBYLIB $out/lib \
      --prefix PATH : ${git}/bin
  '';

  meta = {
    homepage = "https://github.com/nirvdrum/svn2git";
    description = "Tool for importing Subversion repositories into git";
    license = lib.licenses.mit;
    platforms = lib.platforms.unix;
  };
}