diff --git a/pkgs/by-name/fo/foundry/package.nix b/pkgs/by-name/fo/foundry/package.nix index 04791ba1efeb..c9e1947cf4a3 100644 --- a/pkgs/by-name/fo/foundry/package.nix +++ b/pkgs/by-name/fo/foundry/package.nix @@ -5,6 +5,7 @@ fetchFromGitHub, libusb1, nix-update-script, + perl, pkg-config, rustPlatform, versionCheckHook, @@ -14,6 +15,8 @@ rustPlatform.buildRustPackage (finalAttrs: { pname = "foundry"; version = "1.7.0"; + __structuredAttrs = true; + src = fetchFromGitHub { owner = "foundry-rs"; repo = "foundry"; @@ -23,7 +26,12 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-iAWUEVgOgn2Zw9fINxyH9Bynh+flzCY40YFGoVLgG8k="; + strictDeps = true; + nativeBuildInputs = [ + # `sha3-asm`'s build script runs cryptogams perl scripts to generate + # Keccak assembly, so perl must be available at build time. + perl pkg-config ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ]; @@ -43,6 +51,13 @@ rustPlatform.buildRustPackage (finalAttrs: { passthru.updateScript = nix-update-script { }; env = { + # The build script in `crates/common/build.rs` uses vergen to embed + # `git describe` / SHA output, but the GitHub source tarball has no `.git` + # directory. Pre-set the values so vergen reuses them instead of shelling + # out to git. + VERGEN_GIT_SHA = finalAttrs.src.rev; + VERGEN_GIT_DESCRIBE = "v${finalAttrs.version}"; + SVM_RELEASES_LIST_JSON = if stdenv.hostPlatform.isDarwin then # Confusingly, these are universal binaries, not amd64. @@ -64,6 +79,7 @@ rustPlatform.buildRustPackage (finalAttrs: { beeb mitchmindtree msanft + samooyo ]; platforms = lib.platforms.unix; };