diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2017-04-15 12:42:09 +0200 |
---|---|---|
committer | Jörg Thalheim <joerg@thalheim.io> | 2017-04-15 13:26:51 +0200 |
commit | be70c02461e4e9e0ff163159a85edaef6188a313 (patch) | |
tree | 4653aadb9054ec9756339f224d708cd06e5df356 /pkgs | |
parent | 33cfee81777341cd335ccbe237db329b3fc7c444 (diff) | |
download | nixlib-be70c02461e4e9e0ff163159a85edaef6188a313.tar nixlib-be70c02461e4e9e0ff163159a85edaef6188a313.tar.gz nixlib-be70c02461e4e9e0ff163159a85edaef6188a313.tar.bz2 nixlib-be70c02461e4e9e0ff163159a85edaef6188a313.tar.lz nixlib-be70c02461e4e9e0ff163159a85edaef6188a313.tar.xz nixlib-be70c02461e4e9e0ff163159a85edaef6188a313.tar.zst nixlib-be70c02461e4e9e0ff163159a85edaef6188a313.zip |
buildRustPackage: add standard package hooks
when overriding build phases also the standard hooks should be called
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/rust/default.nix | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index 1287d401e4a2..087bc653aa39 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -27,7 +27,11 @@ in stdenv.mkDerivation (args // { buildInputs = [ git rust.cargo rust.rustc ] ++ buildInputs; - configurePhase = args.configurePhase or "true"; + configurePhase = args.configurePhase or '' + runHook preConfigure + # noop + runHook postConfigure + ''; postUnpack = '' eval "$cargoDepsHook" @@ -94,21 +98,27 @@ in stdenv.mkDerivation (args // { '' + (args.prePatch or ""); buildPhase = with builtins; args.buildPhase or '' + runHook preBuild echo "Running cargo build --release ${concatStringsSep " " cargoBuildFlags}" cargo build --release ${concatStringsSep " " cargoBuildFlags} + runHook postBuild ''; checkPhase = args.checkPhase or '' + runHook preCheck echo "Running cargo test" cargo test + runHook postCheck ''; doCheck = args.doCheck or true; installPhase = args.installPhase or '' + runHook preInstall mkdir -p $out/bin for f in $(find target/release -maxdepth 1 -type f); do cp $f $out/bin done; + runHook postInstall ''; }) |