nixpkgs/pkgs/development/compilers/rust/bootstrap.nix

28 lines
937 B
Nix
Raw Normal View History

{ stdenv, fetchurl, callPackage, version, hashes }:
let
platform =
if stdenv.hostPlatform.system == "i686-linux"
then "i686-unknown-linux-gnu"
else if stdenv.hostPlatform.system == "x86_64-linux"
then "x86_64-unknown-linux-gnu"
else if stdenv.hostPlatform.system == "armv7l-linux"
2018-01-16 12:17:40 +00:00
then "armv7-unknown-linux-gnueabihf"
else if stdenv.hostPlatform.system == "aarch64-linux"
2017-12-02 12:46:33 +00:00
then "aarch64-unknown-linux-gnu"
else if stdenv.hostPlatform.system == "i686-darwin"
then "i686-apple-darwin"
else if stdenv.hostPlatform.system == "x86_64-darwin"
then "x86_64-apple-darwin"
else throw "missing bootstrap url for platform ${stdenv.hostPlatform.system}";
src = fetchurl {
url = "https://static.rust-lang.org/dist/rust-${version}-${platform}.tar.gz";
2019-08-13 22:52:01 +01:00
sha256 = hashes.${platform};
};
2019-08-15 16:50:28 +01:00
in callPackage ./binary.nix
{ inherit version src platform;
versionType = "bootstrap";
}