Unverified Commit 555292d2 authored by Yt's avatar Yt Committed by GitHub
Browse files

python3Packages.slither-analyzer: cleanup, fix on darwin (#486564)

parents f7cf7964 da269b0e
Loading
Loading
Loading
Loading
+20 −12
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  crytic-compile,
  fetchFromGitHub,

  # build-system
  hatchling,

  # nativeBuildInputs
  makeWrapper,

  # dependencies
  crytic-compile,
  packaging,
  prettytable,
  solc,
  testers,
  versionCheckHook,
  web3,

  # tests
  versionCheckHook,
  writableTmpDirAsHomeHook,

  # postFixup
  solc,

  withSolc ? false,
}:

@@ -37,18 +48,17 @@ buildPythonPackage (finalAttrs: {
    web3
  ];

  nativeInstallCheckInputs = [ versionCheckHook ];
  nativeCheckInputs = [
    versionCheckHook
    writableTmpDirAsHomeHook
  ];
  versionCheckKeepEnvironment = [ "HOME" ];

  postFixup = lib.optionalString withSolc ''
    wrapProgram $out/bin/slither \
      --prefix PATH : "${lib.makeBinPath [ solc ]}"
  '';

  # required for pythonImportsCheck
  postInstall = ''
    export HOME="$TEMP"
  '';

  pythonImportsCheck = [
    "slither"
    "slither.all_exceptions"
@@ -66,8 +76,6 @@ buildPythonPackage (finalAttrs: {
    "slither.vyper_parsing"
  ];

  doInstallCheck = true;

  meta = {
    description = "Static Analyzer for Solidity";
    longDescription = ''