diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/build-support/fetchurl | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/build-support/fetchurl')
-rw-r--r-- | nixpkgs/pkgs/build-support/fetchurl/boot.nix | 20 | ||||
-rw-r--r-- | nixpkgs/pkgs/build-support/fetchurl/builder.sh | 144 | ||||
-rw-r--r-- | nixpkgs/pkgs/build-support/fetchurl/default.nix | 149 | ||||
-rw-r--r-- | nixpkgs/pkgs/build-support/fetchurl/mirrors.nix | 411 | ||||
-rw-r--r-- | nixpkgs/pkgs/build-support/fetchurl/write-mirror-list.sh | 4 |
5 files changed, 728 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/build-support/fetchurl/boot.nix b/nixpkgs/pkgs/build-support/fetchurl/boot.nix new file mode 100644 index 000000000000..bd71f93c5291 --- /dev/null +++ b/nixpkgs/pkgs/build-support/fetchurl/boot.nix @@ -0,0 +1,20 @@ +let mirrors = import ./mirrors.nix; in + +{ system }: + +{ url ? builtins.head urls +, urls ? [] +, sha256 +, name ? baseNameOf (toString url) +}: + +import <nix/fetchurl.nix> { + inherit system sha256 name; + + url = + # Handle mirror:// URIs. Since <nix/fetchurl.nix> currently + # supports only one URI, use the first listed mirror. + let m = builtins.match "mirror://([a-z]+)/(.*)" url; in + if m == null then url + else builtins.head (mirrors.${builtins.elemAt m 0}) + (builtins.elemAt m 1); +} diff --git a/nixpkgs/pkgs/build-support/fetchurl/builder.sh b/nixpkgs/pkgs/build-support/fetchurl/builder.sh new file mode 100644 index 000000000000..f9bc8b602f4c --- /dev/null +++ b/nixpkgs/pkgs/build-support/fetchurl/builder.sh @@ -0,0 +1,144 @@ +source $stdenv/setup + +source $mirrorsFile + +curlVersion=$(curl -V | head -1 | cut -d' ' -f2) + +# Curl flags to handle redirects, not use EPSV, handle cookies for +# servers to need them during redirects, and work on SSL without a +# certificate (this isn't a security problem because we check the +# cryptographic hash of the output anyway). +curl=( + curl + --location + --max-redirs 20 + --retry 3 + --disable-epsv + --cookie-jar cookies + --insecure + --user-agent "curl/$curlVersion Nixpkgs/$nixpkgsVersion" + $curlOpts + $NIX_CURL_FLAGS +) + +downloadedFile="$out" +if [ -n "$downloadToTemp" ]; then downloadedFile="$TMPDIR/file"; fi + + +tryDownload() { + local url="$1" + echo + header "trying $url" + local curlexit=18; + + success= + + # if we get error code 18, resume partial download + while [ $curlexit -eq 18 ]; do + # keep this inside an if statement, since on failure it doesn't abort the script + if "${curl[@]}" -C - --fail "$url" --output "$downloadedFile"; then + success=1 + break + else + curlexit=$?; + fi + done +} + + +finish() { + set +o noglob + + if [[ $executable == "1" ]]; then + chmod +x $downloadedFile + fi + + runHook postFetch + exit 0 +} + + +tryHashedMirrors() { + if test -n "$NIX_HASHED_MIRRORS"; then + hashedMirrors="$NIX_HASHED_MIRRORS" + fi + + for mirror in $hashedMirrors; do + url="$mirror/$outputHashAlgo/$outputHash" + if "${curl[@]}" --retry 0 --connect-timeout "${NIX_CONNECT_TIMEOUT:-15}" \ + --fail --silent --show-error --head "$url" \ + --write-out "%{http_code}" --output /dev/null > code 2> log; then + tryDownload "$url" + if test -n "$success"; then finish; fi + else + # Be quiet about 404 errors, which we interpret as the file + # not being present on this particular mirror. + if test "$(cat code)" != 404; then + echo "error checking the existence of $url:" + cat log + fi + fi + done +} + + +# URL list may contain ?. No glob expansion for that, please +set -o noglob + +urls2= +for url in $urls; do + if test "${url:0:9}" != "mirror://"; then + urls2="$urls2 $url" + else + url2="${url:9}"; echo "${url2/\// }" > split; read site fileName < split + #varName="mirror_$site" + varName="$site" # !!! danger of name clash, fix this + if test -z "${!varName}"; then + echo "warning: unknown mirror:// site \`$site'" + else + mirrors=${!varName} + + # Allow command-line override by setting NIX_MIRRORS_$site. + varName="NIX_MIRRORS_$site" + if test -n "${!varName}"; then mirrors="${!varName}"; fi + + for url3 in $mirrors; do + urls2="$urls2 $url3$fileName"; + done + fi + fi +done +urls="$urls2" + +# Restore globbing settings +set +o noglob + +if test -n "$showURLs"; then + echo "$urls" > $out + exit 0 +fi + + +if test -n "$preferHashedMirrors"; then + tryHashedMirrors +fi + +# URL list may contain ?. No glob expansion for that, please +set -o noglob + +success= +for url in $urls; do + tryDownload "$url" + if test -n "$success"; then finish; fi +done + +# Restore globbing settings +set +o noglob + +if test -z "$preferHashedMirrors"; then + tryHashedMirrors +fi + + +echo "error: cannot download $name from any mirror" +exit 1 diff --git a/nixpkgs/pkgs/build-support/fetchurl/default.nix b/nixpkgs/pkgs/build-support/fetchurl/default.nix new file mode 100644 index 000000000000..5f0c1384c79e --- /dev/null +++ b/nixpkgs/pkgs/build-support/fetchurl/default.nix @@ -0,0 +1,149 @@ +{ lib, stdenvNoCC, curl }: # Note that `curl' may be `null', in case of the native stdenvNoCC. + +let + + mirrors = import ./mirrors.nix; + + # Write the list of mirrors to a file that we can reuse between + # fetchurl instantiations, instead of passing the mirrors to + # fetchurl instantiations via environment variables. This makes the + # resulting store derivations (.drv files) much smaller, which in + # turn makes nix-env/nix-instantiate faster. + mirrorsFile = + stdenvNoCC.mkDerivation ({ + name = "mirrors-list"; + builder = ./write-mirror-list.sh; + preferLocalBuild = true; + } // mirrors); + + # Names of the master sites that are mirrored (i.e., "sourceforge", + # "gnu", etc.). + sites = builtins.attrNames mirrors; + + impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ + # This variable allows the user to pass additional options to curl + "NIX_CURL_FLAGS" + + # This variable allows the user to override hashedMirrors from the + # command-line. + "NIX_HASHED_MIRRORS" + + # This variable allows overriding the timeout for connecting to + # the hashed mirrors. + "NIX_CONNECT_TIMEOUT" + ] ++ (map (site: "NIX_MIRRORS_${site}") sites); + +in + +{ # URL to fetch. + url ? "" + +, # Alternatively, a list of URLs specifying alternative download + # locations. They are tried in order. + urls ? [] + +, # Additional curl options needed for the download to succeed. + curlOpts ? "" + +, # Name of the file. If empty, use the basename of `url' (or of the + # first element of `urls'). + name ? "" + + # Different ways of specifying the hash. +, outputHash ? "" +, outputHashAlgo ? "" +, md5 ? "" +, sha1 ? "" +, sha256 ? "" +, sha512 ? "" + +, recursiveHash ? false + +, # Shell code to build a netrc file for BASIC auth + netrcPhase ? null + +, # Impure env vars (http://nixos.org/nix/manual/#sec-advanced-attributes) + # needed for netrcPhase + netrcImpureEnvVars ? [] + +, # Shell code executed after the file has been fetched + # successfully. This can do things like check or transform the file. + postFetch ? "" + +, # Whether to download to a temporary path rather than $out. Useful + # in conjunction with postFetch. The location of the temporary file + # is communicated to postFetch via $downloadedFile. + downloadToTemp ? false + +, # If true, set executable bit on downloaded file + executable ? false + +, # If set, don't download the file, but write a list of all possible + # URLs (resulting from resolving mirror:// URLs) to $out. + showURLs ? false + +, # Meta information, if any. + meta ? {} + + # Passthru information, if any. +, passthru ? {} +}: + +assert sha512 != "" -> builtins.compareVersions "1.11" builtins.nixVersion <= 0; + +let + urls_ = + if urls != [] && url == "" then + (if lib.isList urls then urls + else throw "`urls` is not a list") + else if urls == [] && url != "" then [url] + else throw "fetchurl requires either `url` or `urls` to be set"; + + hash_ = + if md5 != "" then throw "fetchurl does not support md5 anymore, please use sha256 or sha512" + else if (outputHash != "" && outputHashAlgo != "") then { inherit outputHashAlgo outputHash; } + else if sha512 != "" then { outputHashAlgo = "sha512"; outputHash = sha512; } + else if sha256 != "" then { outputHashAlgo = "sha256"; outputHash = sha256; } + else if sha1 != "" then { outputHashAlgo = "sha1"; outputHash = sha1; } + else throw "fetchurl requires a hash for fixed-output derivation: ${lib.concatStringsSep ", " urls_}"; +in + +stdenvNoCC.mkDerivation { + name = + if showURLs then "urls" + else if name != "" then name + else baseNameOf (toString (builtins.head urls_)); + + builder = ./builder.sh; + + nativeBuildInputs = [ curl ]; + + urls = urls_; + + # If set, prefer the content-addressable mirrors + # (http://tarballs.nixos.org) over the original URLs. + preferHashedMirrors = true; + + # New-style output content requirements. + inherit (hash_) outputHashAlgo outputHash; + + outputHashMode = if (recursiveHash || executable) then "recursive" else "flat"; + + inherit curlOpts showURLs mirrorsFile postFetch downloadToTemp executable; + + impureEnvVars = impureEnvVars ++ netrcImpureEnvVars; + + nixpkgsVersion = lib.trivial.release; + + # Doing the download on a remote machine just duplicates network + # traffic, so don't do that. + preferLocalBuild = true; + + postHook = if netrcPhase == null then null else '' + ${netrcPhase} + curlOpts="$curlOpts --netrc-file $PWD/netrc" + ''; + + inherit meta; + inherit passthru; +} diff --git a/nixpkgs/pkgs/build-support/fetchurl/mirrors.nix b/nixpkgs/pkgs/build-support/fetchurl/mirrors.nix new file mode 100644 index 000000000000..6ee9ceb52861 --- /dev/null +++ b/nixpkgs/pkgs/build-support/fetchurl/mirrors.nix @@ -0,0 +1,411 @@ +rec { + + # Content-addressable Nix mirrors. + hashedMirrors = [ + http://tarballs.nixos.org + ]; + + # Mirrors for mirror://site/filename URIs, where "site" is + # "sourceforge", "gnu", etc. + + # SourceForge. + sourceforge = [ + https://downloads.sourceforge.net/ + https://prdownloads.sourceforge.net/ + https://heanet.dl.sourceforge.net/sourceforge/ + https://surfnet.dl.sourceforge.net/sourceforge/ + https://dfn.dl.sourceforge.net/sourceforge/ + https://osdn.dl.sourceforge.net/sourceforge/ + https://kent.dl.sourceforge.net/sourceforge/ + ]; + + # SourceForge.jp. + sourceforgejp = [ + https://osdn.dl.sourceforge.jp/ + https://jaist.dl.sourceforge.jp/ + ]; + + # GNU (https://www.gnu.org/prep/ftp.html). + gnu = [ + # This one redirects to a (supposedly) nearby and (supposedly) up-to-date + # mirror. + https://ftpmirror.gnu.org/ + + http://ftp.nluug.nl/pub/gnu/ + http://mirrors.kernel.org/gnu/ + ftp://mirror.cict.fr/gnu/ + ftp://ftp.cs.tu-berlin.de/pub/gnu/ + ftp://ftp.chg.ru/pub/gnu/ + ftp://ftp.funet.fi/pub/mirrors/ftp.gnu.org/gnu/ + + # This one is the master repository, and thus it's always up-to-date. + http://ftp.gnu.org/pub/gnu/ + ]; + + # GCC. + gcc = [ + ftp://ftp.nluug.nl/mirror/languages/gcc/ + ftp://ftp.fu-berlin.de/unix/languages/gcc/ + ftp://ftp.irisa.fr/pub/mirrors/gcc.gnu.org/gcc/ + ftp://gcc.gnu.org/pub/gcc/ + ]; + + # GnuPG. + gnupg = [ + https://gnupg.org/ftp/gcrypt/ + http://www.ring.gr.jp/pub/net/ + http://gd.tuwien.ac.at/privacy/ + http://mirrors.dotsrc.org/gcrypt/ + http://ftp.heanet.ie/mirrors/ftp.gnupg.org/gcrypt/ + http://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/ + ]; + + # kernel.org's /pub (/pub/{linux,software}) tree. + kernel = [ + http://cdn.kernel.org/pub/ + http://www.all.kernel.org/pub/ + http://ramses.wh2.tu-dresden.de/pub/mirrors/kernel.org/ + http://linux-kernel.uio.no/pub/ + http://kernel.osuosl.org/pub/ + ftp://ftp.funet.fi/pub/mirrors/ftp.kernel.org/pub/ + ]; + + # Mirrors from https://download.kde.org/extra/download-mirrors.html + kde = [ + "https://download.kde.org/download.php?url=" + https://ftp.gwdg.de/pub/linux/kde/ + https://mirrors.ocf.berkeley.edu/kde/ + http://mirrors.mit.edu/kde/ + https://mirrors.ustc.edu.cn/kde/ + http://ftp.funet.fi/pub/mirrors/ftp.kde.org/pub/kde/ + ftp://ftp.kde.org/pub/kde/ + ]; + + # Gentoo files. + gentoo = [ + http://ftp.snt.utwente.nl/pub/os/linux/gentoo/ + http://distfiles.gentoo.org/ + ftp://mirrors.kernel.org/gentoo/ + ]; + + savannah = [ + # Mirrors from https://download-mirror.savannah.gnu.org/releases/00_MIRRORS.html + http://mirror.easyname.at/nongnu/ + http://mirror2.klaus-uwe.me/nongnu/ + http://savannah.c3sl.ufpr.br/ + http://mirror.csclub.uwaterloo.ca/nongnu/ + http://mirror.cedia.org.ec/nongnu/ + http://ftp.igh.cnrs.fr/pub/nongnu/ + http://mirror6.layerjet.com/nongnu + http://mirror.netcologne.de/savannah/ + http://ftp.cc.uoc.gr/mirrors/nongnu.org/ + http://nongnu.uib.no/ + http://mirrors.fe.up.pt/pub/nongnu/ + http://mirror.lihnidos.org/GNU/savannah/ + http://savannah.mirror.si/ + http://ftp.acc.umu.se/mirror/gnu.org/savannah/ + http://ftp.twaren.net/Unix/NonGNU/ + http://ftp.yzu.edu.tw/pub/nongnu/ + http://mirror.rackdc.com/savannah/ + http://savannah-nongnu-org.ip-connect.vn.ua/ + http://www.mirrorservice.org/sites/download.savannah.gnu.org/releases/ + http://savannah.spinellicreations.com/ + http://gnu.mirrors.pair.com/savannah/savannah/ + ftp://mirror.easyname.at/nongnu/ + ftp://mirror2.klaus-uwe.me/nongnu/ + ftp://savannah.c3sl.ufpr.br/savannah-nongnu/ + ftp://mirror.csclub.uwaterloo.ca/nongnu/ + ftp://mirror.cedia.org.ec/nongnu + ftp://ftp.igh.cnrs.fr/pub/nongnu/ + ftp://mirror6.layerjet.com/nongnu/ + ftp://mirror.netcologne.de/savannah/ + ftp://nongnu.uib.no/pub/nongnu/ + ftp://mirrors.fe.up.pt/pub/nongnu/ + ftp://savannah.mirror.si/savannah/ + ftp://ftp.twaren.net/Unix/NonGNU/ + ftp://ftp.yzu.edu.tw/pub/nongnu/ + ftp://savannah-nongnu-org.ip-connect.vn.ua/mirror/savannah.nongnu.org/ + ftp://ftp.mirrorservice.org/sites/download.savannah.gnu.org/releases/ + ftp://spinellicreations.com/gnu_dot_org_savannah_mirror/ + ]; + + samba = [ + https://www.samba.org/ftp/ + http://www.samba.org/ftp/ + ]; + + # BitlBee mirrors, see https://www.bitlbee.org/main.php/mirrors.html . + bitlbee = [ + http://get.bitlbee.org/ + http://get.bitlbee.be/ + http://get.us.bitlbee.org/ + http://ftp.snt.utwente.nl/pub/software/bitlbee/ + http://bitlbee.intergenia.de/ + ]; + + # ImageMagick mirrors, see https://www.imagemagick.org/script/mirror.php + imagemagick = [ + https://www.imagemagick.org/download/ + https://mirror.checkdomain.de/imagemagick/ + https://ftp.nluug.nl/ImageMagick/ + ftp://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/ # also contains older versions removed from most mirrors + http://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/ + ftp://ftp.imagemagick.org/pub/ImageMagick/ + http://ftp.fifi.org/ImageMagick/ + ftp://ftp.fifi.org/ImageMagick/ + http://imagemagick.mirrorcatalogs.com/ + ftp://imagemagick.mirrorcatalogs.com/imagemagick + ]; + + # CPAN mirrors. + cpan = [ + https://cpan.metacpan.org/ + https://cpan.perl.org/ + http://backpan.perl.org/ # for old releases + ]; + + # Debian. + debian = [ + http://httpredir.debian.org/debian/ + ftp://ftp.au.debian.org/debian/ + ftp://ftp.de.debian.org/debian/ + ftp://ftp.es.debian.org/debian/ + ftp://ftp.fr.debian.org/debian/ + ftp://ftp.it.debian.org/debian/ + ftp://ftp.nl.debian.org/debian/ + ftp://ftp.ru.debian.org/debian/ + ftp://ftp.debian.org/debian/ + http://ftp.debian.org/debian/ + http://archive.debian.org/debian-archive/debian/ + ftp://ftp.funet.fi/pub/mirrors/ftp.debian.org/debian/ + ]; + + # Ubuntu. + ubuntu = [ + http://nl.archive.ubuntu.com/ubuntu/ + http://de.archive.ubuntu.com/ubuntu/ + http://archive.ubuntu.com/ubuntu/ + http://old-releases.ubuntu.com/ubuntu/ + ]; + + # Fedora (please only add full mirrors that carry old Fedora distributions as well). + # See: https://mirrors.fedoraproject.org/publiclist (but not all carry old content). + fedora = [ + http://archives.fedoraproject.org/pub/fedora/ + http://fedora.osuosl.org/ + http://ftp.nluug.nl/pub/os/Linux/distr/fedora/ + http://ftp.funet.fi/pub/mirrors/ftp.redhat.com/pub/fedora/ + http://fedora.bhs.mirrors.ovh.net/ + http://mirror.csclub.uwaterloo.ca/fedora/ + http://ftp.linux.cz/pub/linux/fedora/ + http://ftp.heanet.ie/pub/fedora/ + http://mirror.1000mbps.com/fedora/ + http://archives.fedoraproject.org/pub/archive/fedora/ + ]; + + # Old SUSE distributions. Unfortunately there is no master site, + # since SUSE actually delete their old distributions (see + # ftp://ftp.suse.com/pub/suse/discontinued/deleted-20070817/README.txt). + oldsuse = [ + ftp://ftp.gmd.de/ftp.suse.com-discontinued/ + ]; + + # openSUSE. + opensuse = [ + http://opensuse.hro.nl/opensuse/distribution/ + http://ftp.funet.fi/pub/linux/mirrors/opensuse/distribution/ + http://ftp.belnet.be/mirror/ftp.opensuse.org/distribution/ + http://ftp.uni-kassel.de/opensuse/distribution/ + http://ftp.opensuse.org/pub/opensuse/distribution/ + http://ftp5.gwdg.de/pub/opensuse/discontinued/distribution/ + http://ftp.hosteurope.de/mirror/ftp.opensuse.org/discontinued/ + http://opensuse.mirror.server4you.net/distribution/ + http://ftp.nsysu.edu.tw/Linux/OpenSuSE/distribution/ + ]; + + # Gnome (see http://ftp.gnome.org/pub/GNOME/MIRRORS). + gnome = [ + # This one redirects to some mirror closeby, so it should be all you need. + http://download.gnome.org/ + + http://ftp.unina.it/pub/linux/GNOME/ + http://fr2.rpmfind.net/linux/gnome.org/ + ftp://ftp.dit.upm.es/pub/GNOME/ + ftp://ftp.no.gnome.org/pub/GNOME/ + http://ftp.acc.umu.se/pub/GNOME/ + http://ftp.belnet.be/mirror/ftp.gnome.org/ + http://ftp.df.lth.se/pub/gnome/ + http://linorg.usp.br/gnome/ + http://mirror.aarnet.edu.au/pub/GNOME/ + ftp://ftp.cse.buffalo.edu/pub/Gnome/ + ftp://ftp.nara.wide.ad.jp/pub/X11/GNOME/ + ]; + + xfce = [ + http://archive.xfce.org/ + http://mirror.netcologne.de/xfce/ + http://archive.se.xfce.org/xfce/ + http://archive.be.xfce.org/xfce/ + http://mirror.perldude.de/archive.xfce.org/ + http://archive.be2.xfce.org/ + http://ftp.udc.es/xfce/ + http://archive.al-us.xfce.org/ + http://mirror.yongbok.net/X11/xfce-mirror/ + http://mirrors.tummy.com/pub/archive.xfce.org/ + http://xfce.mirror.uber.com.au/ + ]; + + # X.org. + xorg = [ + http://xorg.freedesktop.org/releases/ + http://ftp.gwdg.de/pub/x11/x.org/pub/ + http://ftp.x.org/pub/ # often incomplete (e.g. files missing from X.org 7.4) + ]; + + # Apache mirrors (see http://www.apache.org/mirrors/). + apache = [ + http://www.eu.apache.org/dist/ + http://wwwftp.ciril.fr/pub/apache/ + ftp://ftp.fu-berlin.de/unix/www/apache/ + http://ftp.tudelft.nl/apache/ + http://mirror.cc.columbia.edu/pub/software/apache/ + http://www.apache.org/dist/ + http://archive.apache.org/dist/ # fallback for old releases + ftp://ftp.funet.fi/pub/mirrors/apache.org/ + http://apache.cs.uu.nl/ + http://apache.cs.utah.edu/ + ]; + + postgresql = [ + http://ftp.postgresql.org/pub/ + ftp://ftp.postgresql.org/pub/ + ftp://ftp-archives.postgresql.org/pub/ + ]; + + metalab = [ + ftp://mirrors.kernel.org/metalab/ + ftp://ftp.gwdg.de/pub/linux/metalab/ + ftp://ftp.xemacs.org/sites/metalab.unc.edu/ + ]; + + # Bioconductor mirrors (from http://bioconductor.org/about/mirrors) + # The commented-out ones don't seem to allow direct package downloads; + # they serve error messages that result in hash mismatches instead. + bioc = [ + # http://bioc.ism.ac.jp/ + # http://bioc.openanalytics.eu/ + # http://bioconductor.fmrp.usp.br/ + # http://mirror.aarnet.edu.au/pub/bioconductor/ + # http://watson.nci.nih.gov/bioc_mirror/ + http://bioconductor.jp/packages/ + http://bioconductor.statistik.tu-dortmund.de/packages/ + http://mirrors.ebi.ac.uk/bioconductor/packages/ + http://mirrors.ustc.edu.cn/bioc/ + ]; + + # Hackage mirrors + hackage = [ + http://hackage.haskell.org/package/ + http://hdiff.luite.com/packages/archive/package/ + ]; + + # Roy marples mirrors + roy = [ + http://roy.marples.name/downloads/ + http://roy.aydogan.net/ + http://cflags.cc/roy/ + ]; + + # Sage mirrors (http://www.sagemath.org/mirrors.html) + sageupstream = [ + # Africa + http://sagemath.polytechnic.edu.na/spkg/upstream/ + ftp://ftp.sun.ac.za/pub/mirrors/www.sagemath.org/spkg/upstream/ + http://sagemath.mirror.ac.za/spkg/upstream/ + https://ftp.leg.uct.ac.za/pub/packages/sage/spkg/upstream/ + http://mirror.ufs.ac.za/sagemath/spkg/upstream/ + + # America, North + http://mirrors-usa.go-parts.com/sage/sagemath/spkg/upstream/ + http://mirrors.mit.edu/sage/spkg/upstream/ + http://www.cecm.sfu.ca/sage/spkg/upstream/ + http://files.sagemath.org/spkg/upstream/ + http://mirror.clibre.uqam.ca/sage/spkg/upstream/ + https://mirrors.xmission.com/sage/spkg/upstream/ + + # America, South + http://sagemath.c3sl.ufpr.br/spkg/upstream/ + http://linorg.usp.br/sage/spkg/upstream + + # Asia + http://sage.asis.io/spkg/upstream/ + http://mirror.hust.edu.cn/sagemath/spkg/upstream/ + https://ftp.iitm.ac.in/sage/spkg/upstream/ + http://ftp.kaist.ac.kr/sage/spkg/upstream/ + http://ftp.riken.jp/sagemath/spkg/upstream/ + https://mirrors.tuna.tsinghua.edu.cn/sagemath/spkg/upstream/ + https://mirrors.ustc.edu.cn/sagemath/spkg/upstream/ + http://ftp.tsukuba.wide.ad.jp/software/sage/spkg/upstream/ + http://ftp.yz.yamagata-u.ac.jp/pub/math/sage/spkg/upstream/ + https://mirror.yandex.ru/mirrors/sage.math.washington.edu/spkg/upstream/ + + # Australia + http://echidna.maths.usyd.edu.au/sage/spkg/upstream/ + + # Europe + http://sage.mirror.garr.it/mirrors/sage/spkg/upstream/ + http://sunsite.rediris.es/mirror/sagemath/spkg/upstream/ + http://mirror.switch.ch/mirror/sagemath/spkg/upstream/ + http://mirrors.fe.up.pt/pub/sage/spkg/upstream/ + http://www-ftp.lip6.fr/pub/math/sagemath/spkg/upstream/ + http://ftp.ntua.gr/pub/sagemath/spkg/upstream/ + ]; + + # MySQL mirrors + mysql = [ + http://cdn.mysql.com/Downloads/ + ]; + + # OpenBSD mirrors + openbsd = [ + http://ftp.openbsd.org/pub/OpenBSD/ + ftp://ftp.nluug.nl/pub/OpenBSD/ + ftp://ftp-stud.fht-esslingen.de/pub/OpenBSD/ + ftp://ftp.halifax.rwth-aachen.de/pub/OpenBSD/ + ftp://mirror.switch.ch/pub/OpenBSD/ + ]; + + # Steam Runtime mirrors + steamrt = [ + http://repo.steampowered.com/steamrt/ + https://abbradar.net/steamrt/ + ]; + + # Python PyPI mirrors + pypi = [ + https://files.pythonhosted.org/packages/source/ + # pypi.io is a more semantic link, but atm it’s referencing + # files.pythonhosted.org over two redirects + https://pypi.io/packages/source/ + ]; + + # Mozilla projects. + mozilla = [ + http://download.cdn.mozilla.net/pub/mozilla.org/ + https://archive.mozilla.org/pub/ + ]; + + # Maven Central + maven = [ + http://repo1.maven.org/maven2/ + http://central.maven.org/maven2/ + ]; + + # Alsa Project + alsa = [ + ftp://ftp.alsa-project.org/pub/ + http://alsa.cybermirror.org/ + http://www.mirrorservice.org/sites/ftp.alsa-project.org/pub/ + http://alsa.mirror.fr/ + ]; +} diff --git a/nixpkgs/pkgs/build-support/fetchurl/write-mirror-list.sh b/nixpkgs/pkgs/build-support/fetchurl/write-mirror-list.sh new file mode 100644 index 000000000000..2dabd2e722be --- /dev/null +++ b/nixpkgs/pkgs/build-support/fetchurl/write-mirror-list.sh @@ -0,0 +1,4 @@ +source $stdenv/setup + +# !!! this is kinda hacky. +set | grep -E '^[a-zA-Z]+=.*://' > $out |