From 2ffe681e668795f778fe8d76a401bbf58020f163 Mon Sep 17 00:00:00 2001 From: Leo Gaskin Date: Sun, 2 May 2021 21:50:09 +0200 Subject: [PATCH 1/4] texlive: 2020 -> 2021 --- pkgs/tools/typesetting/tex/texlive/bin.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index fb9b748b5d0..f6395c303c7 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -14,16 +14,16 @@ let withSystemLibs = map (libname: "--with-system-${libname}"); - year = "2020"; + year = "2021"; version = year; # keep names simple for now common = { src = fetchurl { urls = [ - "http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${year}/texlive-${year}0406-source.tar.xz" - "ftp://tug.ctan.org/pub/tex/historic/systems/texlive/${year}/texlive-${year}0406-source.tar.xz" + "http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${year}/texlive-${year}0325-source.tar.xz" + "ftp://tug.ctan.org/pub/tex/historic/systems/texlive/${year}/texlive-${year}0325-source.tar.xz" ]; - sha256 = "0y4h4j2qg714srhvf1hvn165w7sanr1j2vzrsgc23kxvrc43sbz3"; + sha256 = "0jsq1p66l46k2qq0gbqmx25flj2nprsz4wrd1ybn286p11kdkvvs"; }; prePatch = '' From 7bf9a3b2505af37213753b062dd594b91ee513bb Mon Sep 17 00:00:00 2001 From: Leo Gaskin Date: Sun, 2 May 2021 21:52:24 +0200 Subject: [PATCH 2/4] texlive.bin: fix for replacement of poppler with pplib TeXLive no longer depends on or supports poppler, instead using the homegrown pplib library. --- pkgs/tools/typesetting/tex/texlive/bin.nix | 13 +++++-------- pkgs/tools/typesetting/tex/texlive/default.nix | 3 +-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index f6395c303c7..022214e3fe7 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -3,7 +3,7 @@ , zlib, libiconv, libpng, libX11 , freetype, gd, libXaw, icu, ghostscript, libXpm, libXmu, libXext , perl, perlPackages, python3Packages, pkg-config -, poppler, libpaper, graphite2, zziplib, harfbuzz, potrace, gmp, mpfr +, libpaper, graphite2, zziplib, harfbuzz, potrace, gmp, mpfr , brotli, cairo, pixman, xorg, clisp, biber, woff2, xxHash , makeWrapper, shortenPerlShebang }: @@ -30,8 +30,6 @@ let for i in texk/kpathsea/mktex*; do sed -i '/^mydir=/d' "$i" done - cp -pv texk/web2c/pdftexdir/pdftoepdf{-poppler0.86.0,}.cc - cp -pv texk/web2c/pdftexdir/pdftosrc{-poppler0.83.0,}.cc ''; configureFlags = [ @@ -43,9 +41,8 @@ let ] ++ withSystemLibs [ # see "from TL tree" vs. "Using installed" in configure output - "zziplib" "xpdf" "poppler" "mpfr" "gmp" + "zziplib" "xpdf" "mpfr" "gmp" "pixman" "potrace" "gd" "freetype2" "libpng" "libpaper" "zlib" - # beware: xpdf means to use stuff from poppler :-/ ]; # clean broken links to stuff not built @@ -73,7 +70,7 @@ core = stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; buildInputs = [ - /*teckit*/ zziplib poppler mpfr gmp + /*teckit*/ zziplib mpfr gmp pixman gd freetype libpng libpaper zlib perl ]; @@ -82,7 +79,7 @@ core = stdenv.mkDerivation rec { preConfigure = '' rm -r libs/{cairo,freetype2,gd,gmp,graphite2,harfbuzz,icu,libpaper,libpng} \ - libs/{lua53,luajit,mpfr,pixman,poppler,xpdf,zlib,zziplib} + libs/{lua53,luajit,mpfr,pixman,zlib,zziplib} mkdir WorkDir cd WorkDir ''; @@ -178,7 +175,7 @@ core-big = stdenv.mkDerivation { #TODO: upmendex luajit = lib.optionalString withLuaJIT ",luajit"; in '' mkdir ./WorkDir && cd ./WorkDir - for path in libs/{teckit,lua53${luajit}} texk/web2c; do + for path in libs/{pplib,teckit,lua53${luajit}} texk/web2c; do ( if [[ "$path" =~ "libs/lua" ]]; then extraConfig="--enable-static --disable-shared" diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index 52521a80809..4ba42cbce57 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -3,7 +3,7 @@ - current html: https://nixos.org/nixpkgs/manual/#sec-language-texlive */ { stdenv, lib, fetchurl, runCommand, writeText, buildEnv -, callPackage, ghostscriptX, harfbuzz, poppler_min +, callPackage, ghostscriptX, harfbuzz , makeWrapper, python3, ruby, perl , useFixedHashes ? true , recurseIntoAttrs @@ -11,7 +11,6 @@ let # various binaries (compiled) bin = callPackage ./bin.nix { - poppler = poppler_min; # otherwise depend on various X stuff ghostscript = ghostscriptX; harfbuzz = harfbuzz.override { withIcu = true; withGraphite2 = true; From dbc6e67bb3790949fb8394ad36fd946b34beceb9 Mon Sep 17 00:00:00 2001 From: Leo Gaskin Date: Sun, 2 May 2021 22:00:20 +0200 Subject: [PATCH 3/4] texlive.bin: Use xpdf provided by TeXLive This is done because the xpdf provided by Nixpkgs is marked as insecure. Granted, the version provided by TeXLive also has these vulnerabilities, but it might be okay to treat them as irrelevant in the context of TeX. --- pkgs/tools/typesetting/tex/texlive/bin.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index 022214e3fe7..0c496318e48 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -41,7 +41,7 @@ let ] ++ withSystemLibs [ # see "from TL tree" vs. "Using installed" in configure output - "zziplib" "xpdf" "mpfr" "gmp" + "zziplib" "mpfr" "gmp" "pixman" "potrace" "gd" "freetype2" "libpng" "libpaper" "zlib" ]; From f4ec650cdea7cb398de5fb654096590763c21bdc Mon Sep 17 00:00:00 2001 From: Leo Gaskin Date: Sun, 2 May 2021 22:03:02 +0200 Subject: [PATCH 4/4] texlive.bin.dvisvgm: Use version provided by TeXLive The dvisvgm version provided by TeXLive now includes the fixes mentioned in the attached issue and thus can be used again instead of relying on upstream sources. --- pkgs/tools/typesetting/tex/texlive/bin.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index 0c496318e48..1c3d5929636 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -244,18 +244,17 @@ chktex = stdenv.mkDerivation { dvisvgm = stdenv.mkDerivation rec { pname = "texlive-dvisvgm.bin"; - version = "2.11"; - # TODO: dvisvgm was switched to build from upstream sources - # to address https://github.com/NixOS/nixpkgs/issues/104847 - # We might want to consider reverting that change in the future. + inherit version; - src = fetchurl { - url = "https://github.com/mgieseki/dvisvgm/releases/download/${version}/dvisvgm-${version}.tar.gz"; - sha256 = "12b6h0h8rc487yjh3sq9zsdabm9cs2vqcrb0znnfi8277f87zf3j"; - }; + inherit (common) src; + + preConfigure = "cd texk/dvisvgm"; + + configureFlags = common.configureFlags + ++ [ "--with-system-kpathsea" ]; nativeBuildInputs = [ pkg-config ]; - buildInputs = [ core/*kpathsea*/ brotli ghostscript zlib freetype woff2 potrace xxHash ]; + buildInputs = [ core brotli ghostscript zlib freetype woff2 potrace xxHash ]; enableParallelBuilding = true; };