1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 sphinx,
6 pdf2svg,
7 texliveSmall,
8}:
9
10buildPythonPackage rec {
11 pname = "sphinxcontrib-tikz";
12 version = "0.4.20";
13 format = "setuptools";
14
15 src = fetchPypi {
16 inherit pname version;
17 hash = "sha256-LuO9H5yi80nAgjpPNQfZHEEOf5a+IPBR/vevFmXzQco=";
18 };
19
20 postPatch = ''
21 substituteInPlace sphinxcontrib/tikz.py \
22 --replace "config.latex_engine" "'${
23 texliveSmall.withPackages (
24 ps: with ps; [
25 standalone
26 pgfplots
27 ]
28 )
29 }/bin/pdflatex'" \
30 --replace "system(['pdf2svg'" "system(['${pdf2svg}/bin/pdf2svg'"
31 '';
32
33 propagatedBuildInputs = [ sphinx ];
34
35 # no tests in package
36 doCheck = false;
37
38 pythonImportsCheck = [ "sphinxcontrib.tikz" ];
39
40 pythonNamespaces = [ "sphinxcontrib" ];
41
42 meta = with lib; {
43 description = "TikZ extension for Sphinx";
44 homepage = "https://bitbucket.org/philexander/tikz";
45 maintainers = [ ];
46 license = licenses.bsd3;
47 };
48}