about summary refs log tree commit diff
path: root/pkgs/development/python-modules/karton-yaramatcher
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-04-13 22:38:41 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2021-04-13 22:38:41 +0200
commit4911885737616c49a4044ac77e7d1c5da131a32a (patch)
tree7fec4418e2948eea3dd266fa0ef55f5aa1eac594 /pkgs/development/python-modules/karton-yaramatcher
parente019872af81e4013fd518fcacfba74b1de21a50e (diff)
python3Packages.karton-yaramatcher: init at 1.0.0
Diffstat (limited to 'pkgs/development/python-modules/karton-yaramatcher')
-rw-r--r--pkgs/development/python-modules/karton-yaramatcher/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/karton-yaramatcher/default.nix b/pkgs/development/python-modules/karton-yaramatcher/default.nix
new file mode 100644
index 0000000000000..afe6f2aaa4437
--- /dev/null
+++ b/pkgs/development/python-modules/karton-yaramatcher/default.nix
@@ -0,0 +1,45 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, karton-core
+, python
+, yara-python
+}:
+
+buildPythonPackage rec {
+  pname = "karton-yaramatcher";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "CERT-Polska";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "093h5hbx2ss4ly523gvf10a5ky3vvin6wipigvhx13y1rdxl6c9n";
+  };
+
+  propagatedBuildInputs = [
+    karton-core
+    yara-python
+  ];
+
+  postPatch = ''
+    substituteInPlace requirements.txt \
+      --replace "karton-core==4.0.5" "karton-core" \
+      --replace "yara-python==4.0.2" "yara-python" \
+  '';
+
+  checkPhase = ''
+    runHook preCheck
+    ${python.interpreter} -m unittest discover
+    runHook postCheck
+  '';
+
+  pythonImportsCheck = [ "karton.yaramatcher" ];
+
+  meta = with lib; {
+    description = "File and analysis artifacts yara matcher for the Karton framework";
+    homepage = "https://github.com/CERT-Polska/karton-yaramatcher";
+    license = with licenses; [ bsd3 ];
+    maintainers = with maintainers; [ fab ];
+  };
+}