about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/karton-yaramatcher/default.nix
blob: afe6f2aaa4437f510b80a82f2c726015122629ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 ];
  };
}