buildBazelPackage: support fetchAttrs.hash

This commit is contained in:
nicoo 2024-09-15 14:36:12 +00:00
parent 50ca073e52
commit c361b3f7c8

View File

@ -64,7 +64,7 @@ let
;
};
fBuildAttrs = fArgs // buildAttrs;
fFetchAttrs = fArgs // removeAttrs fetchAttrs [ "sha256" ];
fFetchAttrs = fArgs // removeAttrs fetchAttrs [ "hash" "sha256" ];
bazelCmd = { cmd, additionalFlags, targets, targetRunFlags ? [ ] }:
lib.optionalString (targets != [ ]) ''
# See footnote called [USER and BAZEL_USE_CPP_ONLY_TOOLCHAIN variables]
@ -197,8 +197,10 @@ stdenv.mkDerivation (fBuildAttrs // {
dontFixup = true;
allowedRequisites = [];
outputHashAlgo = "sha256";
outputHash = fetchAttrs.sha256;
inherit (lib.fetchers.normalizeHash { hashTypes = [ "sha256" ]; } fetchAttrs)
outputHash
outputHashAlgo
;
});
nativeBuildInputs = fBuildAttrs.nativeBuildInputs or [] ++ [ (bazel.override { enableNixHacks = true; }) ];