2019-05-16 20:51:23 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2019-12-14 15:59:12 +01:00
|
|
|
, fetchPypi
|
2019-05-16 20:51:23 +02:00
|
|
|
, substituteAll
|
|
|
|
, fetchpatch
|
|
|
|
, nose
|
|
|
|
, six
|
2019-12-14 17:35:47 +01:00
|
|
|
, withGraphviz ? true
|
2019-05-16 20:51:23 +02:00
|
|
|
, graphviz
|
|
|
|
, fontconfig
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "anytree";
|
2020-06-06 08:46:57 +02:00
|
|
|
version = "2.8.0";
|
2019-05-16 20:51:23 +02:00
|
|
|
|
2019-12-14 15:59:12 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-06-06 08:46:57 +02:00
|
|
|
sha256 = "3f0f93f355a91bc3e6245319bf4c1d50e3416cc7a35cc1133c1ff38306bbccab";
|
2019-05-16 20:51:23 +02:00
|
|
|
};
|
|
|
|
|
2019-12-14 17:35:47 +01:00
|
|
|
patches = lib.optionals withGraphviz [
|
2019-05-16 20:51:23 +02:00
|
|
|
(substituteAll {
|
|
|
|
src = ./graphviz.patch;
|
|
|
|
inherit graphviz;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
nose
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2019-12-14 17:35:47 +01:00
|
|
|
# tests print “Fontconfig error: Cannot load default config file”
|
|
|
|
preCheck = lib.optionalString withGraphviz ''
|
2019-05-16 20:51:23 +02:00
|
|
|
export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf
|
|
|
|
'';
|
|
|
|
|
2019-12-14 17:35:47 +01:00
|
|
|
# circular dependency anytree → graphviz → pango → glib → gtk-doc → anytree
|
|
|
|
doCheck = withGraphviz;
|
|
|
|
|
2019-05-16 20:51:23 +02:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
nosetests
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Powerful and Lightweight Python Tree Data Structure";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/c0fec0de/anytree";
|
2019-05-16 20:51:23 +02:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.worldofpeace ];
|
|
|
|
};
|
|
|
|
}
|