about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/slither-analyzer/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/slither-analyzer/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/slither-analyzer/default.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/slither-analyzer/default.nix b/nixpkgs/pkgs/development/python-modules/slither-analyzer/default.nix
index 42d65ebdbe00..bccc5b97f728 100644
--- a/nixpkgs/pkgs/development/python-modules/slither-analyzer/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/slither-analyzer/default.nix
@@ -11,6 +11,8 @@
 , solc
 , web3
 , withSolc ? false
+, testers
+, slither-analyzer
 }:
 
 buildPythonPackage rec {
@@ -44,9 +46,38 @@ buildPythonPackage rec {
       --prefix PATH : "${lib.makeBinPath [ solc ]}"
   '';
 
+  # required for pythonImportsCheck
+  postInstall = ''
+    export HOME="$TEMP"
+  '';
+
+  pythonImportsCheck = [
+    "slither"
+    "slither.all_exceptions"
+    "slither.analyses"
+    "slither.core"
+    "slither.detectors"
+    "slither.exceptions"
+    "slither.formatters"
+    "slither.printers"
+    "slither.slither"
+    "slither.slithir"
+    "slither.solc_parsing"
+    "slither.utils"
+    "slither.visitors"
+    "slither.vyper_parsing"
+  ];
+
   # No Python tests
   doCheck = false;
 
+  passthru.tests = {
+    version = testers.testVersion {
+      package = slither-analyzer;
+      command = "HOME=$TMPDIR slither --version";
+    };
+  };
+
   meta = with lib; {
     description = "Static Analyzer for Solidity";
     longDescription = ''
@@ -57,6 +88,7 @@ buildPythonPackage rec {
     homepage = "https://github.com/trailofbits/slither";
     changelog = "https://github.com/crytic/slither/releases/tag/${version}";
     license = licenses.agpl3Plus;
+    mainProgram = "slither";
     maintainers = with maintainers; [ arturcygan fab hellwolf ];
   };
 }