2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-05-29 06:06:01 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, pcre
|
|
|
|
, pkg-config
|
|
|
|
, protobufc
|
2020-04-24 23:36:52 +00:00
|
|
|
, withCrypto ? true, openssl
|
|
|
|
, enableCuckoo ? true, jansson
|
2021-04-13 19:44:15 +00:00
|
|
|
, enableDex ? true
|
|
|
|
, enableDotNet ? true
|
|
|
|
, enableMacho ? true
|
|
|
|
, enableMagic ? true, file
|
2021-06-04 09:07:49 +00:00
|
|
|
, enableStatic ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-10-28 06:52:43 +00:00
|
|
|
version = "4.1.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "yara";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "VirusTotal";
|
|
|
|
repo = "yara";
|
|
|
|
rev = "v${version}";
|
2021-10-28 06:52:43 +00:00
|
|
|
sha256 = "sha256-7t2KksI3l+wFHqUSw2L4FXepMTJfTow/cTFYA47YBqY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
buildInputs = [ pcre protobufc ]
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optionals withCrypto [ openssl ]
|
|
|
|
++ lib.optionals enableMagic [ file ]
|
|
|
|
++ lib.optionals enableCuckoo [ jansson ]
|
2020-04-24 23:36:52 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
preConfigure = "./bootstrap.sh";
|
|
|
|
|
|
|
|
configureFlags = [
|
2021-01-15 22:18:51 +00:00
|
|
|
(lib.withFeature withCrypto "crypto")
|
|
|
|
(lib.enableFeature enableCuckoo "cuckoo")
|
2021-04-13 19:44:15 +00:00
|
|
|
(lib.enableFeature enableDex "dex")
|
|
|
|
(lib.enableFeature enableDotNet "dotnet")
|
|
|
|
(lib.enableFeature enableMacho "macho")
|
|
|
|
(lib.enableFeature enableMagic "magic")
|
2021-06-04 09:07:49 +00:00
|
|
|
(lib.enableFeature enableStatic "static")
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
doCheck = enableStatic;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The pattern matching swiss knife for malware researchers";
|
2020-05-29 06:06:01 +00:00
|
|
|
homepage = "http://Virustotal.github.io/yara/";
|
|
|
|
license = licenses.asl20;
|
2021-04-13 19:44:15 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
2020-05-29 06:06:01 +00:00
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|