1{ lib
2, python
3, buildPythonPackage
4, fetchPypi
5, substituteAll
6, pyparsing
7, graphviz
8, texlive
9}:
10
11buildPythonPackage rec {
12 pname = "dot2tex";
13 version = "2.11.3";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "1kp77wiv7b5qib82i3y3sn9r49rym43aaqm5aw1bwnzfbbq2m6i9";
18 };
19
20 patches = [
21 (substituteAll {
22 src = ./path.patch;
23 inherit graphviz;
24 })
25 ./test.patch # https://github.com/kjellmf/dot2tex/issues/5
26 ];
27
28 propagatedBuildInputs = [ pyparsing ];
29
30 checkInputs = [
31 (texlive.combine {
32 inherit (texlive) scheme-small preview pstricks;
33 })
34 ];
35
36 checkPhase = ''
37 ${python.interpreter} tests/test_dot2tex.py
38 '';
39
40 meta = with lib; {
41 description = "Convert graphs generated by Graphviz to LaTeX friendly formats";
42 homepage = "https://github.com/kjellmf/dot2tex";
43 license = licenses.mit;
44 };
45
46}