1{
2 lib,
3 buildPythonPackage,
4 docutils,
5 ephem,
6 fetchFromGitHub,
7 fetchpatch,
8 funcparserlib,
9 pillow,
10 pynose,
11 pytestCheckHook,
12 pythonOlder,
13 reportlab,
14 setuptools,
15 webcolors,
16}:
17
18buildPythonPackage rec {
19 pname = "blockdiag";
20 version = "3.0.0";
21 pyproject = true;
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = "blockdiag";
27 repo = "blockdiag";
28 rev = "refs/tags/${version}";
29 hash = "sha256-j8FoNUIJJOaahaol1MRPyY2jcPCEIlaAD4bmM2QKFFI=";
30 };
31
32 patches = [
33 # https://github.com/blockdiag/blockdiag/pull/179
34 (fetchpatch {
35 name = "pillow-10-compatibility.patch";
36 url = "https://github.com/blockdiag/blockdiag/commit/20d780cad84e7b010066cb55f848477957870165.patch";
37 hash = "sha256-t1zWFzAsLL2EUa0nD4Eui4Y5AhAZLRmp/yC9QpzzeUA=";
38 })
39 ];
40
41 build-system = [ setuptools ];
42
43 dependencies = [
44 docutils
45 funcparserlib
46 pillow
47 reportlab
48 webcolors
49 ];
50
51 nativeCheckInputs = [
52 ephem
53 pynose
54 pytestCheckHook
55 ];
56
57 pytestFlagsArray = [ "src/blockdiag/tests/" ];
58
59 disabledTests = [
60 # Test require network access
61 "test_app_cleans_up_images"
62 ];
63
64 pythonImportsCheck = [ "blockdiag" ];
65
66 meta = with lib; {
67 description = "Generate block-diagram image from spec-text file (similar to Graphviz)";
68 homepage = "http://blockdiag.com/";
69 changelog = "https://github.com/blockdiag/blockdiag/blob/${version}/CHANGES.rst";
70 license = licenses.asl20;
71 maintainers = with maintainers; [ bjornfor ];
72 mainProgram = "blockdiag";
73 platforms = platforms.unix;
74 };
75}