Skip to content

Commit

Permalink
Merge pull request #71419 from veprbl/pr/texlive-2019
Browse files Browse the repository at this point in the history
texlive: 2018 -> 2019, poppler: 0.74.0 -> 0.81.0
  • Loading branch information
veprbl committed Nov 8, 2019
2 parents b53e773 + deaaf82 commit 6fa62db
Show file tree
Hide file tree
Showing 8 changed files with 12,504 additions and 11,487 deletions.
10 changes: 9 additions & 1 deletion pkgs/applications/graphics/inkscape/default.nix
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, perlPackages, libXft
{ stdenv, fetchurl, fetchpatch, pkgconfig, perlPackages, libXft
, libpng, zlib, popt, boehmgc, libxml2, libxslt, glib, gtkmm2
, glibmm, libsigcxx, lcms, boost, gettext, makeWrapper
, gsl, gtkspell2, cairo, python2, poppler, imagemagick, libwpg, librevenge
Expand All @@ -19,6 +19,14 @@ stdenv.mkDerivation rec {
sha256 = "0pjinhjibfsz1aywdpgpj3k23xrsszpj4a1ya5562dkv2yl2vv2p";
};

patches = [
(fetchpatch {
name = "inkscape-poppler_0_76_compat.patch";
url = "https://gitlab.com/inkscape/inkscape/commit/e831b034746f8dc3c3c1b88372751f6dcb974831.diff";
sha256 = "096rdyi6ppjq1h9jwwsm9hb99nggfrfinik8rm23jkn4h2zl01zf";
})
];

# Inkscape hits the ARGMAX when linking on macOS. It appears to be
# CMake’s ARGMAX check doesn’t offer enough padding for NIX_LDFLAGS.
# Setting strictDeps it avoids duplicating some dependencies so it
Expand Down
14 changes: 3 additions & 11 deletions pkgs/development/libraries/poppler/default.nix
Expand Up @@ -7,28 +7,20 @@
, minimal ? false, suffix ? "glib"
}:

