2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-05-24 06:41:26 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, pcre
|
|
|
|
, pkg-config
|
|
|
|
, protobufc
|
2015-10-31 21:59:34 +00:00
|
|
|
, withCrypto ? true, openssl
|
|
|
|
, enableCuckoo ? true, jansson
|
2021-03-28 12:15:33 +01:00
|
|
|
, enableDex ? true
|
|
|
|
, enableDotNet ? true
|
|
|
|
, enableMacho ? true
|
|
|
|
, enableMagic ? true, file
|
2021-05-29 20:47:22 +01:00
|
|
|
, enableStatic ? false
|
2015-10-31 21:59:34 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-08-24 12:50:04 +01:00
|
|
|
version = "4.1.2";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "yara";
|
2015-10-31 21:59:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2017-02-02 03:58:13 +00:00
|
|
|
owner = "VirusTotal";
|
2015-10-31 21:59:34 +00:00
|
|
|
repo = "yara";
|
|
|
|
rev = "v${version}";
|
2021-08-24 12:50:04 +01:00
|
|
|
sha256 = "0n716snh0h5pk00kps6xvfi8z16xw12h1a8cd7w02cj2537xzj3m";
|
2015-10-31 21:59:34 +00:00
|
|
|
};
|
|
|
|
|
2020-05-24 06:41:26 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
2019-11-10 14:26:49 +00:00
|
|
|
|
2020-05-24 06:41:26 +01:00
|
|
|
buildInputs = [ pcre protobufc ]
|
2021-01-15 09:19:50 +00:00
|
|
|
++ lib.optionals withCrypto [ openssl ]
|
|
|
|
++ lib.optionals enableMagic [ file ]
|
|
|
|
++ lib.optionals enableCuckoo [ jansson ]
|
2015-10-31 21:59:34 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
preConfigure = "./bootstrap.sh";
|
|
|
|
|
2018-07-25 22:44:21 +01:00
|
|
|
configureFlags = [
|
2021-01-15 09:19:50 +00:00
|
|
|
(lib.withFeature withCrypto "crypto")
|
|
|
|
(lib.enableFeature enableCuckoo "cuckoo")
|
2021-03-28 12:15:33 +01:00
|
|
|
(lib.enableFeature enableDex "dex")
|
|
|
|
(lib.enableFeature enableDotNet "dotnet")
|
|
|
|
(lib.enableFeature enableMacho "macho")
|
|
|
|
(lib.enableFeature enableMagic "magic")
|
2021-05-29 20:47:22 +01:00
|
|
|
(lib.enableFeature enableStatic "static")
|
2018-07-25 22:44:21 +01:00
|
|
|
];
|
2015-10-31 21:59:34 +00:00
|
|
|
|
2021-05-29 20:47:22 +01:00
|
|
|
doCheck = enableStatic;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-10-31 21:59:34 +00:00
|
|
|
description = "The pattern matching swiss knife for malware researchers";
|
2020-05-24 06:41:26 +01:00
|
|
|
homepage = "http://Virustotal.github.io/yara/";
|
|
|
|
license = licenses.asl20;
|
2021-04-12 18:53:11 +01:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-05-24 06:41:26 +01:00
|
|
|
platforms = platforms.all;
|
2015-10-31 21:59:34 +00:00
|
|
|
};
|
|
|
|
}
|