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