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.
This commit is contained in:
parent
e42c17ee97
commit
0cde1dc524
@ -19,6 +19,12 @@ in stdenv.mkDerivation (args // {
|
|||||||
configurePhase = args.configurePhase or "true";
|
configurePhase = args.configurePhase or "true";
|
||||||
|
|
||||||
postUnpack = ''
|
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"
|
echo "Using rust registry from $rustRegistry"
|
||||||
(
|
(
|
||||||
cd $sourceRoot
|
cd $sourceRoot
|
||||||
|
@ -29,6 +29,4 @@
|
|||||||
license = [ licenses.mit licenses.asl20 ];
|
license = [ licenses.mit licenses.asl20 ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
|
|
||||||
setupHook = ./setup-hook.sh;
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ with ((import ./common.nix) { inherit stdenv; version = "2015-04-14"; });
|
|||||||
with rustPlatform;
|
with rustPlatform;
|
||||||
|
|
||||||
buildRustPackage rec {
|
buildRustPackage rec {
|
||||||
inherit name version meta setupHook;
|
inherit name version meta;
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://github.com/rust-lang/cargo.git";
|
url = "https://github.com/rust-lang/cargo.git";
|
||||||
|
@ -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
|
|
@ -20,7 +20,7 @@ let snapshotHash = if stdenv.system == "i686-linux"
|
|||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
inherit name version meta setupHook;
|
inherit name version meta;
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://static-rust-lang-org.s3.amazonaws.com/cargo-dist/${snapshotDate}/${snapshotName}";
|
url = "https://static-rust-lang-org.s3.amazonaws.com/cargo-dist/${snapshotDate}/${snapshotName}";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user