From 9f44a61f3915b70af023af3e7578c9a961a1e65f Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Thu, 12 Mar 2020 17:59:23 -0400 Subject: [PATCH] texlive: use versioned tarballs Announced in [1], versioned tarballs allow to make sure that a specific version is fetched. This does not guarantee that all previous versions are retained on the main mirrors. Logically, we would want to first try to download versioned tarballs from any mirror and only then try the unversioned ones. But right now we only have two mirrors and only some of the tarballs are versioned in texlive-2019, so the order is changed to not hammer the weak tug.org mirror. [1] https://tug.org/pipermail/tex-live/2019-September/044086.html --- pkgs/tools/typesetting/tex/texlive/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index 7b208e05593..278e33c383a 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -89,7 +89,7 @@ let }; # create a derivation that contains an unpacked upstream TL package - mkPkg = { pname, tlType, version, sha512, postUnpack ? "", stripPrefix ? 1, ... }@args: + mkPkg = { pname, tlType, revision, version, sha512, postUnpack ? "", stripPrefix ? 1, ... }@args: let # the basename used by upstream (without ".tar.xz" suffix) urlName = pname + lib.optionalString (tlType != "run") ".${tlType}"; @@ -97,8 +97,12 @@ let fixedHash = fixedHashes.${tlName} or null; # be graceful about missing hashes urls = args.urls or (if args ? url then [ args.url ] else - map (up: "${up}/${urlName}.tar.xz") urlPrefixes - ); + lib.concatMap + (up: [ + "${up}/${urlName}.r${toString revision}.tar.xz" + "${up}/${urlName}.tar.xz" # TODO To be removed for telive 2020 + ]) + urlPrefixes); # The tarballs on CTAN mirrors for the current release are constantly # receiving updates, so we can't use those directly. Stable snapshots