texlive: 2019 -> 2020
Also change default package version from texlive year to a revision. The problem with using texlive year is that it will change on each of our update even if the package itself was not updated. The texlive SVN revision number should not change unless the package is updated. This will allow to share more store paths between different texlive versions.
This commit is contained in:
parent
d2a3ac31b6
commit
10438ba4fa
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, fetchpatch, patchutils
|
{ stdenv, fetchurl
|
||||||
, texlive
|
, texlive
|
||||||
, zlib, libiconv, libpng, libX11
|
, zlib, libiconv, libpng, libX11
|
||||||
, freetype, gd, libXaw, icu, ghostscript, libXpm, libXmu, libXext
|
, freetype, gd, libXaw, icu, ghostscript, libXpm, libXmu, libXext
|
||||||
@ -14,78 +14,26 @@
|
|||||||
let
|
let
|
||||||
withSystemLibs = map (libname: "--with-system-${libname}");
|
withSystemLibs = map (libname: "--with-system-${libname}");
|
||||||
|
|
||||||
year = "2019";
|
year = "2020";
|
||||||
version = year; # keep names simple for now
|
version = year; # keep names simple for now
|
||||||
|
|
||||||
common = {
|
common = {
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
urls = [
|
urls = [
|
||||||
"http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${year}/texlive-${year}0410-source.tar.xz"
|
"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}0410-source.tar.xz"
|
"ftp://tug.ctan.org/pub/tex/historic/systems/texlive/${year}/texlive-${year}0406-source.tar.xz"
|
||||||
];
|
];
|
||||||
sha256 = "1dfps39q6bdr1zsbp9p74mvalmy3bycihv19sb9c6kg30kprz8nj";
|
sha256 = "0y4h4j2qg714srhvf1hvn165w7sanr1j2vzrsgc23kxvrc43sbz3";
|
||||||
};
|
};
|
||||||
|
|
||||||
prePatch = let
|
prePatch = ''
|
||||||
# The source compatible with Poppler ${popplerVersion} not yet available in TeXLive ${year}
|
|
||||||
# so we need to use files introduced in https://www.tug.org/svn/texlive?view=revision&revision=52959
|
|
||||||
popplerVersion = "0.83.0";
|
|
||||||
pdftoepdf = let
|
|
||||||
revert-pdfmajorversion = fetchpatch {
|
|
||||||
name = "pdftoepdf-revert-pdfmajorversion.patch";
|
|
||||||
url = "https://www.tug.org/svn/texlive/trunk/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc?view=patch&r1=52953&r2=52952&pathrev=52953";
|
|
||||||
sha256 = "19jiv5xbvnfdk8lj6yd6mdxgs8f313a4dwg8svjj90dd35kjcfh8";
|
|
||||||
revert = true;
|
|
||||||
postFetch = ''
|
|
||||||
# The default file, changed by this patch, contains a branch for vendored Poppler
|
|
||||||
# The version-specific file replaces the section with an error, so we need to drop that part from the patch.
|
|
||||||
# Fortunately, there is not anything else in the patch after #else.
|
|
||||||
sed '/ #else/q' $out > "$tmpfile"
|
|
||||||
${patchutils}/bin/recountdiff "$tmpfile" > "$out"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in fetchurl {
|
|
||||||
name = "pdftoepdf-poppler${popplerVersion}.cc";
|
|
||||||
url = "https://www.tug.org/svn/texlive/trunk/Build/source/texk/web2c/pdftexdir/pdftoepdf-poppler${popplerVersion}.cc?revision=52959&view=co&pathrev=52959";
|
|
||||||
sha256 = "0pngvw1jgnm4cqskrzf5a3z8rj4ssl10007n3wbblj50hvvzjph3";
|
|
||||||
postFetch = ''
|
|
||||||
# The trunk added some extra arguments to certain functions so we need to revert that
|
|
||||||
# https://www.tug.org/svn/texlive?view=revision&revision=52953
|
|
||||||
patch $out < ${revert-pdfmajorversion}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
pdftosrc = fetchurl {
|
|
||||||
name = "pdftosrc-poppler${popplerVersion}.cc";
|
|
||||||
url = "https://www.tug.org/svn/texlive/trunk/Build/source/texk/web2c/pdftexdir/pdftosrc-poppler${popplerVersion}.cc?revision=52959&view=co&pathrev=52959";
|
|
||||||
sha256 = "0iq2cmwvf2lxy32sygrafwqgcwvvbdnvxm5l3mrg9cb2a1g06380";
|
|
||||||
};
|
|
||||||
in ''
|
|
||||||
for i in texk/kpathsea/mktex*; do
|
for i in texk/kpathsea/mktex*; do
|
||||||
sed -i '/^mydir=/d' "$i"
|
sed -i '/^mydir=/d' "$i"
|
||||||
done
|
done
|
||||||
cp -pv ${pdftoepdf} texk/web2c/pdftexdir/pdftoepdf.cc
|
cp -pv texk/web2c/pdftexdir/pdftoepdf{-poppler0.86.0,}.cc
|
||||||
cp -pv ${pdftosrc} texk/web2c/pdftexdir/pdftosrc.cc
|
cp -pv texk/web2c/pdftexdir/pdftosrc{-poppler0.83.0,}.cc
|
||||||
'';
|
'';
|
||||||
|
|
||||||
patches = [
|
|
||||||
# poppler 0.84 compat fixups, use 0.83 files otherwise
|
|
||||||
./poppler84.patch
|
|
||||||
|
|
||||||
(fetchpatch {
|
|
||||||
name = "texlive-poppler-0.86.patch";
|
|
||||||
url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/texlive-poppler-0.86.patch?h=packages/texlive-bin&id=60244e41bb6f1501e8ed1fc9e6b7ba8d3f283398";
|
|
||||||
sha256 = "0pdvhaqc3zgz7hp0x3a4qs0nh26fkvgmr6w1cjljqhp1nyiw2f1l";
|
|
||||||
})
|
|
||||||
|
|
||||||
# Needed for ghostscript>=9.50
|
|
||||||
(fetchpatch {
|
|
||||||
name = "xdvipdfm-fix.patch";
|
|
||||||
url = "https://www.tug.org/svn/texlive/trunk/Build/source/texk/dvipdfm-x/spc_dvips.c?view=patch&r1=52765&r2=52764&pathrev=52765";
|
|
||||||
sha256 = "0qvrc7yxhbl5f4g340z8aql388bwib0m2gxd473skbmviy5bjr3f";
|
|
||||||
stripLen = 2;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
# remove when removing synctex-missing-header.patch
|
# remove when removing synctex-missing-header.patch
|
||||||
preAutoreconf = "pushd texk/web2c";
|
preAutoreconf = "pushd texk/web2c";
|
||||||
postAutoreconf = "popd";
|
postAutoreconf = "popd";
|
||||||
@ -123,7 +71,7 @@ core = stdenv.mkDerivation rec {
|
|||||||
pname = "texlive-bin";
|
pname = "texlive-bin";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
inherit (common) src patches prePatch preAutoreconf postAutoreconf;
|
inherit (common) src prePatch preAutoreconf postAutoreconf;
|
||||||
|
|
||||||
outputs = [ "out" "doc" ];
|
outputs = [ "out" "doc" ];
|
||||||
|
|
||||||
@ -149,7 +97,7 @@ core = stdenv.mkDerivation rec {
|
|||||||
++ map (what: "--disable-${what}") [
|
++ map (what: "--disable-${what}") [
|
||||||
"chktex"
|
"chktex"
|
||||||
"dvisvgm" "dvipng" # ghostscript dependency
|
"dvisvgm" "dvipng" # ghostscript dependency
|
||||||
"luatex" "luajittex"
|
"luatex" "luajittex" "luahbtex" "luajithbtex"
|
||||||
"mp" "pmp" "upmp" "mf" "mflua" "mfluajit" # cairo would bring in X and more
|
"mp" "pmp" "upmp" "mf" "mflua" "mfluajit" # cairo would bring in X and more
|
||||||
"xetex" "bibtexu" "bibtex8" "bibtex-x" "upmendex" # ICU isn't small
|
"xetex" "bibtexu" "bibtex8" "bibtex-x" "upmendex" # ICU isn't small
|
||||||
];
|
];
|
||||||
@ -208,12 +156,12 @@ core = stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inherit (core-big) metafont mflua metapost luatex luajittex xetex;
|
inherit (core-big) metafont mflua metapost luatex luahbtex luajittex xetex;
|
||||||
core-big = stdenv.mkDerivation { #TODO: upmendex
|
core-big = stdenv.mkDerivation { #TODO: upmendex
|
||||||
pname = "texlive-core-big.bin";
|
pname = "texlive-core-big.bin";
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
||||||
inherit (common) src patches prePatch preAutoreconf postAutoreconf;
|
inherit (common) src prePatch preAutoreconf postAutoreconf;
|
||||||
|
|
||||||
hardeningDisable = [ "format" ];
|
hardeningDisable = [ "format" ];
|
||||||
|
|
||||||
@ -225,7 +173,7 @@ core-big = stdenv.mkDerivation { #TODO: upmendex
|
|||||||
++ map (prog: "--disable-${prog}") # don't build things we already have
|
++ map (prog: "--disable-${prog}") # don't build things we already have
|
||||||
([ "tex" "ptex" "eptex" "uptex" "euptex" "aleph" "pdftex"
|
([ "tex" "ptex" "eptex" "uptex" "euptex" "aleph" "pdftex"
|
||||||
"web-progs" "synctex"
|
"web-progs" "synctex"
|
||||||
] ++ stdenv.lib.optionals (!withLuaJIT) [ "luajittex" "mfluajit" ]);
|
] ++ stdenv.lib.optionals (!withLuaJIT) [ "luajittex" "luajithbtex" "mfluajit" ]);
|
||||||
|
|
||||||
configureScript = ":";
|
configureScript = ":";
|
||||||
|
|
||||||
@ -261,6 +209,7 @@ core-big = stdenv.mkDerivation { #TODO: upmendex
|
|||||||
"mflua"
|
"mflua"
|
||||||
"metapost"
|
"metapost"
|
||||||
"luatex"
|
"luatex"
|
||||||
|
"luahbtex"
|
||||||
"luajittex"
|
"luajittex"
|
||||||
"xetex"
|
"xetex"
|
||||||
];
|
];
|
||||||
@ -273,10 +222,11 @@ core-big = stdenv.mkDerivation { #TODO: upmendex
|
|||||||
mv "$out/bin"/mflua{,-nowin} "$mflua/bin/"
|
mv "$out/bin"/mflua{,-nowin} "$mflua/bin/"
|
||||||
mv "$out/bin"/{*tomp,mfplain,*mpost} "$metapost/bin/"
|
mv "$out/bin"/{*tomp,mfplain,*mpost} "$metapost/bin/"
|
||||||
mv "$out/bin"/{luatex,texlua,texluac} "$luatex/bin/"
|
mv "$out/bin"/{luatex,texlua,texluac} "$luatex/bin/"
|
||||||
|
mv "$out/bin"/luahbtex "$luahbtex/bin/"
|
||||||
mv "$out/bin"/xetex "$xetex/bin/"
|
mv "$out/bin"/xetex "$xetex/bin/"
|
||||||
'' + stdenv.lib.optionalString withLuaJIT ''
|
'' + stdenv.lib.optionalString withLuaJIT ''
|
||||||
mv "$out/bin"/mfluajit{,-nowin} "$mflua/bin/"
|
mv "$out/bin"/mfluajit{,-nowin} "$mflua/bin/"
|
||||||
mv "$out/bin"/{luajittex,texluajit,texluajitc} "$luajittex/bin/"
|
mv "$out/bin"/{luajittex,luajithbtex,texluajit,texluajitc} "$luajittex/bin/"
|
||||||
'' ;
|
'' ;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -305,31 +255,12 @@ dvisvgm = stdenv.mkDerivation {
|
|||||||
|
|
||||||
inherit (common) src;
|
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 ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
# TODO: dvisvgm still uses vendored dependencies
|
# 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";
|
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
|
configureFlags = common.configureFlags
|
||||||
++ [ "--with-system-kpathsea" ];
|
++ [ "--with-system-kpathsea" ];
|
||||||
|
|
||||||
@ -346,15 +277,6 @@ dvipng = stdenv.mkDerivation {
|
|||||||
nativeBuildInputs = [ perl pkgconfig ];
|
nativeBuildInputs = [ perl pkgconfig ];
|
||||||
buildInputs = [ core/*kpathsea*/ zlib libpng freetype gd ghostscript makeWrapper ];
|
buildInputs = [ core/*kpathsea*/ zlib libpng freetype gd ghostscript makeWrapper ];
|
||||||
|
|
||||||
patches = [
|
|
||||||
(fetchpatch {
|
|
||||||
url = "http://git.savannah.nongnu.org/cgit/dvipng.git/patch/?id=f3ff241827a587e3d39eda477041fd3280f5b245";
|
|
||||||
sha256 = "1a0ixl9mga24p6xk8dy3v60yifvbzd27vs0hv8996rfkp8jqa7is";
|
|
||||||
stripLen = 1;
|
|
||||||
extraPrefix = "texk/dvipng/dvipng-src/";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
cd texk/dvipng
|
cd texk/dvipng
|
||||||
patchShebangs doc/texi2pod.pl
|
patchShebangs doc/texi2pod.pl
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
- source: ../../../../../doc/languages-frameworks/texlive.xml
|
- source: ../../../../../doc/languages-frameworks/texlive.xml
|
||||||
- current html: https://nixos.org/nixpkgs/manual/#sec-language-texlive
|
- current html: https://nixos.org/nixpkgs/manual/#sec-language-texlive
|
||||||
*/
|
*/
|
||||||
{ stdenv, lib, fetchurl, fetchpatch, runCommand, writeText, buildEnv
|
{ stdenv, lib, fetchurl, runCommand, writeText, buildEnv
|
||||||
, callPackage, ghostscriptX, harfbuzz, poppler_min
|
, callPackage, ghostscriptX, harfbuzz, poppler_min
|
||||||
, makeWrapper, python, ruby, perl
|
, makeWrapper, python, ruby, perl
|
||||||
, useFixedHashes ? true
|
, useFixedHashes ? true
|
||||||
@ -57,21 +57,6 @@ let
|
|||||||
collection-plaingeneric = orig.collection-plaingeneric // {
|
collection-plaingeneric = orig.collection-plaingeneric // {
|
||||||
deps = orig.collection-plaingeneric.deps // { inherit (tl) xdvi; };
|
deps = orig.collection-plaingeneric.deps // { inherit (tl) xdvi; };
|
||||||
};
|
};
|
||||||
|
|
||||||
# TODO revert for texlive 2020
|
|
||||||
arara = lib.recursiveUpdate orig.arara {
|
|
||||||
postUnpack = let
|
|
||||||
arara_jar_fix = fetchpatch {
|
|
||||||
url = "https://github.com/TeX-Live/texlive-source/commit/dbaf12f4a47dcd62bcc96346f65493fda3fec2c8.diff";
|
|
||||||
sha256 = "148knr8k6sm6fpyj31kdq85yxvzvwp1prjha3f07q24kbar2l830";
|
|
||||||
};
|
|
||||||
in ''
|
|
||||||
if [ -f "$out"/scripts/arara/arara.sh ]; then
|
|
||||||
cd "$out"/scripts/
|
|
||||||
patch -p4 <${arara_jar_fix}
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}); # overrides
|
}); # overrides
|
||||||
|
|
||||||
# tl =
|
# tl =
|
||||||
@ -81,7 +66,7 @@ let
|
|||||||
|
|
||||||
flatDeps = pname: attrs:
|
flatDeps = pname: attrs:
|
||||||
let
|
let
|
||||||
version = attrs.version or bin.texliveYear;
|
version = attrs.version or (builtins.toString attrs.revision);
|
||||||
mkPkgV = tlType: let
|
mkPkgV = tlType: let
|
||||||
pkg = attrs // {
|
pkg = attrs // {
|
||||||
sha512 = attrs.sha512.${tlType};
|
sha512 = attrs.sha512.${tlType};
|
||||||
@ -112,15 +97,7 @@ let
|
|||||||
fixedHash = fixedHashes.${tlName} or null; # be graceful about missing hashes
|
fixedHash = fixedHashes.${tlName} or null; # be graceful about missing hashes
|
||||||
|
|
||||||
urls = args.urls or (if args ? url then [ args.url ] else
|
urls = args.urls or (if args ? url then [ args.url ] else
|
||||||
lib.concatMap
|
map (up: "${up}/${urlName}.r${toString revision}.tar.xz") urlPrefixes);
|
||||||
(up: [
|
|
||||||
# Only ~11% of packages in texlive 2019 have revisions, so
|
|
||||||
# the number of requests is nearly doubled if we lookup
|
|
||||||
# the name with revision
|
|
||||||
# "${up}/${urlName}.r${toString revision}.tar.xz"
|
|
||||||
"${up}/${urlName}.tar.xz" # TODO To be removed for texlive 2020?
|
|
||||||
])
|
|
||||||
urlPrefixes);
|
|
||||||
|
|
||||||
# The tarballs on CTAN mirrors for the current release are constantly
|
# The tarballs on CTAN mirrors for the current release are constantly
|
||||||
# receiving updates, so we can't use those directly. Stable snapshots
|
# receiving updates, so we can't use those directly. Stable snapshots
|
||||||
@ -129,11 +106,11 @@ let
|
|||||||
# (https://tug.org/historic/).
|
# (https://tug.org/historic/).
|
||||||
urlPrefixes = args.urlPrefixes or [
|
urlPrefixes = args.urlPrefixes or [
|
||||||
# tlnet-final snapshot
|
# tlnet-final snapshot
|
||||||
"http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2019/tlnet-final/archive"
|
#"http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2019/tlnet-final/archive"
|
||||||
"ftp://tug.org/texlive/historic/2019/tlnet-final/archive"
|
#"ftp://tug.org/texlive/historic/2019/tlnet-final/archive"
|
||||||
|
|
||||||
# Daily snapshots hosted by one of the texlive release managers
|
# Daily snapshots hosted by one of the texlive release managers
|
||||||
#https://texlive.info/tlnet-archive/2019/10/19/tlnet/archive
|
https://texlive.info/tlnet-archive/2020/10/09/tlnet/archive
|
||||||
];
|
];
|
||||||
|
|
||||||
src = fetchurl { inherit urls sha512; };
|
src = fetchurl { inherit urls sha512; };
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user