2021-03-09 03:18:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2024-01-13 08:15:51 +00:00
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
2021-03-09 03:18:52 +00:00
|
|
|
, substituteAll
|
|
|
|
, graphviz
|
|
|
|
, coreutils
|
|
|
|
, pkg-config
|
2024-01-13 08:15:51 +00:00
|
|
|
, setuptools
|
2021-03-09 03:18:52 +00:00
|
|
|
, pytest
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pygraphviz";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "1.12";
|
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
disabled = pythonOlder "3.10";
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pygraphviz";
|
|
|
|
repo = "pygraphviz";
|
|
|
|
rev = "pygraphviz-${version}";
|
|
|
|
hash = "sha256-XDP77H724eiMa/V18OtLxpUpxlIVDmcFLMYOAbazquo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
setuptools
|
|
|
|
];
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|