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