diff options
author | Vladimír Čunát <vcunat@gmail.com> | 2017-12-15 20:10:18 +0100 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2017-12-15 20:13:09 +0100 |
commit | 1b555c57eced64d3f76a3561d2d30407c6a9ce3c (patch) | |
tree | c938c809f453c87f6349eb92fa0707b442fdacf8 /pkgs/tools/typesetting/tex/texlive/default.nix | |
parent | 5687f61b1984edc13e9a6427d9185747e7a540d4 (diff) | |
download | nixlib-1b555c57eced64d3f76a3561d2d30407c6a9ce3c.tar nixlib-1b555c57eced64d3f76a3561d2d30407c6a9ce3c.tar.gz nixlib-1b555c57eced64d3f76a3561d2d30407c6a9ce3c.tar.bz2 nixlib-1b555c57eced64d3f76a3561d2d30407c6a9ce3c.tar.lz nixlib-1b555c57eced64d3f76a3561d2d30407c6a9ce3c.tar.xz nixlib-1b555c57eced64d3f76a3561d2d30407c6a9ce3c.tar.zst nixlib-1b555c57eced64d3f76a3561d2d30407c6a9ce3c.zip |
texlive: more robust way to fetch
/cc #30332. Thanks to @vprbl for the http mirror.
Diffstat (limited to 'pkgs/tools/typesetting/tex/texlive/default.nix')
-rw-r--r-- | pkgs/tools/typesetting/tex/texlive/default.nix | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index eb8033d4d9f7..68d0c635530f 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -110,15 +110,16 @@ let tlName = urlName + "-${version}"; fixedHash = fixedHashes.${tlName} or null; # be graceful about missing hashes - url = args.url or "${urlPrefix}/${urlName}.tar.xz"; - urlPrefix = args.urlPrefix or - https://gateway.ipfs.io/ipfs/QmRLK45EC828vGXv5YDaBsJBj2LjMjjA2ReLVrXsasRzy7/texlive-2017 - #http://146.185.144.154/texlive-2017 - ; - # XXX XXX XXX FIXME: mirror the snapshot XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX - # ("${mirror}/pub/tex/historic/systems/texlive/${bin.texliveYear}/tlnet-final/archive"); - #mirror = "http://ftp.math.utah.edu"; - src = fetchurl { inherit url sha512; }; + urls = args.urls or (if args ? url then [ args.url ] else + map (up: "${up}/${urlName}.tar.xz") urlPrefixes + ); + urlPrefixes = args.urlPrefixes or [ + http://146.185.144.154/texlive-2017 + # IPFS GW is second, as it doesn't have a good time-outing behavior + http://gateway.ipfs.io/ipfs/QmRLK45EC828vGXv5YDaBsJBj2LjMjjA2ReLVrXsasRzy7/texlive-2017 + ]; + + src = fetchurl { inherit urls sha512; }; passthru = { inherit pname tlType version; @@ -132,7 +133,7 @@ let in if sha512 == "" then # hash stripped from pkgs.nix to save space -> fetch&unpack in a single step fetchurl { - inherit url; + inherit urls; sha1 = if fixedHash == null then throw "TeX Live package ${tlName} is missing hash!" else fixedHash; name = tlName; |