From be8fc33164301af4c96d964192931dca3f6d6be7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 18 Apr 2016 15:00:14 +0200 Subject: [PATCH] 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). --- .../typesetting/tex/texlive-new/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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