Merge pull request #75335 from veprbl/pr/texlive-bin-dvisvgm_fix

texlive.bin.dvisvgm: fix
This commit is contained in:
Dmitry Kalinkin 2019-12-11 00:21:41 -05:00 committed by GitHub
commit 9e58ecd4ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 1 deletions

View File

@ -261,9 +261,24 @@ 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 ];
buildInputs = [ core/*kpathsea*/ ghostscript zlib freetype /*potrace xxHash*/ ];
preConfigure = "cd texk/dvisvgm";

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 ";