forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It's still compiling ☕
- Loading branch information
Showing
3 changed files
with
132 additions
and
57 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ lib | ||
, stdenv | ||
, fetchFromGitHub | ||
, rustPlatform | ||
, rustc | ||
, libusb1 | ||
, darwin | ||
, solc-bin-src | ||
}: | ||
|
||
rustPlatform.buildRustPackage rec { | ||
pname = "foundry"; | ||
version = "0.2.0-dev"; | ||
|
||
# To update run the following command and change `rev` and `hash` | ||
# nix-prefetch-github foundry-rs foundry --nix --rev 3e962e2efe17396886fcb1fd141ccf4204cd3a21 | ||
src = fetchFromGitHub { | ||
owner = "foundry-rs"; | ||
repo = "foundry"; | ||
rev = "3e962e2efe17396886fcb1fd141ccf4204cd3a21"; | ||
hash = "sha256-4ESOsNYtTPSnvtBtcXZ5FJXGCQOpW1mtlVOLyeJnLCE="; | ||
}; | ||
|
||
cargoLock = { | ||
lockFile = src + "/Cargo.lock"; | ||
allowBuiltinFetchGit = true; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
libusb1 | ||
] ++ lib.optionals stdenv.isDarwin [ darwin.DarwinTools ]; | ||
|
||
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AppKit ]; | ||
|
||
# Tests fail | ||
doCheck = false; | ||
|
||
# Enable svm-rs to build without network access by giving it a list of solc releases. | ||
# We take the list from our solc flake repo so that it does not update unless we want to. | ||
# Our repo: https://github.com/EspressoSystems/nix-solc-bin | ||
# Upstream URL: https://binaries.soliditylang.org/linux-amd64/list.json | ||
env = let platform = if stdenv.isLinux then "linux-amd64" else "macosx-amd64"; in { | ||
SVM_RELEASES_LIST_JSON = "${solc-bin-src}/list-${platform}.json"; | ||
# Make `vergen` produce a meaningful version. | ||
VERGEN_BUILD_TIMESTAMP = "0"; | ||
VERGEN_BUILD_SEMVER = version; | ||
VERGEN_GIT_SHA = src.rev; | ||
VERGEN_GIT_COMMIT_TIMESTAMP = "0"; | ||
VERGEN_GIT_BRANCH = "master"; | ||
VERGEN_RUSTC_SEMVER = rustc.version; | ||
VERGEN_RUSTC_CHANNEL = "stable"; | ||
VERGEN_CARGO_PROFILE = "release"; | ||
}; | ||
|
||
meta = with lib; { | ||
description = "A blazing fast, portable and modular toolkit for Ethereum application development"; | ||
homepage = "https://github.com/foundry-rs/foundry"; | ||
license = with licenses; [ mit apsl20 ]; | ||
maintainers = [ ]; | ||
}; | ||
} |