nixpkgs/pkgs/build-support/rust/fetchcargo.nix
Ricardo M. Correia 777c9c3768 buildRustPackage: fix erroneous /bin/sh reference
The fetch-cargo-deps script is written in bash syntax, but it
erroneously ran under the /bin/sh interpreter.

This wasn't noticed because /bin/sh is actually bash in NixOS, but on
some other systems this is not true.
2015-10-29 15:16:51 +01:00

23 lines
644 B
Nix

{ stdenv, cacert, git, rustc, cargo, rustRegistry }:
{ name ? "cargo-deps", src, srcs, sourceRoot, sha256, cargoUpdateHook ? "" }:
stdenv.mkDerivation {
name = "${name}-fetch";
buildInputs = [ rustc cargo git ];
inherit src srcs sourceRoot rustRegistry cargoUpdateHook;
phases = "unpackPhase installPhase";
installPhase = ''
bash ${./fetch-cargo-deps} . "$out"
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
impureEnvVars = [ "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy" ];
preferLocalBuild = true;
}