2021-04-10 18:06:35 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, black
|
|
|
|
, jinja2
|
|
|
|
, poetry-core
|
|
|
|
, round
|
|
|
|
, graphviz
|
|
|
|
, inkscape
|
|
|
|
, imagemagick
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "diagrams";
|
2021-06-19 02:39:05 +01:00
|
|
|
version = "0.20.0";
|
2021-04-10 18:06:35 +01:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mingrammer";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-06-19 02:39:05 +01:00
|
|
|
sha256 = "1lcqsy3bvlnlnakjysp8qjhy26bhkp1izi5dvzq2fpsffgxk4si4";
|
2021-04-10 18:06:35 +01:00
|
|
|
};
|
|
|
|
|
2021-06-20 20:59:11 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace 'jinja2 = "^2.10"' 'jinja2 = "*"'
|
|
|
|
'';
|
|
|
|
|
2021-04-10 18:06:35 +01:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs autogen.sh
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
patches = [ ./build_poetry.patch ];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Diagram as Code";
|
|
|
|
homepage = "https://diagrams.mingrammer.com/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ addict3d ];
|
|
|
|
};
|
|
|
|
}
|