summary refs log tree commit diff
path: root/pkgs/tools/typesetting
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-18 15:00:14 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-04-18 15:18:21 +0200
commitbe8fc33164301af4c96d964192931dca3f6d6be7 (patch)
tree3dfb8c8a7c1d2e134aafaa43cc799a1d32cac71b /pkgs/tools/typesetting
parentec198e3868e8a25cd88cc77b0097610c74b81d38 (diff)
downloadnixpkgs-be8fc33164301af4c96d964192931dca3f6d6be7.tar
nixpkgs-be8fc33164301af4c96d964192931dca3f6d6be7.tar.gz
nixpkgs-be8fc33164301af4c96d964192931dca3f6d6be7.tar.bz2
nixpkgs-be8fc33164301af4c96d964192931dca3f6d6be7.tar.lz
nixpkgs-be8fc33164301af4c96d964192931dca3f6d6be7.tar.xz
nixpkgs-be8fc33164301af4c96d964192931dca3f6d6be7.tar.zst
nixpkgs-be8fc33164301af4c96d964192931dca3f6d6be7.zip
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).
Diffstat (limited to 'pkgs/tools/typesetting')
-rw-r--r--pkgs/tools/typesetting/tex/texlive-new/default.nix16
1 files 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 a2f0bf706c8..718137a6251 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