2021-04-13 19:44:15 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, black
|
|
|
|
, jinja2
|
|
|
|
, poetry-core
|
|
|
|
, round
|
|
|
|
, graphviz
|
|
|
|
, inkscape
|
|
|
|
, imagemagick
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "diagrams";
|
2022-01-25 03:21:06 +00:00
|
|
|
version = "0.21.0";
|
2021-04-13 19:44:15 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mingrammer";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-01-25 03:21:06 +00:00
|
|
|
sha256 = "1vj14kqffpafykyr9x5dcfhmqqvxq08lrp94lhqpdzikh6a0a0jx";
|
2021-04-13 19:44:15 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2021-08-22 07:53:02 +00:00
|
|
|
--replace 'jinja2 = "^2.10"' 'jinja2 = "*"' \
|
|
|
|
--replace 'graphviz = ">=0.13.2,<0.17.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
|
|
|
|
];
|
2021-04-13 19:44:15 +00:00
|
|
|
|
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
|
|
|
|
# Despite living in 'tool.poetry.dependencies',
|
|
|
|
# these are only used at build time to process the image resource files
|
|
|
|
nativeBuildInputs = [ black inkscape imagemagick jinja2 poetry-core round ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ graphviz ];
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
pythonImportsCheck = [ "diagrams" ];
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Diagram as Code";
|
|
|
|
homepage = "https://diagrams.mingrammer.com/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ addict3d ];
|
|
|
|
};
|
|
|
|
}
|