about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pydot/default.nix
blob: 0a637a48ba2f8ce3270d8153bd4c45ed5ed61d9e (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
46
47
{ lib
, buildPythonPackage
, fetchPypi
, substituteAll
, graphviz
, python
, chardet
, pyparsing
}:

buildPythonPackage rec {
  pname = "pydot";
  version = "1.4.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "d49c9d4dd1913beec2a997f831543c8cbd53e535b1a739e921642fe416235f01";
  };

  patches = [
    (substituteAll {
      src = ./hardcode-graphviz-path.patch;
      inherit graphviz;
    })
  ];

  postPatch = ''
    # test_graphviz_regression_tests also fails upstream: https://github.com/pydot/pydot/pull/198
    substituteInPlace test/pydot_unittest.py \
      --replace "test_graphviz_regression_tests" "no_test_graphviz_regression_tests"
  '';

  propagatedBuildInputs = [ pyparsing ];

  checkInputs = [ chardet ];

  checkPhase = ''
    cd test
    ${python.interpreter} pydot_unittest.py
  '';

  meta = {
    homepage = "https://github.com/erocarrera/pydot";
    description = "Allows to easily create both directed and non directed graphs from Python";
    license = lib.licenses.mit;
  };
}