2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
substituteAll,
|
|
|
|
graphviz-nox,
|
|
|
|
xdg-utils,
|
|
|
|
makeFontsConf,
|
|
|
|
freefont_ttf,
|
|
|
|
setuptools,
|
|
|
|
mock,
|
|
|
|
pytest_7,
|
|
|
|
pytest-mock,
|
|
|
|
python,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "graphviz";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.20.3";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
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";
|
2024-05-15 15:35:15 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-IqjqcBEL4BK/VfRjdxJ9t/DkG8OMAoXJxbW5JXpALuw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
2021-12-06 16:07:01 +00:00
|
|
|
src = ./paths.patch;
|
2024-02-29 20:09:43 +00:00
|
|
|
graphviz = graphviz-nox;
|
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
|
2024-06-05 15:53:02 +00:00
|
|
|
FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ freefont_ttf ]; };
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-30 13:39:12 +00:00
|
|
|
mock
|
2024-04-21 15:54:59 +00:00
|
|
|
pytest_7
|
2021-12-30 13:39:12 +00:00
|
|
|
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";
|
2022-05-18 14:49:53 +00:00
|
|
|
changelog = "https://github.com/xflr6/graphviz/blob/${src.rev}/CHANGES.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|