about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pydot/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pydot/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pydot/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pydot/default.nix b/nixpkgs/pkgs/development/python-modules/pydot/default.nix
new file mode 100644
index 000000000000..021043d9e9db
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pydot/default.nix
@@ -0,0 +1,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;
+  };
+}