2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2022-04-15 01:41:22 +00:00
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-08-05 21:33:18 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, substituteAll
|
|
|
|
, graphviz
|
2021-12-06 16:07:01 +00:00
|
|
|
, xdg-utils
|
2020-04-24 23:36:52 +00:00
|
|
|
, makeFontsConf
|
|
|
|
, freefont_ttf
|
|
|
|
, mock
|
2021-12-30 13:39:12 +00:00
|
|
|
, pytest
|
2020-04-24 23:36:52 +00:00
|
|
|
, pytest-mock
|
2021-12-30 13:39:12 +00:00
|
|
|
, python
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "graphviz";
|
2021-12-30 13:39:12 +00:00
|
|
|
version = "0.19.1";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# patch does not apply to PyPI tarball due to different line endings
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xflr6";
|
|
|
|
repo = "graphviz";
|
|
|
|
rev = version;
|
2021-12-30 13:39:12 +00:00
|
|
|
sha256 = "sha256-pE1lsx/r/BjvW5W2niDx/UeRXxx4kvCyHzAUAG3bdGc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
2021-12-06 16:07:01 +00:00
|
|
|
src = ./paths.patch;
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit graphviz;
|
2021-12-06 16:07:01 +00:00
|
|
|
xdgutils = xdg-utils;
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i "/--cov/d" setup.cfg
|
|
|
|
'';
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
# Fontconfig error: Cannot load default config file
|
|
|
|
FONTCONFIG_FILE = makeFontsConf {
|
|
|
|
fontDirectories = [ freefont_ttf ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
checkInputs = [
|
|
|
|
mock
|
|
|
|
pytest
|
|
|
|
pytest-mock
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
HOME=$TMPDIR ${python.interpreter} run-tests.py
|
2021-07-14 22:03:04 +00:00
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
runHook postCheck
|
2021-07-14 22:03:04 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
# Too many failures due to attempting to connect to com.apple.fonts daemon
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Simple Python interface for Graphviz";
|
|
|
|
homepage = "https://github.com/xflr6/graphviz";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|