2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pygments,
|
|
|
|
gitMinimal,
|
|
|
|
mercurial,
|
|
|
|
subversion,
|
|
|
|
patchutils,
|
|
|
|
less,
|
2021-01-15 22:18:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ydiff";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.3";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-05-15 15:35:15 +00:00
|
|
|
sha256 = "sha256-ii6EWI7zHT5SVwD6lksfmqth8MnEYoHgU0GlbgHc17g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace ydiff.py \
|
|
|
|
--replace "['git'" "['${gitMinimal}/bin/git'" \
|
|
|
|
--replace "['hg'" "['${mercurial}/bin/hg'" \
|
|
|
|
--replace "['svn'" "['${subversion}/bin/svn'" \
|
|
|
|
--replace "['filterdiff'" "['${patchutils}/bin/filterdiff'" \
|
|
|
|
--replace "['less'" "['${less}/bin/less'" # doesn't support PAGER from env
|
|
|
|
substituteInPlace tests/test_ydiff.py \
|
|
|
|
--replace /bin/rm rm \
|
|
|
|
--replace /bin/sh sh
|
|
|
|
patchShebangs setup.py
|
|
|
|
patchShebangs tests/*.sh
|
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeCheckInputs = [ pygments ];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
checkPhase = ''
|
2021-01-15 22:18:51 +00:00
|
|
|
runHook preCheck
|
2024-05-15 15:35:15 +00:00
|
|
|
make reg # We don't want the linter or coverage check.
|
2021-01-15 22:18:51 +00:00
|
|
|
runHook postCheck
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "View colored, incremental diff in workspace or from stdin with side by side and auto pager support (Was \"cdiff\")";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "ydiff";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
2021-01-15 22:18:51 +00:00
|
|
|
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.
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
homepage = "https://github.com/ymattw/ydiff";
|
|
|
|
license = licenses.bsd3;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = (with maintainers; [ leenaars ]) ++ teams.deshaw.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|