2014-09-14 01:14:48 +01:00
|
|
|
{ stdenv, fetchurl, zlib }:
|
|
|
|
|
|
|
|
/* Cargo binary snapshot */
|
|
|
|
|
2015-03-01 19:31:57 +00:00
|
|
|
let snapshotDate = "2015-02-26";
|
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-03-01 19:31:57 +00:00
|
|
|
then "2a28b604d09b4a76a54a05d91f7f158692427b3a"
|
2015-01-08 08:38:20 +00:00
|
|
|
else if stdenv.system == "x86_64-linux"
|
2015-03-01 19:31:57 +00:00
|
|
|
then "7367f4aca86d38e209ef7236b00175df036c03e2"
|
2015-01-08 08:38:20 +00:00
|
|
|
else if stdenv.system == "i686-darwin"
|
2015-03-01 19:31:57 +00:00
|
|
|
then "e5cabb0a4a2b4e47f7b1ae9b802e2b5d0b14eac5"
|
2015-01-08 08:38:20 +00:00
|
|
|
else if stdenv.system == "x86_64-darwin"
|
2015-03-01 19:31:57 +00:00
|
|
|
then "3026c60ddd46d2bcf1cb178fc801095dbfba5286"
|
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"
|
2015-03-01 19:31:57 +00:00
|
|
|
cp -r cargo/bin "$out/bin"
|
2015-01-08 08:38:20 +00:00
|
|
|
'' + (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 "");
|
|
|
|
}
|