2024-01-27 21:21:26 +11:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
darwin,
|
|
|
|
fetchFromGitHub,
|
|
|
|
libusb1,
|
|
|
|
nix-update-script,
|
|
|
|
pkg-config,
|
|
|
|
rustPlatform,
|
|
|
|
solc,
|
|
|
|
versionCheckHook,
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "foundry";
|
2025-08-04 09:24:55 +00:00
|
|
|
version = "1.3.0";
|
2024-01-27 21:21:26 +11:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "foundry-rs";
|
|
|
|
repo = "foundry";
|
|
|
|
tag = "v${version}";
|
2025-08-04 09:24:55 +00:00
|
|
|
hash = "sha256-YMeGTPx3kqQ9CKFiH7rUEYzK0BCPksC1XIGfOj5MVd0=";
|
2024-01-27 21:21:26 +11:00
|
|
|
};
|
|
|
|
|
2025-08-04 09:24:55 +00:00
|
|
|
cargoHash = "sha256-TZTnaPsnfRjtfFMw5vdz4wV0ddjJ63TKrDHUkKvOfDw=";
|
2024-01-27 21:21:26 +11:00
|
|
|
|
2025-03-03 04:56:11 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.DarwinTools ];
|
2024-01-27 21:21:26 +11:00
|
|
|
|
2025-03-03 04:56:11 +01:00
|
|
|
buildInputs = [ solc ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libusb1 ];
|
2024-01-27 21:21:26 +11:00
|
|
|
|
|
|
|
# Tests are run upstream, and many perform I/O
|
|
|
|
# incompatible with the nix build sandbox.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
nativeInstallCheckInputs = [
|
|
|
|
versionCheckHook
|
|
|
|
];
|
|
|
|
versionCheckProgram = "${placeholder "out"}/bin/forge";
|
2025-04-05 14:02:09 +02:00
|
|
|
versionCheckProgramArg = "--version";
|
2024-01-27 21:21:26 +11:00
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
|
|
|
env = {
|
|
|
|
SVM_RELEASES_LIST_JSON =
|
2025-03-03 04:56:11 +01:00
|
|
|
if stdenv.hostPlatform.isDarwin then
|
2024-01-27 21:21:26 +11:00
|
|
|
# Confusingly, these are universal binaries, not amd64.
|
|
|
|
# See: https://github.com/ethereum/solidity/issues/12291#issuecomment-1974771433
|
|
|
|
"${./svm-lists/macosx-amd64.json}"
|
|
|
|
else
|
|
|
|
"${./svm-lists/linux-amd64.json}";
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/foundry-rs/foundry";
|
2025-07-22 11:19:46 +00:00
|
|
|
description = "Portable, modular toolkit for Ethereum application development written in Rust";
|
2024-01-27 21:21:26 +11:00
|
|
|
changelog = "https://github.com/foundry-rs/foundry/blob/v${version}/CHANGELOG.md";
|
|
|
|
license = with lib.licenses; [
|
|
|
|
asl20
|
|
|
|
mit
|
|
|
|
];
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
mitchmindtree
|
|
|
|
msanft
|
|
|
|
];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
};
|
|
|
|
}
|