Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cargo/hooks: allow hooks to be disabled
  • Loading branch information
jonringer authored and FRidh committed Mar 8, 2021
1 parent e83d926 commit 042adf0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pkgs/build-support/rust/hooks/cargo-build-hook.sh
Expand Up @@ -36,4 +36,6 @@ cargoBuildHook() {
echo "Finished cargoBuildHook"
}

buildPhase=cargoBuildHook
if [ -z "${dontCargoBuild-}" ] && [ -z "${buildPhase-}" ]; then
buildPhase=cargoBuildHook
fi
2 changes: 1 addition & 1 deletion pkgs/build-support/rust/hooks/cargo-check-hook.sh
Expand Up @@ -41,6 +41,6 @@ cargoCheckHook() {
runHook postCheck
}

if [ -z "${checkPhase-}" ]; then
if [ -z "${dontCargoCheck-}" ] && [ -z "${checkPhase-}" ]; then
checkPhase=cargoCheckHook
fi
2 changes: 1 addition & 1 deletion pkgs/build-support/rust/hooks/cargo-install-hook.sh
Expand Up @@ -43,7 +43,7 @@ cargoInstallHook() {
}


if [ -z "${installPhase-}" ]; then
if [ -z "${dontCargoInstall-}" ] && [ -z "${installPhase-}" ]; then
installPhase=cargoInstallHook
postBuildHooks+=(cargoInstallPostBuildHook)
fi
4 changes: 3 additions & 1 deletion pkgs/build-support/rust/hooks/cargo-setup-hook.sh
Expand Up @@ -77,7 +77,9 @@ cargoSetupPostPatchHook() {
echo "Finished cargoSetupPostPatchHook"
}

postUnpackHooks+=(cargoSetupPostUnpackHook)
if [ -z "${dontCargoSetupPostUnpack-}" ]; then
postUnpackHooks+=(cargoSetupPostUnpackHook)
fi

if [ -z ${cargoVendorDir-} ]; then
postPatchHooks+=(cargoSetupPostPatchHook)
Expand Down

0 comments on commit 042adf0

Please sign in to comment.