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";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "0.20.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
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;
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-plhWG9mE9DoTMg7mWCvFLAgtBx01LAgJ0gQ/mqBU3yc=";
|
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
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-30 13:39:12 +00:00
|
|
|
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";
|
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 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|