2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
jinja2,
|
|
|
|
poetry-core,
|
|
|
|
round,
|
|
|
|
graphviz,
|
|
|
|
inkscape,
|
|
|
|
imagemagick,
|
|
|
|
pytestCheckHook,
|
|
|
|
typed-ast,
|
2021-04-13 19:44:15 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "diagrams";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.23.4";
|
2021-04-13 19:44:15 +00:00
|
|
|
format = "pyproject";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-04-13 19:44:15 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mingrammer";
|
|
|
|
repo = pname;
|
2022-09-22 12:36:57 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-2jRWN2glGEr51fzny8nkqa5c2EdJG5aZPG2eTD7AISY=";
|
2021-04-13 19:44:15 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2022-05-18 14:49:53 +00:00
|
|
|
--replace 'graphviz = ">=0.13.2,<0.20.0"' 'graphviz = "*"'
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs autogen.sh
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
patches = [
|
|
|
|
# The build-system section is missing
|
|
|
|
./build_poetry.patch
|
2022-07-14 12:49:19 +00:00
|
|
|
./remove-black-requirement.patch
|
2021-08-22 07:53:02 +00:00
|
|
|
];
|
2021-04-13 19:44:15 +00:00
|
|
|
|
|
|
|
# Despite living in 'tool.poetry.dependencies',
|
|
|
|
# these are only used at build time to process the image resource files
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeBuildInputs = [
|
2024-06-05 15:53:02 +00:00
|
|
|
inkscape
|
|
|
|
imagemagick
|
2023-02-02 18:25:31 +00:00
|
|
|
jinja2
|
|
|
|
poetry-core
|
|
|
|
round
|
|
|
|
];
|
2021-04-13 19:44:15 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
graphviz
|
|
|
|
typed-ast
|
|
|
|
];
|
2021-04-13 19:44:15 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "diagrams" ];
|
2021-08-22 07:53:02 +00:00
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Diagram as Code";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://diagrams.mingrammer.com/";
|
|
|
|
changelog = "https://github.com/mingrammer/diagrams/releases/tag/v${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ addict3d ];
|
2021-04-13 19:44:15 +00:00
|
|
|
};
|
|
|
|
}
|