2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, isPy3k
|
|
|
|
, fetchPypi
|
|
|
|
, substituteAll
|
|
|
|
, graphviz
|
|
|
|
, coreutils
|
|
|
|
, pkg-config
|
|
|
|
, pytest
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pygraphviz";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "1.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-02-10 20:34:41 +00:00
|
|
|
hash = "sha256-+hj3xs6ig0Gk5GbtDPBWgrCmgoiv6N18lCZ4L3wa4Bw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
extension = "zip";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-03-09 03:18:52 +00:00
|
|
|
# pygraphviz depends on graphviz executables and wc being in PATH
|
2020-04-24 23:36:52 +00:00
|
|
|
(substituteAll {
|
2021-03-09 03:18:52 +00:00
|
|
|
src = ./path.patch;
|
|
|
|
path = lib.makeBinPath [ graphviz coreutils ];
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = [ graphviz ];
|
|
|
|
|
|
|
|
checkInputs = [ pytest ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
2022-01-25 03:21:06 +00:00
|
|
|
runHook preCheck
|
2021-03-09 03:18:52 +00:00
|
|
|
pytest --pyargs pygraphviz
|
2022-01-25 03:21:06 +00:00
|
|
|
runHook postCheck
|
2021-03-09 03:18:52 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
pythonImportsCheck = [ "pygraphviz" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python interface to Graphviz graph drawing package";
|
|
|
|
homepage = "https://github.com/pygraphviz/pygraphviz";
|
|
|
|
license = licenses.bsd3;
|
2021-03-09 03:18:52 +00:00
|
|
|
maintainers = with maintainers; [ matthiasbeyer dotlambda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|