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