Merge pull request #118530 from SuperSandro2000/fetchzip-urls

This commit is contained in:
Sandro 2021-04-07 22:39:37 +02:00 committed by GitHub
commit add1a1cd6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 9 deletions

View File

@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
if stdenv.hostPlatform.system == "i686-linux" then
fetchurl {
name = "sublimetext-2.0.2.tar.bz2";
url = [
urls = [
"http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.tar.bz2"
"https://download.sublimetext.com/Sublime%20Text%202.0.2.tar.bz2"
];
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
else
fetchurl {
name = "sublimetext-2.0.2.tar.bz2";
url = [
urls = [
"http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.tar.bz2"
"https://download.sublimetext.com/Sublime%20Text%202.0.2%20x64.tar.bz2"
];

View File

@ -5,16 +5,19 @@
# (e.g. due to minor changes in the compression algorithm, or changes
# in timestamps).
{ fetchurl, unzip }:
{ lib, fetchurl, unzip }:
{ # Optionally move the contents of the unpacked tree up one level.
stripRoot ? true
, url
, url ? ""
, urls ? []
, extraPostFetch ? ""
, name ? "source"
, ... } @ args:
(fetchurl ({
(fetchurl (let
basename = baseNameOf (if url != "" then url else builtins.head urls);
in {
inherit name;
recursiveHash = true;
@ -27,7 +30,7 @@
mkdir "$unpackDir"
cd "$unpackDir"
renamed="$TMPDIR/${baseNameOf url}"
renamed="$TMPDIR/${basename}"
mv "$downloadedFile" "$renamed"
unpackFile "$renamed"
''

View File

@ -3,7 +3,7 @@
fetchzip {
name = "paratype-pt-mono";
url = [
urls = [
"https://company.paratype.com/system/attachments/631/original/ptmono.zip"
"http://rus.paratype.ru/system/attachments/631/original/ptmono.zip"
];

View File

@ -3,7 +3,7 @@
fetchzip {
name = "paratype-pt-sans";
url = [
urls = [
"https://company.paratype.com/system/attachments/629/original/ptsans.zip"
"http://rus.paratype.ru/system/attachments/629/original/ptsans.zip"
];

View File

@ -3,7 +3,7 @@
fetchzip {
name = "paratype-pt-serif";
url = [
urls = [
"https://company.paratype.com/system/attachments/634/original/ptserif.zip"
"http://rus.paratype.ru/system/attachments/634/original/ptserif.zip"
];