summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/dot2tex/default.nix
blob: 90856b858521daad09f47693d49ec5115d8b3ade (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
  lib,
  buildPythonPackage,
  fetchPypi,
  replaceVars,
  pyparsing,
  graphviz,
  pytestCheckHook,
  texliveSmall,
}:

buildPythonPackage rec {
  pname = "dot2tex";
  version = "2.11.3";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-KZoq8FruW74CV6VipQapPieSk9XDjyjQirissyM/584=";
  };

  patches = [
    (replaceVars ./path.patch {
      inherit graphviz;
    })
    ./test.patch # https://github.com/kjellmf/dot2tex/issues/5

    # https://github.com/xyz2tex/dot2tex/pull/104 does not merge cleanly
    ./remove-duplicate-script.patch
  ];

  propagatedBuildInputs = [ pyparsing ];

  nativeCheckInputs = [
    pytestCheckHook
    (texliveSmall.withPackages (
      ps: with ps; [
        preview
        pstricks
      ]
    ))
  ];

  meta = {
    description = "Convert graphs generated by Graphviz to LaTeX friendly formats";
    mainProgram = "dot2tex";
    homepage = "https://github.com/kjellmf/dot2tex";
    license = lib.licenses.mit;
  };
}