texlive: 2015 -> 2016

Note: only basic testing has been done so far; also see FIXME items.

AMENDed to reduce git history size significantly:
 - fix 2015->2016 bugs in fixedHashes.nix
 - purge all sha512 from pkgs.nix
This commit is contained in:
Vladimír Čunát 2016-06-21 12:13:24 +02:00
parent 8bf002daac
commit 7de41b9a4b
5 changed files with 12167 additions and 9867 deletions

View File

@ -14,13 +14,14 @@
let
withSystemLibs = map (libname: "--with-system-${libname}");
year = "2015";
year = "2016";
version = year; # keep names simple for now
common = rec {
src = fetchurl {
url = "ftp://tug.org/historic/systems/texlive/${year}/texlive-20150521-source.tar.xz";
sha256 = "ed9bcd7bdce899c3c27c16a8c5c3017c4f09e1d7fd097038351b72497e9d4669";
url = "ftp://tug.org/historic/systems/texlive/${year}/texlive-${year}0523-source.tar.xz";
sha512 = "9fdd69d237238385240e918456f54791a38e57b573edf5df839c57e56a00090"
+ "12b68b7b92298c3e137181325e2be84d7a84e9c7cf41ae9739bb3329d84194564";
};
configureFlags = [
@ -67,8 +68,8 @@ core = stdenv.mkDerivation rec {
preConfigure = ''
rm -r libs/{cairo,freetype2,gd,gmp,graphite2,harfbuzz,icu,libpaper,libpng} \
libs/{mpfr,pixman,poppler,potrace,xpdf,zlib,zziplib}
mkdir Work
cd Work
mkdir WorkDir
cd WorkDir
'';
configureScript = "../configure";
@ -77,7 +78,7 @@ core = stdenv.mkDerivation rec {
++ map (what: "--disable-${what}") [
"dvisvgm" "dvipng" # ghostscript dependency
"luatex" "luajittex" "mp" "pmp" "upmp" "mf" # cairo would bring in X and more
"xetex" "bibtexu" "bibtex8" "bibtex-x" # ICU isn't small
"xetex" "bibtexu" "bibtex8" "bibtex-x" "upmendex" # ICU isn't small
]
++ [ "--without-system-harfbuzz" "--without-system-icu" ] # bogus configure
;
@ -117,7 +118,7 @@ core = stdenv.mkDerivation rec {
inherit (core-big) metafont metapost luatex xetex;
core-big = stdenv.mkDerivation {
core-big = stdenv.mkDerivation { #TODO: upmendex
name = "texlive-core-big.bin-${version}";
inherit (common) src;
@ -128,7 +129,7 @@ core-big = stdenv.mkDerivation {
++ withSystemLibs [ "kpathsea" "ptexenc" "cairo" "harfbuzz" "icu" "graphite2" ]
++ map (prog: "--disable-${prog}") # don't build things we already have
[ "tex" "ptex" "eptex" "uptex" "euptex" "aleph" "pdftex"
"web-progs" "synctex" "luajittex" # luajittex is mostly not needed, see:
"web-progs" "synctex" "luajittex" "mfluajit" # luajittex is mostly not needed, see:
# http://tex.stackexchange.com/questions/97999/when-to-use-luajittex-in-favour-of-luatex
];
@ -136,7 +137,7 @@ core-big = stdenv.mkDerivation {
# we use static libtexlua, because it's only used by a single binary
postConfigure = ''
mkdir ./Work && cd ./Work
mkdir ./WorkDir && cd ./WorkDir
for path in libs/{teckit,lua52} texk/web2c; do
(
if [[ "$path" == "libs/lua52" ]]; then

View File

@ -21,7 +21,7 @@ let
# map: name -> fixed-output hash
# sha1 in base32 was chosen as a compromise between security and length
# warning: the following generator command takes lots of resources
# nix-build -Q -A texlive.scheme-full.pkgs | ./fixHashes.sh > ./fixedHashes.nix
# nix-build ../../../../.. -Q -A texlive.scheme-full.pkgs | ./fixHashes.sh > ./fixedHashes.nix
fixedHashes = lib.optionalAttrs useFixedHashes (import ./fixedHashes.nix);
# function for creating a working environment from a set of TL packages
@ -32,22 +32,13 @@ let
# the set of TeX Live packages, collections, and schemes; using upstream naming
tl = let
/* curl ftp://tug.ctan.org/pub/tex/historic/systems/texlive/2015/tlnet-final/tlpkg/texlive.tlpdb.xz \
/* # beware: the URL below changes contents continuously
curl http://mirror.ctan.org/tex-archive/systems/texlive/tlnet/tlpkg/texlive.tlpdb.xz \
| xzcat | uniq -u | sed -rn -f ./tl2nix.sed > ./pkgs.nix */
orig = import ./pkgs.nix tl;
orig = import ./pkgs.nix tl; # XXX XXX XXX FIXME: the file is probably too big now XXX XXX XXX XXX XXX XXX
clean = orig // {
# overrides of texlive.tlpdb
tetex = orig.tetex // { # 2015.08.27 as we need version with mktexlsr.pl
# TODO: official hashed mirror
urlPrefix = "http://lipa.ms.mff.cuni.cz/~cunav5am/nix";
md5.run = "4b4c0208124dfc9c8244c24421946d36";
md5.doc = "983f5e5b5f4e407760b4ec176cf6a58f";
version = "3.0"; # it's the same
postUnpack = "cd $out && patch -p2 < ${./texlinks.patch} || true";
# TODO: postUnpack per tlType instead of these hacks
};
dvidvi = orig.dvidvi // {
hasRunfiles = false; # only contains docs that's in bin.core.doc already
};
@ -78,7 +69,7 @@ let
version = attrs.version or bin.texliveYear;
mkPkgV = tlType: let
pkg = attrs // {
md5 = attrs.md5.${tlType};
sha512 = attrs.sha512.${tlType};
inherit pname tlType version;
};
in mkPkgs {
@ -93,8 +84,8 @@ let
# the fake derivations are used for filtering of hyphenation patterns
else { inherit pname version; tlType = "run"; }
)]
++ lib.optional (attrs.md5 ? "doc") (mkPkgV "doc")
++ lib.optional (attrs.md5 ? "source") (mkPkgV "source")
++ lib.optional (attrs.sha512 ? "doc") (mkPkgV "doc")
++ lib.optional (attrs.sha512 ? "source") (mkPkgV "source")
++ lib.optional (bin ? ${pname})
( bin.${pname} // { inherit pname; tlType = "bin"; } )
++ combinePkgs (attrs.deps or {});
@ -107,16 +98,18 @@ let
# command to unpack a single TL package
unpackPkg =
{ # url ? null, urlPrefix ? null
md5, pname, tlType, postUnpack ? "", stripPrefix ? 1, ...
sha512, pname, tlType, postUnpack ? "", stripPrefix ? 1, ...
}@args: let
url = args.url or "${urlPrefix}/${mkUrlName args}.tar.xz";
urlPrefix = args.urlPrefix or
("${mirror}/pub/tex/historic/systems/texlive/${bin.texliveYear}/tlnet-final/archive");
# XXX XXX XXX FIXME: mirror the snapshot XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
# ("${mirror}/pub/tex/historic/systems/texlive/${bin.texliveYear}/tlnet-final/archive");
http://mirror.ctan.org/tex-archive/systems/texlive/tlnet/archive;
# beware: standard mirrors http://mirror.ctan.org/ don't have releases
mirror = "http://ftp.math.utah.edu"; # ftp://tug.ctan.org no longer works, although same IP
#mirror = "http://ftp.math.utah.edu"; # ftp://tug.ctan.org no longer works, although same IP
in
rec {
src = fetchurl { inherit url md5; };
src = fetchurl { inherit url sha512; };
unpackCmd = ''
tar -xf '${src}' \
'--strip-components=${toString stripPrefix}' \
@ -133,7 +126,7 @@ let
let
tlName = "${mkUrlName args}-${version}";
fixedHash = fixedHashes.${tlName} or null; # be graceful about missing hashes
pkgs = map unpackPkg (fastUnique (a: b: a.md5 < b.md5) pkgList);
pkgs = map unpackPkg (fastUnique (a: b: a.sha512 < b.sha512) pkgList);
in runCommand "texlive-${tlName}"
( { # lots of derivations, not meant to be cached
preferLocalBuild = true; allowSubstitutes = false;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -12,10 +12,10 @@ s/^name (.*)/name "\1"/
/^name /s/^name (.*)/\1 = {/p
/^$/,1i};
# extract md5 for runfiles
s/^containermd5 (.*)/ md5.run = "\1";/p
s/^doccontainermd5 (.*)/ md5.doc = "\1";/p
s/^srccontainermd5 (.*)/ md5.source = "\1";/p
# extract hashes of *.tar.xz
s/^containerchecksum (.*)/ sha512.run = "\1";/p
s/^doccontainerchecksum (.*)/ sha512.doc = "\1";/p
s/^srccontainerchecksum (.*)/ sha512.source = "\1";/p
/^runfiles /i\ hasRunfiles = true;
# number of path components to strip, defaulting to 1 ("texmf-dist/")