summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/tools/build-managers/cargo/head.nix39
-rw-r--r--pkgs/top-level/all-packages.nix7
2 files changed, 44 insertions, 2 deletions
diff --git a/pkgs/development/tools/build-managers/cargo/head.nix b/pkgs/development/tools/build-managers/cargo/head.nix
new file mode 100644
index 000000000000..d5a2dce66828
--- /dev/null
+++ b/pkgs/development/tools/build-managers/cargo/head.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchgit, rustPlatform, file, curl, python, pkgconfig, openssl
+, cmake, zlib, makeWrapper }:
+
+with rustPlatform;
+
+with ((import ./common.nix) {
+  inherit stdenv rustc;
+  version = "2016-01-10";
+});
+
+buildRustPackage rec {
+  inherit name version meta passthru;
+
+  # Needs to use fetchgit instead of fetchFromGitHub to fetch submodules
+  src = fetchgit {
+    url = "git://github.com/rust-lang/cargo";
+    rev = "ca373452de159491354cf38279dbc19308c91e72";
+    sha256 = "0fx88b3ndvzhfwq159xavs0z5c7jww231kd65cbzyih9g0ab9x65";
+  };
+
+  depsSha256 = "0csagk2dnwg5z0vbxilz1kzcygd4llw7s81ka0xn1g05x30jqrnn";
+
+  buildInputs = [ file curl pkgconfig python openssl cmake zlib makeWrapper ];
+
+  configurePhase = ''
+    ./configure --enable-optimize --prefix=$out --local-cargo=${cargo}/bin/cargo
+  '';
+
+  buildPhase = "make";
+
+  # Disable check phase as there are lots of failures (some probably due to
+  # trying to access the network).
+  doCheck = false;
+
+  installPhase = ''
+    make install
+    ${postInstall}
+  '';
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index eddb75c31446..52ec706ad7ba 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -4878,8 +4878,7 @@ let
   rustPlatform = rustStable;
 
   rustStable = recurseIntoAttrs (makeRustPlatform cargo rustStable);
-  rustUnstable = recurseIntoAttrs (makeRustPlatform
-    (cargo.override { rustPlatform = rustUnstableCargoPlatform; }) rustUnstable);
+  rustUnstable = recurseIntoAttrs (makeRustPlatform cargoUnstable rustUnstable);
 
   # rust platform to build cargo itself (with cargoSnapshot)
   rustCargoPlatform = makeRustPlatform (cargoSnapshot rustc) rustCargoPlatform;
@@ -5533,6 +5532,10 @@ let
     rustPlatform = rustCargoPlatform;
   };
 
+  cargoUnstable = callPackage ../development/tools/build-managers/cargo/head.nix {
+    rustPlatform = rustUnstableCargoPlatform;
+  };
+
   cargoSnapshot = rustc:
     callPackage ../development/tools/build-managers/cargo/snapshot.nix {
       inherit rustc;