2016-06-14 10:49:48 +00:00
|
|
|
{ stdenv, cacert, git, rust, rustRegistry }:
|
2015-05-29 17:35:31 +00:00
|
|
|
{ name ? "cargo-deps", src, srcs, sourceRoot, sha256, cargoUpdateHook ? "" }:
|
2014-10-10 14:59:37 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "${name}-fetch";
|
2016-06-14 10:49:48 +00:00
|
|
|
buildInputs = [ rust.cargo rust.rustc git ];
|
2015-05-29 17:35:31 +00:00
|
|
|
inherit src srcs sourceRoot rustRegistry cargoUpdateHook;
|
|
|
|
|
|
|
|
phases = "unpackPhase installPhase";
|
|
|
|
|
|
|
|
installPhase = ''
|
2016-02-25 11:05:14 +00:00
|
|
|
source ${./fetch-cargo-deps}
|
|
|
|
|
2016-02-24 20:27:02 +00:00
|
|
|
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
|
2016-02-25 11:05:14 +00:00
|
|
|
|
|
|
|
fetchCargoDeps . "$out"
|
2015-05-29 17:35:31 +00:00
|
|
|
'';
|
2014-10-10 14:59:37 +00:00
|
|
|
|
|
|
|
outputHashAlgo = "sha256";
|
|
|
|
outputHashMode = "recursive";
|
|
|
|
outputHash = sha256;
|
|
|
|
|
2016-09-17 19:50:01 +00:00
|
|
|
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
|
2014-10-10 14:59:37 +00:00
|
|
|
preferLocalBuild = true;
|
|
|
|
}
|