Merge pull request #51501 from timokau/pygraphviz-path

python.pkgs.pygraphviz: add graphviz path
This commit is contained in:
Jörg Thalheim 2018-12-04 10:52:08 +00:00 committed by GitHub
commit 49a9bd626d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 3 deletions

View File

@ -13,8 +13,18 @@ buildPythonPackage rec {
buildInputs = [ doctest-ignore-unicode mock nose ];
propagatedBuildInputs = [ graphviz pkgconfig ];
# the tests are currently failing:
# check status of pygraphviz/pygraphviz#129
patches = [
# pygraphviz depends on graphviz being in PATH. This patch always prepends
# graphviz to PATH.
./graphviz-path.patch
];
postPatch = ''
substituteInPlace pygraphviz/agraph.py --subst-var-by graphvizPath '${graphviz}/bin'
'';
# The tests are currently failing because of a bug in graphviz 2.40.1.
# Upstream does not want to skip the relevant tests:
# https://github.com/pygraphviz/pygraphviz/pull/129
doCheck = false;
meta = with stdenv.lib; {

View File

@ -0,0 +1,13 @@
diff --git a/pygraphviz/agraph.py b/pygraphviz/agraph.py
index 8f72024..2d8358e 100644
--- a/pygraphviz/agraph.py
+++ b/pygraphviz/agraph.py
@@ -1557,7 +1557,7 @@ class AGraph(object):
import os
import glob
- paths = os.environ["PATH"]
+ paths = '@graphvizPath@:' + os.environ["PATH"]
if os.name == "nt":
exe = ".exe"
else:

View File

@ -3033,7 +3033,9 @@ in {
graphviz = callPackage ../development/python-modules/graphviz { };
pygraphviz = callPackage ../development/python-modules/pygraphviz { };
pygraphviz = callPackage ../development/python-modules/pygraphviz {
graphviz = pkgs.graphviz; # not the python package
};
pymc3 = callPackage ../development/python-modules/pymc3 { };