2014-09-14 01:14:48 +01:00
|
|
|
{ stdenv, fetchurl, zlib }:
|
|
|
|
|
|
|
|
/* Cargo binary snapshot */
|
|
|
|
|
2015-07-07 16:29:08 +01:00
|
|
|
let snapshotDate = "2015-06-17";
|
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-07-07 16:29:08 +01:00
|
|
|
then "g2h9l35123r72hqdwayd9h79kspfb4y9"
|
2015-01-08 08:38:20 +00:00
|
|
|
else if stdenv.system == "x86_64-linux"
|
2015-07-07 16:29:08 +01:00
|
|
|
then "fnx2rf1j8zvrplcc7xzf89czn0hf3397"
|
2015-01-08 08:38:20 +00:00
|
|
|
else if stdenv.system == "i686-darwin"
|
2015-07-07 16:29:08 +01:00
|
|
|
then "3viz3fi2jx18qjwrc90nfhm9cik59my6"
|
2015-01-08 08:38:20 +00:00
|
|
|
else if stdenv.system == "x86_64-darwin"
|
2015-07-07 16:29:08 +01:00
|
|
|
then "h2bf3db4vwz5cjjkn98lxayivdc6dflp"
|
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 {
|
2015-04-23 14:14:34 +01:00
|
|
|
inherit name version meta;
|
2015-01-08 08:38:20 +00:00
|
|
|
|
|
|
|
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-04 16:59:16 +00:00
|
|
|
./install.sh "--prefix=$out"
|
2014-10-10 15:59:37 +01:00
|
|
|
|
|
|
|
${postInstall}
|
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 "");
|
|
|
|
}
|