diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pydot')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pydot/default.nix | 47 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pydot/hardcode-graphviz-path.patch | 13 |
2 files changed, 60 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; + }; +} diff --git a/nixpkgs/pkgs/development/python-modules/pydot/hardcode-graphviz-path.patch b/nixpkgs/pkgs/development/python-modules/pydot/hardcode-graphviz-path.patch new file mode 100644 index 000000000000..e862f1e7c2c3 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/pydot/hardcode-graphviz-path.patch @@ -0,0 +1,13 @@ +diff --git a/pydot.py b/pydot.py +index 3c7da4d..582c5bc 100644 +--- a/pydot.py ++++ b/pydot.py +@@ -124,7 +124,7 @@ def call_graphviz(program, arguments, working_dir, **kwargs): + 'LD_LIBRARY_PATH': os.environ.get('LD_LIBRARY_PATH', ''), + } + +- program_with_args = [program, ] + arguments ++ program_with_args = ['@graphviz@/bin/' + program, ] + arguments + + process = subprocess.Popen( + program_with_args, |