1{
2 lib,
3 buildPythonPackage,
4 fetchpatch,
5 fetchPypi,
6 substituteAll,
7 pyparsing,
8 graphviz,
9 pytestCheckHook,
10 texliveSmall,
11}:
12
13buildPythonPackage rec {
14 pname = "dot2tex";
15 version = "2.11.3";
16 format = "setuptools";
17
18 src = fetchPypi {
19 inherit pname version;
20 hash = "sha256-KZoq8FruW74CV6VipQapPieSk9XDjyjQirissyM/584=";
21 };
22
23 patches = [
24 (substituteAll {
25 src = ./path.patch;
26 inherit graphviz;
27 })
28 ./test.patch # https://github.com/kjellmf/dot2tex/issues/5
29
30 # https://github.com/xyz2tex/dot2tex/pull/104 does not merge cleanly
31 ./remove-duplicate-script.patch
32 ];
33
34 propagatedBuildInputs = [ pyparsing ];
35
36 nativeCheckInputs = [
37 pytestCheckHook
38 (texliveSmall.withPackages (
39 ps: with ps; [
40 preview
41 pstricks
42 ]
43 ))
44 ];
45
46 meta = with lib; {
47 description = "Convert graphs generated by Graphviz to LaTeX friendly formats";
48 mainProgram = "dot2tex";
49 homepage = "https://github.com/kjellmf/dot2tex";
50 license = licenses.mit;
51 };
52}