python.pkgs.pygraphviz: use pkgs.pkgconfig and improve expression

This commit is contained in:
Robert Schütz 2019-01-18 01:33:34 +01:00 committed by Frederik Rietdijk
parent c78f98db56
commit 733a3f3e9a
3 changed files with 10 additions and 9 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, buildPythonPackage, fetchPypi, graphviz
{ stdenv, buildPythonPackage, fetchPypi, substituteAll, graphviz
, pkgconfig, doctest-ignore-unicode, mock, nose }:
buildPythonPackage rec {
@ -10,17 +10,18 @@ buildPythonPackage rec {
sha256 = "7c294cbc9d88946be671cc0d8602aac176d8c56695c0a7d871eadea75a958408";
};
buildInputs = [ doctest-ignore-unicode mock nose ];
propagatedBuildInputs = [ graphviz pkgconfig ];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ graphviz ];
checkInputs = [ doctest-ignore-unicode mock nose ];
patches = [
# pygraphviz depends on graphviz being in PATH. This patch always prepends
# graphviz to PATH.
./graphviz-path.patch
(substituteAll {
src = ./graphviz-path.patch;
inherit graphviz;
})
];
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:

View File

@ -7,7 +7,7 @@ index 8f72024..2d8358e 100644
import glob
- paths = os.environ["PATH"]
+ paths = '@graphvizPath@:' + os.environ["PATH"]
+ paths = '@graphviz@/bin:' + os.environ["PATH"]
if os.name == "nt":
exe = ".exe"
else:

View File

@ -3141,7 +3141,7 @@ in {
};
pygraphviz = callPackage ../development/python-modules/pygraphviz {
graphviz = pkgs.graphviz; # not the python package
inherit (pkgs) graphviz pkgconfig; # not the python package
};
pymc3 = callPackage ../development/python-modules/pymc3 { };