python39Packages.sphinxcontrib-tikz: replace patch by substituteInPlace to prevent apply errors

This commit is contained in:
Sandro Jäckel 2021-08-30 00:18:44 +02:00 committed by Martin Weinelt
parent 9f5cc3d58b
commit c617466cad
2 changed files with 5 additions and 28 deletions

View File

@ -1,22 +0,0 @@
diff --git a/sphinxcontrib/tikz.py b/sphinxcontrib/tikz.py
index ee21113..a4f4589 100644
--- a/sphinxcontrib/tikz.py
+++ b/sphinxcontrib/tikz.py
@@ -242,7 +242,7 @@ def render_tikz(self, node, libs='', stringsubst=False):
tf.write(latex)
tf.close()
- system([self.builder.config.latex_engine, '--interaction=nonstopmode',
+ system(['@texLive@/bin/pdflatex', '--interaction=nonstopmode',
'tikz-%s.tex' % shasum],
self.builder)
@@ -281,7 +281,7 @@ def render_tikz(self, node, libs='', stringsubst=False):
'-sOutputFile=%s' % outfn, '-r' + resolution + 'x' + resolution,
'-f', 'tikz-%s.pdf' % shasum], self.builder)
elif self.builder.config.tikz_proc_suite == "pdf2svg":
- system(['pdf2svg', 'tikz-%s.pdf' % shasum, outfn], self.builder)
+ system(['@pdf2svg@/bin/pdf2svg', 'tikz-%s.pdf' % shasum, outfn], self.builder)
else:
self.builder._tikz_warned = True
raise TikzExtError('Error (tikz extension): Invalid configuration '

View File

@ -16,12 +16,11 @@ buildPythonPackage rec {
sha256 = "1614a45c960b80009dd42f96689122c9c0781018a0c5ec5828f4cdc5e35b11ad";
};
patches = [
(substituteAll {
src = ./binary-paths.patch;
inherit texLive pdf2svg;
})
];
postPatch = ''
substituteInPlace sphinxcontrib/tikz.py \
--replace "config.latex_engine" "${texLive}/bin/pdflatex" \
--replace "system(['pdf2svg'" "system(['${pdf2svg}/bin/pdf2svg'"
'';
propagatedBuildInputs = [ sphinx ];