2014-09-14 01:14:48 +01:00
|
|
|
{ stdenv, fetchurl, zlib }:
|
|
|
|
|
|
|
|
/* Cargo binary snapshot */
|
|
|
|
|
2015-01-26 19:31:49 +00:00
|
|
|
let snapshotDate = "2015-01-24";
|
2015-01-08 08:38:20 +00:00
|
|
|
in
|
2014-09-14 01:14:48 +01:00
|
|
|
|
2015-01-08 08:38:20 +00:00
|
|
|
with ((import ./common.nix) { inherit stdenv; version = "snapshot-${snapshotDate}"; });
|
|
|
|
|
|
|
|
let snapshotHash = if stdenv.system == "i686-linux"
|
2015-01-26 19:31:49 +00:00
|
|
|
then "96213038f850569f1c4fa6a0d146c6155c0d566b"
|
2015-01-08 08:38:20 +00:00
|
|
|
else if stdenv.system == "x86_64-linux"
|
2015-01-26 19:31:49 +00:00
|
|
|
then "4d87486493c2881edced7b1d2f8beaac32aaa5b5"
|
2015-01-08 08:38:20 +00:00
|
|
|
else if stdenv.system == "i686-darwin"
|
2015-01-26 19:31:49 +00:00
|
|
|
then "17b9fc782e86bffe170abb83a01e0cb7c90a0daa"
|
2015-01-08 08:38:20 +00:00
|
|
|
else if stdenv.system == "x86_64-darwin"
|
2015-01-26 19:31:49 +00:00
|
|
|
then "18887bdbd3e6d2a127aa34216fa06e9877b0fbc6"
|
2015-01-08 08:38:20 +00:00
|
|
|
else throw "no snapshot for platform ${stdenv.system}";
|
|
|
|
snapshotName = "cargo-nightly-${platform}.tar.gz";
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit name;
|
|
|
|
inherit version;
|
|
|
|
inherit meta;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://static-rust-lang-org.s3.amazonaws.com/cargo-dist/${snapshotDate}/${snapshotName}";
|
|
|
|
sha1 = snapshotHash;
|
|
|
|
};
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"
|
|
|
|
cp -r bin "$out/bin"
|
|
|
|
'' + (if stdenv.isLinux then ''
|
|
|
|
patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.cc.dynamicLinker}" \
|
2015-01-15 04:25:26 +00:00
|
|
|
--set-rpath "${stdenv.cc.cc}/lib/:${stdenv.cc.cc}/lib64/:${zlib}/lib" \
|
2015-01-08 08:38:20 +00:00
|
|
|
"$out/bin/cargo"
|
|
|
|
'' else "");
|
|
|
|
}
|