texlive-new: Export source tarballs via an attribute

This allows them to be found by find-tarballs.nix (which can only see
fetchurl dependencies if they are attributes, not if they're part of a
string context).
This commit is contained in:
Eelco Dolstra 2016-04-18 15:00:14 +02:00
parent ec198e3868
commit be8fc33164

View File

@ -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