diff --git a/pkgs/tools/typesetting/tex/texlive-new/default.nix b/pkgs/tools/typesetting/tex/texlive-new/default.nix index a2f0bf706c87..718137a6251f 100644 --- a/pkgs/tools/typesetting/tex/texlive-new/default.nix +++ b/pkgs/tools/typesetting/tex/texlive-new/default.nix @@ -114,11 +114,15 @@ let ("${mirror}/pub/tex/historic/systems/texlive/${bin.texliveYear}/tlnet-final/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 - in '' - tar -xf '${ fetchurl { inherit url md5; } }' \ + in + rec { + src = fetchurl { inherit url md5; }; + unpackCmd = '' + tar -xf '${src}' \ '--strip-components=${toString stripPrefix}' \ -C "$out" --anchored --exclude=tlpkg --keep-old-files '' + postUnpack; + }; # create a derivation that contains unpacked upstream TL packages mkPkgs = { pname, tlType, version, pkgList }@args: @@ -129,10 +133,14 @@ 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); in runCommand "texlive-${tlName}" ( { # lots of derivations, not meant to be cached preferLocalBuild = true; allowSubstitutes = false; - passthru = { inherit pname tlType version; }; + passthru = { + inherit pname tlType version; + srcs = map (pkg: pkg.src) pkgs; + }; } // lib.optionalAttrs (fixedHash != null) { outputHash = fixedHash; outputHashAlgo = "sha1"; @@ -141,7 +149,7 @@ let ) ( '' mkdir "$out" - '' + lib.concatMapStrings unpackPkg (fastUnique (a: b: a.md5 < b.md5) pkgList) + '' + lib.concatMapStrings (pkg: pkg.unpackCmd) pkgs ); # combine a set of TL packages into a single TL meta-package