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 {
|
|
|
|
pname = "yara";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "4.2.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "VirusTotal";
|
2022-03-05 16:20:37 +00:00
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
hash = "sha256-Ol2btm1A8JdvYrjD0hPtc17A4L9wgr4l30C8VrImVoE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
pkg-config
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
buildInputs = [
|
|
|
|
pcre
|
|
|
|
protobufc
|
|
|
|
] ++ 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
|
|
|
};
|
|
|
|
}
|