3
0
Fork 0
forked from mirrors/nixpkgs

texlive.bin.dvisvgm: fix for our ghostscript

This commit is contained in:
Dmitry Kalinkin 2019-12-08 22:59:45 -05:00
parent 254790650e
commit d26ca8bc66
No known key found for this signature in database
GPG key ID: 5157B3EC8B2CA333
2 changed files with 31 additions and 0 deletions

View file

@ -261,6 +261,21 @@ dvisvgm = stdenv.mkDerivation {
inherit (common) src;
patches = [
# Fix for ghostscript>=9.27
# Backport of
# https://github.com/mgieseki/dvisvgm/commit/bc51951bc90b700c28ea018993bdb058e5271e9b
./dvisvgm-fix.patch
# Needed for ghostscript>=9.50
(fetchpatch {
url = "https://github.com/mgieseki/dvisvgm/commit/7b93a9197b69305429183affd24fa40ee04a663a.patch";
sha256 = "1gmj76ja9xng39wxckhs9q140abixgb8rkrcfv2cdgq786wm3vag";
stripLen = 1;
extraPrefix = "texk/dvisvgm/dvisvgm-src/";
})
];
nativeBuildInputs = [ pkgconfig ];
# TODO: dvisvgm still uses vendored dependencies
buildInputs = [ core/*kpathsea*/ ghostscript zlib freetype potrace xxHash ];

View file

@ -0,0 +1,16 @@
diff a/texk/dvisvgm/dvisvgm-src/src/psdefs.cpp b/texk/dvisvgm/dvisvgm-src/src/psdefs.cpp
--- a/texk/dvisvgm/dvisvgm-src/src/psdefs.cpp
+++ b/texk/dvisvgm/dvisvgm-src/src/psdefs.cpp
@@ -107,8 +107,7 @@ const char *PSInterpreter::PSDEFS =
"dmode sysexec<</Normal 0/Compatible 0/Multiply 1/Screen 2/Overlay 3/SoftLight "
"4/HardLight 5/ColorDodge 6/ColorBurn 7/Darken 8/Lighten 9/Difference 10/Exclus"
"ion 11/Hue 12/Saturation 13/Color 14/Luminosity 15/CompatibleOverprint 16>>exc"
-"h get 1(setblendmode)prcmd}def/@pdfpagecount{GS_PDF_ProcSet begin pdfdict begi"
-"n(r)file pdfopen begin pdfpagecount currentdict pdfclose end end end}def/@pdfp"
-"agebox{GS_PDF_ProcSet begin pdfdict begin(r)file pdfopen begin dup dup 1 lt ex"
-"ch pdfpagecount gt or{pop}{pdfgetpage/MediaBox pget pop aload pop}ifelse curre"
-"ntdict pdfclose end end end}def DELAYBIND{.bindnow}if ";
+"h get 1(setblendmode)prcmd}def/@pdfpagecount{(r)file runpdfbegin pdfpagecount "
+"runpdfend}def/@pdfpagebox{(r)file runpdfbegin dup dup 1 lt exch pdfpagecount g"
+"t or{pop}{pdfgetpage/MediaBox pget pop aload pop}ifelse runpdfend}def DELAYBIN"
+"D{.bindnow}if ";