nixpkgs/pkgs/build-support/rust/cargo-vendor.nix
Robin Gloster 7c5430c27c
Revert "rust: store the cargo-vendor config"
This reverts commit 0af2c5891b.

See 0af2c5891b (commitcomment-26737983)
This breaks the cargoSha256 hashes.
2018-01-09 15:03:03 +01:00

35 lines
880 B
Nix

{ fetchurl, stdenv }:
let
inherit (stdenv) system;
version = "0.1.12";
hashes = {
x86_64-linux = "1hxlavcxy374yypfamlkygjg662lhll8j434qcvdawkvlidg5ii5";
x86_64-darwin = "1jkvhh710gwjnnjx59kaplx2ncfvkx9agfa76rr94sbjqq4igddm";
};
hash = hashes. ${system} or badSystem;
badSystem = throw "missing bootstrap hash for platform ${system}";
platforms = {
x86_64-linux = "x86_64-unknown-linux-musl";
x86_64-darwin = "x86_64-apple-darwin";
};
platform = platforms . ${system} or badSystem;
in stdenv.mkDerivation {
name = "cargo-vendor-${version}";
src = fetchurl {
url = "https://github.com/alexcrichton/cargo-vendor/releases/download/${version}/cargo-vendor-${version}-${platform}.tar.gz";
sha256 = hash;
};
phases = "unpackPhase installPhase";
installPhase = ''
install -Dm755 cargo-vendor $out/bin/cargo-vendor
'';
}