summary refs log tree commit diff
path: root/pkgs/development/tools/ydiff/default.nix
blob: c2f72138db5fc81e8fd3a831a105a61c6c535688 (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
39
40
41
42
43
44
45
{ stdenv, lib, pythonPackages, python3Packages, less, patchutils, git
, subversion, coreutils, which }:

with pythonPackages;

buildPythonApplication rec {
  pname = "ydiff";
  version = "1.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "0mxcl17sx1d4vaw22ammnnn3y19mm7r6ljbarcjzi519klz26bnf";
  };

  patchPhase = ''
    substituteInPlace tests/test_ydiff.py \
      --replace /bin/rm ${coreutils}/bin/rm \
      --replace /bin/sh ${stdenv.shell}
    substituteInPlace Makefile \
      --replace "pep8 --ignore" "# pep8 --ignore" \
      --replace "python3 \`which coverage\`" "${python3Packages.coverage}/bin/coverage3" \
      --replace /bin/sh ${stdenv.shell} \
      --replace tests/regression.sh "${stdenv.shell} tests/regression.sh"
    patchShebangs tests/*.sh
  '';

  buildInputs = [ docutils pygments ];
  propagatedBuildInputs = [ less patchutils ];
  checkInputs = [ coverage coreutils git subversion which ];

  checkTarget = if isPy3k then "test3" else "test";

  meta = {
    homepage = https://github.com/ymattw/ydiff;
    description = "View colored, incremental diff in workspace or from stdin";
    longDescription = ''
      Term based tool to view colored, incremental diff in a version
      controlled workspace (supports Git, Mercurial, Perforce and Svn
      so far) or from stdin, with side by side (similar to diff -y)
      and auto pager support.
    '';
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ leenaars ];
  };
}