1{
2 lib,
3 stdenv,
4 python,
5 buildPythonPackage,
6 fetchFromGitHub,
7 setuptools,
8 pytestCheckHook,
9 writableTmpDirAsHomeHook,
10 pkgs,
11}:
12let
13 inherit (pkgs) bash git less;
14in
15
16buildPythonPackage rec {
17 pname = "icdiff";
18 version = "2.0.7";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "jeffkaufman";
23 repo = "icdiff";
24 tag = "release-${version}";
25 hash = "sha256-XOw/xhPGlzi1hAgzQ1EtioUM476A+lQWLlvvaxd9j08=";
26 leaveDotGit = true;
27 };
28
29 patches = [ ./0001-Don-t-test-black-or-flake8.patch ];
30
31 build-system = [ setuptools ];
32
33 pythonImportsCheck = [ "icdiff" ];
34
35 nativeCheckInputs = [
36 bash
37 git
38 less
39 writableTmpDirAsHomeHook
40 ];
41
42 # Odd behavior in the sandbox
43 doCheck = !stdenv.hostPlatform.isDarwin;
44
45 checkPhase = ''
46 runHook preCheck
47
48 patchShebangs test.sh
49 ./test.sh ${python.interpreter}
50
51 runHook postCheck
52 '';
53
54 meta = {
55 description = "Improved colorized diff";
56 homepage = "https://github.com/jeffkaufman/icdiff";
57 changelog = "https://github.com/jeffkaufman/icdiff/releases/tag/release-${version}/CHANGELOG.md";
58 license = lib.licenses.psfl;
59 maintainers = with lib.maintainers; [ philiptaron ];
60 };
61}