treewide: Fetchers should use stdenvNoCC.

This commit is contained in:
John Ericson 2018-01-09 18:38:19 -05:00
parent 7a3a8b8529
commit 940c4fa3f5
17 changed files with 43 additions and 43 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, lib, bower2nix, cacert }: { stdenvNoCC, lib, bower2nix, cacert }:
let let
bowerVersion = version: bowerVersion = version:
let let
@ -9,7 +9,7 @@ let
cleanName = name: lib.replaceStrings ["/" ":"] ["-" "-"] name; cleanName = name: lib.replaceStrings ["/" ":"] ["-" "-"] name;
fetchbower = name: version: target: outputHash: stdenv.mkDerivation { fetchbower = name: version: target: outputHash: stdenvNoCC.mkDerivation {
name = "${cleanName name}-${bowerVersion version}"; name = "${cleanName name}-${bowerVersion version}";
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
buildCommand = '' buildCommand = ''

View file

@ -1,7 +1,7 @@
{ stdenv, bazaar }: { stdenvNoCC, bazaar }:
{ url, rev, sha256 }: { url, rev, sha256 }:
stdenv.mkDerivation { stdenvNoCC.mkDerivation {
name = "bzr-export"; name = "bzr-export";
builder = ./builder.sh; builder = ./builder.sh;

View file

@ -3,11 +3,11 @@
# tag="<tagname>" (get version by tag name) # tag="<tagname>" (get version by tag name)
# If you don't specify neither one date="NOW" will be used (get latest) # If you don't specify neither one date="NOW" will be used (get latest)
{stdenv, cvs}: {stdenvNoCC, cvs}:
{cvsRoot, module, tag ? null, date ? null, sha256}: {cvsRoot, module, tag ? null, date ? null, sha256}:
stdenv.mkDerivation { stdenvNoCC.mkDerivation {
name = "cvs-export"; name = "cvs-export";
builder = ./builder.sh; builder = ./builder.sh;
nativeBuildInputs = [cvs]; nativeBuildInputs = [cvs];

View file

@ -1,11 +1,11 @@
{stdenv, darcs, nix, cacert}: {stdenvNoCC, darcs, nix, cacert}:
{url, rev ? null, context ? null, md5 ? "", sha256 ? ""}: {url, rev ? null, context ? null, md5 ? "", sha256 ? ""}:
if md5 != "" then if md5 != "" then
throw "fetchdarcs does not support md5 anymore, please use sha256" throw "fetchdarcs does not support md5 anymore, please use sha256"
else else
stdenv.mkDerivation { stdenvNoCC.mkDerivation {
name = "fetchdarcs"; name = "fetchdarcs";
NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
builder = ./builder.sh; builder = ./builder.sh;

View file

@ -1,13 +1,13 @@
# Fetches a chicken egg from henrietta using `chicken-install -r' # Fetches a chicken egg from henrietta using `chicken-install -r'
# See: http://wiki.call-cc.org/chicken-projects/egg-index-4.html # See: http://wiki.call-cc.org/chicken-projects/egg-index-4.html
{ stdenv, chicken }: { stdenvNoCC, chicken }:
{ name, version, md5 ? "", sha256 ? "" }: { name, version, md5 ? "", sha256 ? "" }:
if md5 != "" then if md5 != "" then
throw "fetchegg does not support md5 anymore, please use sha256" throw "fetchegg does not support md5 anymore, please use sha256"
else else
stdenv.mkDerivation { stdenvNoCC.mkDerivation {
name = "chicken-${name}-export"; name = "chicken-${name}-export";
builder = ./builder.sh; builder = ./builder.sh;
nativeBuildInputs = [ chicken ]; nativeBuildInputs = [ chicken ];
@ -20,6 +20,6 @@ stdenv.mkDerivation {
eggName = name; eggName = name;
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars; impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars;
} }

View file

@ -1,6 +1,6 @@
{stdenv, git, cacert}: let {stdenvNoCC, git, cacert}: let
urlToName = url: rev: let urlToName = url: rev: let
inherit (stdenv.lib) removeSuffix splitString last; inherit (stdenvNoCC.lib) removeSuffix splitString last;
base = last (splitString ":" (baseNameOf (removeSuffix "/" url))); base = last (splitString ":" (baseNameOf (removeSuffix "/" url)));
matched = builtins.match "(.*).git" base; matched = builtins.match "(.*).git" base;
@ -48,7 +48,7 @@ assert deepClone -> leaveDotGit;
if md5 != "" then if md5 != "" then
throw "fetchgit does not support md5 anymore, please use sha256" throw "fetchgit does not support md5 anymore, please use sha256"
else else
stdenv.mkDerivation { stdenvNoCC.mkDerivation {
inherit name; inherit name;
builder = ./builder.sh; builder = ./builder.sh;
fetcher = "${./nix-prefetch-git}"; # This must be a string to ensure it's called with bash. fetcher = "${./nix-prefetch-git}"; # This must be a string to ensure it's called with bash.
@ -62,7 +62,7 @@ stdenv.mkDerivation {
GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt"; GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars ++ [ impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars ++ [
"GIT_PROXY_COMMAND" "SOCKS_SERVER" "GIT_PROXY_COMMAND" "SOCKS_SERVER"
]; ];

View file

@ -1,8 +1,8 @@
{ stdenv, gx, gx-go, go, cacert }: { stdenvNoCC, gx, gx-go, go, cacert }:
{ name, src, sha256 }: { name, src, sha256 }:
stdenv.mkDerivation { stdenvNoCC.mkDerivation {
name = "${name}-gxdeps"; name = "${name}-gxdeps";
inherit src; inherit src;

View file

@ -1,15 +1,15 @@
{stdenv, mercurial, nix}: {name ? null, url, rev ? null, md5 ? null, sha256 ? null, fetchSubrepos ? false}: {stdenvNoCC, mercurial, nix}: {name ? null, url, rev ? null, md5 ? null, sha256 ? null, fetchSubrepos ? false}:
if md5 != null then if md5 != null then
throw "fetchhg does not support md5 anymore, please use sha256" throw "fetchhg does not support md5 anymore, please use sha256"
else else
# TODO: statically check if mercurial as the https support if the url starts woth https. # TODO: statically check if mercurial as the https support if the url starts woth https.
stdenv.mkDerivation { stdenvNoCC.mkDerivation {
name = "hg-archive" + (if name != null then "-${name}" else ""); name = "hg-archive" + (if name != null then "-${name}" else "");
builder = ./builder.sh; builder = ./builder.sh;
nativeBuildInputs = [mercurial]; nativeBuildInputs = [mercurial];
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars; impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars;
subrepoClause = if fetchSubrepos then "S" else ""; subrepoClause = if fetchSubrepos then "S" else "";

View file

@ -1,5 +1,5 @@
# You can specify some extra mirrors and a cache DB via options # You can specify some extra mirrors and a cache DB via options
{stdenv, monotone, defaultDBMirrors ? [], cacheDB ? "./mtn-checkout.db"}: {stdenvNoCC, monotone, defaultDBMirrors ? [], cacheDB ? "./mtn-checkout.db"}:
# dbs is a list of strings # dbs is a list of strings
# each is an url for sync # each is an url for sync
@ -8,7 +8,7 @@
{name ? "mtn-checkout", dbs ? [], sha256 {name ? "mtn-checkout", dbs ? [], sha256
, selector ? "h:" + branch, branch}: , selector ? "h:" + branch, branch}:
stdenv.mkDerivation { stdenvNoCC.mkDerivation {
builder = ./builder.sh; builder = ./builder.sh;
nativeBuildInputs = [monotone]; nativeBuildInputs = [monotone];
@ -19,7 +19,7 @@ stdenv.mkDerivation {
dbs = defaultDBMirrors ++ dbs; dbs = defaultDBMirrors ++ dbs;
inherit branch cacheDB name selector; inherit branch cacheDB name selector;
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars; impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars;
} }

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, buildDotnetPackage, unzip }: { stdenvNoCC, fetchurl, buildDotnetPackage, unzip }:
attrs @ attrs @
{ baseName { baseName

View file

@ -1,4 +1,4 @@
{ stdenv, gitRepo, cacert, copyPathsToStore }: { stdenvNoCC, gitRepo, cacert, copyPathsToStore }:
{ name, manifest, rev ? "HEAD", sha256 { name, manifest, rev ? "HEAD", sha256
# Optional parameters: # Optional parameters:
@ -9,7 +9,7 @@
assert repoRepoRev != "" -> repoRepoURL != ""; assert repoRepoRev != "" -> repoRepoURL != "";
assert createMirror -> !useArchive; assert createMirror -> !useArchive;
with stdenv.lib; with stdenvNoCC.lib;
let let
extraRepoInitFlags = [ extraRepoInitFlags = [
@ -28,7 +28,7 @@ let
local_manifests = copyPathsToStore localManifests; local_manifests = copyPathsToStore localManifests;
in stdenv.mkDerivation { in stdenvNoCC.mkDerivation {
inherit name; inherit name;
inherit cacert manifest rev repoRepoURL repoRepoRev referenceDir; # TODO inherit cacert manifest rev repoRepoURL repoRepoRev referenceDir; # TODO

View file

@ -1,4 +1,4 @@
{ stdenv, runCommand, awscli }: { stdenvNoCC, runCommand, awscli }:
{ s3url { s3url
, sha256 , sha256
@ -10,7 +10,7 @@
}: }:
let let
credentialAttrs = stdenv.lib.optionalAttrs (credentials != null) { credentialAttrs = stdenvNoCC.lib.optionalAttrs (credentials != null) {
AWS_ACCESS_KEY_ID = credentials.access_key_id; AWS_ACCESS_KEY_ID = credentials.access_key_id;
AWS_SECRET_ACCESS_KEY = credentials.secret_access_key; AWS_SECRET_ACCESS_KEY = credentials.secret_access_key;
AWS_SESSION_TOKEN = credentials.session_token ? null; AWS_SESSION_TOKEN = credentials.session_token ? null;

View file

@ -1,9 +1,9 @@
{stdenv, subversion, glibcLocales, sshSupport ? false, openssh ? null}: {stdenvNoCC, subversion, glibcLocales, sshSupport ? false, openssh ? null}:
{url, rev ? "HEAD", md5 ? "", sha256 ? "", {url, rev ? "HEAD", md5 ? "", sha256 ? "",
ignoreExternals ? false, ignoreKeywords ? false, name ? null}: ignoreExternals ? false, ignoreKeywords ? false, name ? null}:
let let
repoName = with stdenv.lib; repoName = with stdenvNoCC.lib;
let let
fst = head; fst = head;
snd = l: head (tail l); snd = l: head (tail l);
@ -28,7 +28,7 @@ in
if md5 != "" then if md5 != "" then
throw "fetchsvn does not support md5 anymore, please use sha256" throw "fetchsvn does not support md5 anymore, please use sha256"
else else
stdenv.mkDerivation { stdenvNoCC.mkDerivation {
name = name_; name = name_;
builder = ./builder.sh; builder = ./builder.sh;
nativeBuildInputs = [ subversion glibcLocales ]; nativeBuildInputs = [ subversion glibcLocales ];
@ -39,6 +39,6 @@ stdenv.mkDerivation {
inherit url rev sshSupport openssh ignoreExternals ignoreKeywords; inherit url rev sshSupport openssh ignoreExternals ignoreKeywords;
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars; impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars;
preferLocalBuild = true; preferLocalBuild = true;
} }

View file

@ -1,11 +1,11 @@
{stdenv, subversion, sshSupport ? false, openssh ? null, expect}: {stdenvNoCC, subversion, sshSupport ? false, openssh ? null, expect}:
{username, password, url, rev ? "HEAD", md5 ? "", sha256 ? ""}: {username, password, url, rev ? "HEAD", md5 ? "", sha256 ? ""}:
if md5 != "" then if md5 != "" then
throw "fetchsvnssh does not support md5 anymore, please use sha256" throw "fetchsvnssh does not support md5 anymore, please use sha256"
else else
stdenv.mkDerivation { stdenvNoCC.mkDerivation {
name = "svn-export-ssh"; name = "svn-export-ssh";
builder = ./builder.sh; builder = ./builder.sh;
nativeBuildInputs = [subversion expect]; nativeBuildInputs = [subversion expect];

View file

@ -1,4 +1,4 @@
{ stdenv, curl }: # Note that `curl' may be `null', in case of the native stdenv. { stdenvNoCC, curl }: # Note that `curl' may be `null', in case of the native stdenvNoCC.
let let
@ -10,7 +10,7 @@ let
# resulting store derivations (.drv files) much smaller, which in # resulting store derivations (.drv files) much smaller, which in
# turn makes nix-env/nix-instantiate faster. # turn makes nix-env/nix-instantiate faster.
mirrorsFile = mirrorsFile =
stdenv.mkDerivation ({ stdenvNoCC.mkDerivation ({
name = "mirrors-list"; name = "mirrors-list";
builder = ./write-mirror-list.sh; builder = ./write-mirror-list.sh;
preferLocalBuild = true; preferLocalBuild = true;
@ -20,7 +20,7 @@ let
# "gnu", etc.). # "gnu", etc.).
sites = builtins.attrNames mirrors; sites = builtins.attrNames mirrors;
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars ++ [ impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars ++ [
# This variable allows the user to pass additional options to curl # This variable allows the user to pass additional options to curl
"NIX_CURL_FLAGS" "NIX_CURL_FLAGS"
@ -103,8 +103,8 @@ let
in in
if md5 != "" then throw "fetchurl does not support md5 anymore, please use sha256 or sha512" if md5 != "" then throw "fetchurl does not support md5 anymore, please use sha256 or sha512"
else if (!hasHash) then throw "Specify hash for fetchurl fixed-output derivation: ${stdenv.lib.concatStringsSep ", " urls_}" else if (!hasHash) then throw "Specify hash for fetchurl fixed-output derivation: ${stdenvNoCC.lib.concatStringsSep ", " urls_}"
else stdenv.mkDerivation { else stdenvNoCC.mkDerivation {
name = name =
if showURLs then "urls" if showURLs then "urls"
else if name != "" then name else if name != "" then name

View file

@ -118,8 +118,8 @@ in rec {
initialPath = [ bootstrapTools ]; initialPath = [ bootstrapTools ];
fetchurlBoot = import ../../build-support/fetchurl { fetchurlBoot = import ../../build-support/fetchurl {
stdenv = stage0.stdenv; stdenvNoCC = stage0.stdenv;
curl = bootstrapTools; curl = bootstrapTools;
}; };
# The stdenvs themselves don't use mkDerivation, so I need to specify this here # The stdenvs themselves don't use mkDerivation, so I need to specify this here

View file

@ -180,7 +180,7 @@ with pkgs;
# `fetchurl' downloads a file from the network. # `fetchurl' downloads a file from the network.
fetchurl = import ../build-support/fetchurl { fetchurl = import ../build-support/fetchurl {
inherit stdenv; inherit stdenvNoCC;
# On darwin, libkrb5 needs bootstrap_cmds which would require # On darwin, libkrb5 needs bootstrap_cmds which would require
# converting many packages to fetchurl_boot to avoid evaluation cycles. # converting many packages to fetchurl_boot to avoid evaluation cycles.
curl = buildPackages.curl.override (lib.optionalAttrs stdenv.isDarwin { gssSupport = false; }); curl = buildPackages.curl.override (lib.optionalAttrs stdenv.isDarwin { gssSupport = false; });