texlive.bin.dvisvgm: 3.0.3 -> 3.1.2 (#294817)

Build dvisvgm from upstream sources to align with binaries distributed
by TeX Live.
This commit is contained in:
Vincenzo Mantova 2024-03-11 20:12:51 +00:00 committed by GitHub
parent ef12e2a930
commit 12ee5fb271
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -322,44 +322,25 @@ context = stdenv.mkDerivation rec {
}; };
}; };
dvisvgm = stdenv.mkDerivation { dvisvgm = stdenv.mkDerivation rec {
pname = "dvisvgm"; pname = "dvisvgm";
inherit (texlive.pkgs.dvisvgm) version; version = "3.1.2";
inherit (common) src; src = assert lib.assertMsg (version == texlive.pkgs.dvisvgm.version) "dvisvgm: TeX Live version (${texlive.pkgs.dvisvgm.version}) different from source (${version}), please update dvisvgm"; fetchurl {
url = "https://github.com/mgieseki/dvisvgm/releases/download/${version}/dvisvgm-${version}.tar.gz";
hash = "sha256-vqeDrf6TG3eUoMMNeQK4Kw1NmtaBbc2KCVqTHNM+rPY=";
};
patches = [ configureFlags = [
# do not use deprecated NEWPDF option with Ghostscript >= 10.02.0 "--disable-manpage" # man pages are provided by the doc container
# https://github.com/mgieseki/dvisvgm/issues/245
(fetchpatch {
name = "dont-use-NEWPDF-with-GS-10.02.0.patch";
url = "https://github.com/mgieseki/dvisvgm/commit/f31cdf14d73f586e2b92b4b0891d097a90274a0b.patch";
hash = "sha256-Yf/GhmJYM87M0ITZ/+7q2ZvSYnac4N2/NkTkFlJ2VII=";
stripLen = 1;
extraPrefix = "texk/dvisvgm/dvisvgm-src/";
})
]; ];
# since we are running configure directly in texk/dvisvgm, # PDF handling requires mutool (from mupdf) since Ghostscript 10.01
# the option --with-system-potrace is not picked up properly
# and dvisvgm tries to build a vendored copy of potrace
postPatch = '' postPatch = ''
cat > texk/dvisvgm/dvisvgm-src/libs/potrace/Makefile <<EOF substituteInPlace src/PDFHandler.cpp \
all: --replace-fail 'Process("mutool"' "Process(\"$(PATH="$HOST_PATH" command -v mutool)\""
install:
EOF
'' +
# PDF handling requires mutool (from mupdf) since Ghostscript 10.01
''
substituteInPlace texk/dvisvgm/dvisvgm-src/src/PDFHandler.cpp \
--replace 'Process("mutool"' "Process(\"$(PATH="$HOST_PATH" command -v mutool)\""
''; '';
preConfigure = "cd texk/dvisvgm";
configureFlags = common.configureFlags
++ [ "--with-system-kpathsea" ];
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ core brotli ghostscript zlib freetype woff2 potrace xxHash mupdf-headless ]; buildInputs = [ core brotli ghostscript zlib freetype woff2 potrace xxHash mupdf-headless ];