let # beware: updates often break cups-filters build
version = "0.74.0";
let
mkFlag = optset: flag: "-DENABLE_${flag}=${if optset then "on" else "off"}";
in
stdenv.mkDerivation rec {
name = "poppler-${suffix}-${version}";
version = "0.81.0"; # beware: updates often break cups-filters build

src = fetchurl {
url = "${meta.homepage}/poppler-${version}.tar.xz";
sha256 = "0bvb0yq9zsl2b811j4l4x0vf8g5lgmqbndkb2hvgsrr5639rzq4j";
sha256 = "00pykc7nym3xg0wc60awv0i35zwdfyn0igb6jrnb6rsv0c5h4b91";
};

outputs = [ "out" "dev" ];

patches = [
(fetchpatch {
name = "CVE-2019-9959.patch";
url = "https://gitlab.freedesktop.org/poppler/poppler/commit/68ef84e5968a4249c2162b839ca6d7975048a557.patch";
sha256 = "17a3qs74fnnrhjys23f4aw5y7yfsk5d507jcj4hh1bndqv6dpwg1";
})
];

buildInputs = [ libiconv libintl ] ++ lib.optional withData poppler_data;

# TODO: reduce propagation to necessary libs
Expand Down
17 changes: 2 additions & 15 deletions pkgs/tools/typesetting/biber/default.nix
Expand Up @@ -10,26 +10,13 @@ perlPackages.buildPerlModule {

src = "${biberSource}/source/bibtex/biber/biblatex-biber.tar.gz";

patches = stdenv.lib.optionals (stdenv.lib.versionAtLeast perlPackages.perl.version "5.30") [
(fetchpatch {
name = "biber-fix-tests.patch";
url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/biber-fix-tests.patch?h=5d0fffd493550e28b2fb81ad114d62a7c9403812";
sha256 = "1ninf46bxf4hm0p5arqbxqyv8r98xdwab34vvp467q1v23kfbhya";
})

(fetchpatch {
name = "biber-fix-tests-2.patch";
url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/biber-fix-tests-2.patch?h=5d0fffd493550e28b2fb81ad114d62a7c9403812";
sha256 = "1l8pk454kkm0szxrv9rv9m2a0llw1jm7ffhgpyg4zfiw246n62x0";
})
];

# TODO: remove TextBibTeX for biber 2.14: https://github.com/plk/biber/blob/dev/Changes
buildInputs = with perlPackages; [
autovivification BusinessISBN BusinessISMN BusinessISSN ConfigAutoConf
DataCompare DataDump DateSimple EncodeEUCJPASCII EncodeHanExtra EncodeJIS2K
DateTime DateTimeFormatBuilder DateTimeCalendarJulian
ExtUtilsLibBuilder FileSlurper FileWhich IPCRun3 LogLog4perl LWPProtocolHttps ListAllUtils
ListMoreUtils MozillaCA ReadonlyXS RegexpCommon TextBibTeX
ListMoreUtils MozillaCA IOString ReadonlyXS RegexpCommon TextBibTeX
UnicodeLineBreak URI XMLLibXMLSimple XMLLibXSLT XMLWriter
ClassAccessor TextCSV TextCSV_XS TextRoman DataUniqid LinguaTranslit SortKey
TestDifferences
Expand Down
2 changes: 1 addition & 1 deletion pkgs/tools/typesetting/tex/texlive/UPGRADING.md
Expand Up @@ -35,7 +35,7 @@ See <https://tug.org/texlive/acquire-mirror.html> for instructions.


```
$ curl http://mirror.ctan.org/tex-archive/systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz \
$ curl -L http://mirror.ctan.org/tex-archive/systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz \
| xzcat | uniq -u | sed -rn -f ./tl2nix.sed > ./pkgs.nix
```

Expand Down
76 changes: 36 additions & 40 deletions pkgs/tools/typesetting/tex/texlive/bin.nix
@@ -1,10 +1,10 @@
{ stdenv, fetchurl
{ stdenv, fetchurl, fetchpatch
, texlive
, zlib, libiconv, libpng, libX11
, freetype, gd, libXaw, icu, ghostscript, libXpm, libXmu, libXext
, perl, perlPackages, pkgconfig, autoreconfHook
, poppler, libpaper, graphite2, zziplib, harfbuzz, potrace, gmp, mpfr
, cairo, pixman, xorg, clisp, biber
, cairo, pixman, xorg, clisp, biber, xxHash
, makeWrapper, shortenPerlShebang
}:

Expand All @@ -14,49 +14,40 @@
let
withSystemLibs = map (libname: "--with-system-${libname}");

year = "2018";
year = "2019";
version = year; # keep names simple for now

common = {
src = fetchurl {
urls = [
"http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${year}/texlive-${year}0414-source.tar.xz"
"ftp://tug.ctan.org/pub/tex/historic/systems/texlive/${year}/texlive-${year}0414-source.tar.xz"
"http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${year}/texlive-${year}0410-source.tar.xz"
"ftp://tug.ctan.org/pub/tex/historic/systems/texlive/${year}/texlive-${year}0410-source.tar.xz"
];
sha256 = "0khyi6h015r2zfqgg0a44a2j7vmr1cy42knw7jbss237yvakc07y";
sha256 = "1dfps39q6bdr1zsbp9p74mvalmy3bycihv19sb9c6kg30kprz8nj";
};

patches = [
(fetchurl {
name = "poppler-compat-fixes-up-to-0.70.patch";
url = https://git.archlinux.org/svntogit/packages.git/plain/trunk/poppler-compat-fixes-up-to-0.70.patch?h=packages/texlive-bin&id=85ee0539525d8012f134b76c18dfb10d0837a7e2;
sha256 = "0a8bvyl7v6zlyyg3ycl0dmg2g2qahxlq3qmc1nv33r24anzb8xhs";
})
(fetchurl {
name = "luatex-poppler-0.70-const-fixes.patch";
url = https://git.archlinux.org/svntogit/packages.git/plain/trunk/luatex-poppler-0.70-const-fixes.patch?h=packages/texlive-bin&id=85ee0539525d8012f134b76c18dfb10d0837a7e2;
sha256 = "0yiw2x97whdi23dc10xnqpxqj3aja15alir1byp1y03j60zv5n7i";
})
(fetchurl {
name = "texlive-poppler-0.71.patch";
url = https://git.archlinux.org/svntogit/packages.git/plain/trunk/texlive-poppler-0.71.patch?h=packages/texlive-bin&id=85ee0539525d8012f134b76c18dfb10d0837a7e2;
sha256 = "164wibyf786gdcb0ij4svsmyi13wvcx0cpdr4flki0lpy3igvlnq";
})
(fetchurl {
name = "synctex-missing-header.patch";
url = https://git.archlinux.org/svntogit/packages.git/plain/trunk/synctex-missing-header.patch?h=packages/texlive-bin&id=da56abf0f8a1e85daca0ec0f031b8fa268519e6b;
sha256 = "1c4aq8lk8g3mlfq3mdjnxvmhss3qs7nni5rmw0k054dmj6q1xj5n";
] ++ stdenv.lib.optionals (stdenv.lib.versionAtLeast (stdenv.lib.getVersion poppler) "0.76") [
(fetchpatch {
name = "pdftex-poppler0.76.patch";
url = "https://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk/pdftex-poppler0.76.patch?id=8cb784073cfd2299a6c301ce7bb0d89126a47f4e";
sha256 = "04x7myzysranddzjifxhahl7gjy407zkiyzfs5l9cbwzp6pqh7gh";

includes = [
"texk/web2c/pdftexdir/pdftoepdf-poppler0.76.0.cc"
"texk/web2c/pdftexdir/pdftosrc-poppler0.76.0.cc"
];
})
];

postPatch = ''
postPatch = let
popplerSuffix = if (stdenv.lib.versionAtLeast (stdenv.lib.getVersion poppler) "0.76") then "-poppler0.76.0" else "-poppler0.72.0";
in ''
for i in texk/kpathsea/mktex*; do
sed -i '/^mydir=/d' "$i"
done
cp -pv texk/web2c/pdftexdir/pdftoepdf{-poppler0.70.0,}.cc
cp -pv texk/web2c/pdftexdir/pdftosrc{-newpoppler,}.cc
# fix build with poppler 0.71
find texk/web2c/{lua,pdf}texdir -type f | xargs sed -e 's|gTrue|true|g' -e 's|gFalse|false|g' -e 's|GBool|bool|g' -e 's|getCString|c_str|g' -e 's|Gulong|unsigned long|g' -e 's|Guint|unsigned int|g' -e 's|Gushort|unsigned short|g' -e 's|Guchar|unsigned char|g' -i
cp -pv texk/web2c/pdftexdir/pdftoepdf{${popplerSuffix},}.cc
cp -pv texk/web2c/pdftexdir/pdftosrc{${popplerSuffix},}.cc
'';

# remove when removing synctex-missing-header.patch
Expand Down Expand Up @@ -101,15 +92,15 @@ core = stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig autoreconfHook ];
buildInputs = [
/*teckit*/ zziplib poppler mpfr gmp
pixman potrace gd freetype libpng libpaper zlib
pixman gd freetype libpng libpaper zlib
perl
];

hardeningDisable = [ "format" ];

preConfigure = ''
rm -r libs/{cairo,freetype2,gd,gmp,graphite2,harfbuzz,icu,libpaper,libpng} \
libs/{mpfr,pixman,poppler,potrace,xpdf,zlib,zziplib}
libs/{mpfr,pixman,poppler,xpdf,zlib,zziplib}
mkdir WorkDir
cd WorkDir
'';
Expand Down Expand Up @@ -199,8 +190,6 @@ core-big = stdenv.mkDerivation { #TODO: upmendex
++ map (prog: "--disable-${prog}") # don't build things we already have
[ "tex" "ptex" "eptex" "uptex" "euptex" "aleph" "pdftex"
"web-progs" "synctex"
# build fails on Darwin with luatex53
"luatex53" # TODO probably can be removed when TexLive 2019 is out
# luajittex is mostly not needed, see:
# http://tex.stackexchange.com/questions/97999/when-to-use-luajittex-in-favour-of-luatex
"luajittex" "mfluajit"
Expand All @@ -211,8 +200,7 @@ core-big = stdenv.mkDerivation { #TODO: upmendex
# we use static libtexlua, because it's only used by a single binary
postConfigure = ''
mkdir ./WorkDir && cd ./WorkDir
# TODO add lua53 here when luatex53 is enabled again
for path in libs/{teckit,lua52} texk/web2c; do
for path in libs/{teckit,lua53} texk/web2c; do
(
if [[ "$path" =~ "libs/lua5" ]]; then
extraConfig="--enable-static --disable-shared"
Expand Down Expand Up @@ -254,12 +242,17 @@ dvisvgm = stdenv.mkDerivation {
inherit (common) src;

nativeBuildInputs = [ pkgconfig ];
buildInputs = [ core/*kpathsea*/ ghostscript zlib freetype potrace ];
# TODO: dvisvgm still uses vendored dependencies
buildInputs = [ core/*kpathsea*/ ghostscript zlib freetype potrace xxHash ];

preConfigure = "cd texk/dvisvgm";

# configure script has a bug: it refers to $HAVE_LIBGS but sets $have_libgs
# TODO: remove for texlive 2020?
HAVE_LIBGS = 1;

configureFlags = common.configureFlags
++ [ "--with-system-kpathsea" "--with-system-libgs" ];
++ [ "--with-system-kpathsea" ];

enableParallelBuilding = true;
};
Expand All @@ -271,10 +264,13 @@ dvipng = stdenv.mkDerivation {

inherit (common) src;

nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [ perl pkgconfig ];
buildInputs = [ core/*kpathsea*/ zlib libpng freetype gd ghostscript makeWrapper ];

preConfigure = "cd texk/dvipng";
preConfigure = ''
cd texk/dvipng
patchShebangs doc/texi2pod.pl
'';

configureFlags = common.configureFlags
++ [ "--with-system-kpathsea" "--with-gs=yes" "--disable-debug" ];
Expand Down
10 changes: 7 additions & 3 deletions pkgs/tools/typesetting/tex/texlive/default.nix
Expand Up @@ -108,8 +108,12 @@ let
# Common packages should get served from the binary cache anyway.
# See discussions, e.g. https://github.com/NixOS/nixpkgs/issues/24683
urlPrefixes = args.urlPrefixes or [
http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2018/tlnet-final/archive
ftp://tug.org/texlive/historic/2018/tlnet-final/archive
# Mirror hosted by @veprbl
http://146.185.144.154/texlive-2019

# TODO: Upgrade to the final snapshot of the packages before 20.03
#http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2019/tlnet-final/archive
#ftp://tug.org/texlive/historic/2019/tlnet-final/archive
];

src = fetchurl { inherit urls sha512; };
Expand Down Expand Up @@ -178,7 +182,7 @@ in
})
)
{ inherit (tl)
scheme-basic scheme-context scheme-full scheme-gust
scheme-basic scheme-context scheme-full scheme-gust scheme-infraonly
scheme-medium scheme-minimal scheme-small scheme-tetex;
}
);
Expand Down

0 comments on commit 6fa62db

Please sign in to comment.