python3.pkgs.anytree: make graphviz optional

It is a runtime dependency that produces dependency loop:

    anytree → graphviz → pango → glib → gtk-doc → anytree
This commit is contained in:
Jan Tojnar 2019-12-14 17:35:47 +01:00
parent 91a276cd79
commit 4522205507
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -5,6 +5,7 @@
, fetchpatch
, nose
, six
, withGraphviz ? true
, graphviz
, fontconfig
}:
@ -18,7 +19,7 @@ buildPythonPackage rec {
sha256 = "05736hamjv4f38jw6z9y4wckc7mz18ivbizm1s3pb0n6fp1sy4zk";
};
patches = [
patches = lib.optionals withGraphviz [
(substituteAll {
src = ./graphviz.patch;
inherit graphviz;
@ -33,11 +34,14 @@ buildPythonPackage rec {
six
];
# Fontconfig error: Cannot load default config file
preCheck = ''
# tests print “Fontconfig error: Cannot load default config file
preCheck = lib.optionalString withGraphviz ''
export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf
'';
# circular dependency anytree → graphviz → pango → glib → gtk-doc → anytree
doCheck = withGraphviz;
checkPhase = ''
runHook preCheck