Commit 3e2a2655 authored by Gaetan Lepage's avatar Gaetan Lepage
Browse files

python3Packages.slither-analyzer: cleanup

parent 1acadcae
Loading
Loading
Loading
Loading
+19 −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,16 @@ buildPythonPackage (finalAttrs: {
    web3
  ];

  nativeInstallCheckInputs = [ versionCheckHook ];
  nativeCheckInputs = [
    versionCheckHook
    writableTmpDirAsHomeHook
  ];

  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 +75,6 @@ buildPythonPackage (finalAttrs: {
    "slither.vyper_parsing"
  ];

  doInstallCheck = true;

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