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";
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "1.11";
|
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;
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-qX61ztJm9FBT67HyxsbSkJFpBQPjpcFL5/kIs3sG8tQ=";
|
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 ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytest ];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|