NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.06k stars 14.12k forks source link

Package request: foundry-rs #306023

Open rajeevn1 opened 6 months ago

rajeevn1 commented 6 months ago

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development

msanft commented 2 months ago

Is there work on this being done? @ByteSudoer

ByteSudoer commented 2 months ago

Hello @msanft, here is the derivation so far, I am still facing some errors while building the package.

{
  lib,
  rustPlatform,
  fetchFromGitHub,
  pkg-config,
  bzip2,
  dbus,
  libusb,
  openssl,
  rust-jemalloc-sys,
  zstd,
  stdenv,
  darwin,
}:

rustPlatform.buildRustPackage rec {
  pname = "foundry";
  version = "nightly-08-29-2024";

  src = fetchFromGitHub {
    owner = "foundry-rs";
    repo = "foundry";
    rev = "nightly-0d8302880b79fa9c3c4aa52ab446583dece19a34";
    hash = "sha256-ufgW/B9x9LW/HG9LPppIFCJ/sx01AqzDVEST2C6VGXY=";
  };

  cargoHash = "";
  cargoLock = {
    lockFile = ./Cargo.lock;
    outputHashes = {
      "alloy-consensus-0.2.1" = "sha256-01u6rTbXioAq1kP+K6FRwzkHRHxRc0Y1aGBWStKCyJ8=";
      "revm-13.0.0" = "sha256-x2kCHMGMINZEHX2MM4qRp5HpAODSWMDnQSNwN0qAnEc=";

    };
  };

  nativeBuildInputs = [
    pkg-config
  ];

  buildInputs =
    [
      bzip2
      dbus
      libusb
      openssl
      rust-jemalloc-sys
      zstd
    ]
    ++ lib.optionals stdenv.isDarwin [
      darwin.apple_sdk.frameworks.CoreFoundation
      darwin.apple_sdk.frameworks.CoreServices
      darwin.apple_sdk.frameworks.Security
      darwin.apple_sdk.frameworks.SystemConfiguration
    ];

  env = {
    ZSTD_SYS_USE_PKG_CONFIG = true;
  };

  meta = {
    description = "Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust";
    homepage = "https://github.com/foundry-rs/foundry";
    changelog = "https://github.com/foundry-rs/foundry/blob/${src.rev}/CHANGELOG.md";
    license = with lib.licenses; [
      asl20
      mit
    ];
    maintainers = with lib.maintainers; [ ByteSudoer ];
    mainProgram = "foundry";
  };
}

here is a screenshot of the error image