summary refs log tree commit diff
path: root/pkgs/tools/typesetting/tex
diff options
context:
space:
mode:
authorVincenzo Mantova <1962985+xworld21@users.noreply.github.com>2021-06-29 04:01:27 +0100
committerGitHub <noreply@github.com>2021-06-28 23:01:27 -0400
commitc805959fbcb0cdcaf45128cf07aaa4d461bae3ee (patch)
tree3d0a4ae0cc21221546e42ea6b797167f733df817 /pkgs/tools/typesetting/tex
parentf6e6cfaf764a51ddde632d3205cd620e393c9c34 (diff)
downloadnixpkgs-c805959fbcb0cdcaf45128cf07aaa4d461bae3ee.tar
nixpkgs-c805959fbcb0cdcaf45128cf07aaa4d461bae3ee.tar.gz
nixpkgs-c805959fbcb0cdcaf45128cf07aaa4d461bae3ee.tar.bz2
nixpkgs-c805959fbcb0cdcaf45128cf07aaa4d461bae3ee.tar.lz
nixpkgs-c805959fbcb0cdcaf45128cf07aaa4d461bae3ee.tar.xz
nixpkgs-c805959fbcb0cdcaf45128cf07aaa4d461bae3ee.tar.zst
nixpkgs-c805959fbcb0cdcaf45128cf07aaa4d461bae3ee.zip
texlive: drop unused "fetch&unpack" derivations (#126982)
Motivations
- not well reproducible as they disable hashed mirrors (tarballs.nixos.org)
- only reachable by modifying the file pkgs.nix, thus unused
- the space saving is analogous to using substitutes
Diffstat (limited to 'pkgs/tools/typesetting/tex')
-rw-r--r--pkgs/tools/typesetting/tex/texlive/default.nix38
1 files changed, 9 insertions, 29 deletions
diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix
index c21a5dda994..c26b944522c 100644
--- a/pkgs/tools/typesetting/tex/texlive/default.nix
+++ b/pkgs/tools/typesetting/tex/texlive/default.nix
@@ -160,35 +160,12 @@ let
         "https://texlive.info/tlnet-archive/${snapshot.year}/${snapshot.month}/${snapshot.day}/tlnet/archive"
       ];
 
-      src = fetchurl { inherit urls sha512; };
-
-      passthru = {
-        inherit pname tlType version;
-      } // lib.optionalAttrs (sha512 != "") { inherit src; };
-      unpackCmd = file: ''
-        tar -xf ${file} \
-          '--strip-components=${toString stripPrefix}' \
-          -C "$out" --anchored --exclude=tlpkg --keep-old-files
-      '' + postUnpack;
-
-    in if sha512 == "" then
-      # hash stripped from pkgs.nix to save space -> fetch&unpack in a single step
-      # currently unused as we prefer to keep the sha512 hashes for reproducibility
-      fetchurl {
-        inherit urls;
-        sha1 = if fixedHash == null then throw "TeX Live package ${tlName} is missing hash!"
-          else fixedHash;
-        name = tlName;
-        recursiveHash = true;
-        downloadToTemp = true;
-        postFetch = ''mkdir "$out";'' + unpackCmd "$downloadedFile";
-        # TODO: perhaps override preferHashedMirrors and allowSubstitutes
-     }
-        // passthru
-
-    else runCommand "texlive-${tlName}"
+    in runCommand "texlive-${tlName}"
       ( {
-          inherit passthru;
+          src = fetchurl { inherit urls sha512; };
+          inherit stripPrefix;
+          # metadata for texlive.combine
+          passthru = { inherit pname tlType version; };
         } // lib.optionalAttrs (fixedHash != null) {
           outputHash = fixedHash;
           outputHashAlgo = "sha1";
@@ -197,7 +174,10 @@ let
       )
       ( ''
           mkdir "$out"
-        '' + unpackCmd "'${src}'"
+          tar -xf "$src" \
+          --strip-components="$stripPrefix" \
+          -C "$out" --anchored --exclude=tlpkg --keep-old-files
+        '' + postUnpack
       );
 
   # combine a set of TL packages into a single TL meta-package