biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / security / yara / default.nix
blob44b1544ab935f7068544b5256f922892edb0bcd7
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchpatch,
6   autoreconfHook,
7   pcre,
8   pkg-config,
9   protobufc,
10   withCrypto ? true,
11   openssl,
12   enableCuckoo ? true,
13   jansson,
14   enableDex ? true,
15   enableDotNet ? true,
16   enableMacho ? true,
17   enableMagic ? true,
18   file,
19   enableStatic ? false,
22 stdenv.mkDerivation rec {
23   pname = "yara";
24   version = "4.5.0";
26   src = fetchFromGitHub {
27     owner = "VirusTotal";
28     repo = "yara";
29     rev = "refs/tags/v${version}";
30     hash = "sha256-AecHsUBtBleUkWuYMQ4Tx/PY8cs9j7JwqncBziJD0hA=";
31   };
33   patches = [
34     (fetchpatch {
35       name = "LFS64.patch";
36       url = "https://github.com/VirusTotal/yara/commit/833a580430abe0fbc9bc17a21fb95bf36dacf367.patch";
37       hash = "sha256-EmwyDsxaNd9zfpAOu6ZB9kzg04qB7LAD7UJB3eAuKd8=";
38     })
39   ];
41   nativeBuildInputs = [
42     autoreconfHook
43     pkg-config
44   ];
46   buildInputs =
47     [
48       pcre
49       protobufc
50     ]
51     ++ lib.optionals withCrypto [ openssl ]
52     ++ lib.optionals enableMagic [ file ]
53     ++ lib.optionals enableCuckoo [ jansson ];
55   preConfigure = "./bootstrap.sh";
57   configureFlags = [
58     (lib.withFeature withCrypto "crypto")
59     (lib.enableFeature enableCuckoo "cuckoo")
60     (lib.enableFeature enableDex "dex")
61     (lib.enableFeature enableDotNet "dotnet")
62     (lib.enableFeature enableMacho "macho")
63     (lib.enableFeature enableMagic "magic")
64     (lib.enableFeature enableStatic "static")
65   ];
67   doCheck = enableStatic;
69   meta = with lib; {
70     description = "Tool to perform pattern matching for malware-related tasks";
71     homepage = "http://Virustotal.github.io/yara/";
72     changelog = "https://github.com/VirusTotal/yara/releases/tag/v${version}";
73     license = licenses.asl20;
74     maintainers = with maintainers; [ fab ];
75     mainProgram = "yara";
76     platforms = platforms.all;
77   };