From 0cde1dc52425f12be6f7311737abe98813e43c29 Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Thu, 23 Apr 2015 15:14:34 +0200 Subject: [PATCH] cargo: Remove setupHook Instead, move that code into buildRustPackage. The setup hook was only doing part of the work anyway, and having it in a separate place was obscuring what was really going on. --- pkgs/build-support/rust/default.nix | 6 ++++++ pkgs/development/tools/build-managers/cargo/common.nix | 2 -- pkgs/development/tools/build-managers/cargo/default.nix | 2 +- pkgs/development/tools/build-managers/cargo/setup-hook.sh | 6 ------ pkgs/development/tools/build-managers/cargo/snapshot.nix | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) delete mode 100644 pkgs/development/tools/build-managers/cargo/setup-hook.sh diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index 6a5e4b86194f..37175114d81e 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -19,6 +19,12 @@ in stdenv.mkDerivation (args // { configurePhase = args.configurePhase or "true"; postUnpack = '' + echo "Using cargo deps from $cargoDeps" + cp -r $cargoDeps deps + chmod +w deps -R + + export CARGO_HOME=$(realpath deps) + echo "Using rust registry from $rustRegistry" ( cd $sourceRoot diff --git a/pkgs/development/tools/build-managers/cargo/common.nix b/pkgs/development/tools/build-managers/cargo/common.nix index d993681b28f8..84158e65a4d8 100644 --- a/pkgs/development/tools/build-managers/cargo/common.nix +++ b/pkgs/development/tools/build-managers/cargo/common.nix @@ -29,6 +29,4 @@ license = [ licenses.mit licenses.asl20 ]; platforms = platforms.linux; }; - - setupHook = ./setup-hook.sh; } diff --git a/pkgs/development/tools/build-managers/cargo/default.nix b/pkgs/development/tools/build-managers/cargo/default.nix index 3235157b015f..0e70cb9232b1 100644 --- a/pkgs/development/tools/build-managers/cargo/default.nix +++ b/pkgs/development/tools/build-managers/cargo/default.nix @@ -6,7 +6,7 @@ with ((import ./common.nix) { inherit stdenv; version = "2015-04-14"; }); with rustPlatform; buildRustPackage rec { - inherit name version meta setupHook; + inherit name version meta; src = fetchgit { url = "https://github.com/rust-lang/cargo.git"; diff --git a/pkgs/development/tools/build-managers/cargo/setup-hook.sh b/pkgs/development/tools/build-managers/cargo/setup-hook.sh deleted file mode 100644 index 91a7f0f5bc8e..000000000000 --- a/pkgs/development/tools/build-managers/cargo/setup-hook.sh +++ /dev/null @@ -1,6 +0,0 @@ -if [[ -n "$cargoDeps" ]]; then - echo "Using cargo deps from $cargoDeps" - cp -r $cargoDeps deps - chmod +w deps -R - export CARGO_HOME=$(realpath deps) -fi diff --git a/pkgs/development/tools/build-managers/cargo/snapshot.nix b/pkgs/development/tools/build-managers/cargo/snapshot.nix index cc950af3f50d..a76fb4601e8b 100644 --- a/pkgs/development/tools/build-managers/cargo/snapshot.nix +++ b/pkgs/development/tools/build-managers/cargo/snapshot.nix @@ -20,7 +20,7 @@ let snapshotHash = if stdenv.system == "i686-linux" in stdenv.mkDerivation { - inherit name version meta setupHook; + inherit name version meta; src = fetchurl { url = "https://static-rust-lang-org.s3.amazonaws.com/cargo-dist/${snapshotDate}/${snapshotName}";