1{ lib
2, buildPythonPackage
3, fetchpatch
4, fetchPypi
5, substituteAll
6, pyparsing
7, graphviz
8, pytestCheckHook
9, texlive
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 (substituteAll {
24 src = ./path.patch;
25 inherit graphviz;
26 })
27 ./test.patch # https://github.com/kjellmf/dot2tex/issues/5
28
29 # https://github.com/xyz2tex/dot2tex/pull/104 does not merge cleanly
30 ./remove-duplicate-script.patch
31 ];
32
33 propagatedBuildInputs = [
34 pyparsing
35 ];
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 (texlive.combine {
40 inherit (texlive) scheme-small preview pstricks;
41 })
42 ];
43
44 meta = with lib; {
45 description = "Convert graphs generated by Graphviz to LaTeX friendly formats";
46 homepage = "https://github.com/kjellmf/dot2tex";
47 license = licenses.mit;
48 };
49}