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