nixpkgs/pkgs/build-support/rust/fetchcargo.nix
Ricardo M. Correia d7ebe7a4f3 buildRustPackage: Accept srcs attribute as well
Add support for building Rust packages that have multiple sources, i.e.,
that use the `srcs` and `sourceRoot` attributes instead of just `src`.
2015-05-29 19:46:20 +02:00

23 lines
629 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 = ''
${./fetch-cargo-deps} . "$out"
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;
SSL_CERT_FILE = "${cacert}/etc/ca-bundle.crt";
impureEnvVars = [ "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy" ];
preferLocalBuild = true;
}