53 lines
1.3 KiB
Nix
53 lines
1.3 KiB
Nix
{ lib, stdenv
|
|
, fetchFromGitHub
|
|
, autoreconfHook
|
|
, pcre
|
|
, pkg-config
|
|
, protobufc
|
|
, withCrypto ? true, openssl
|
|
, enableCuckoo ? true, jansson
|
|
, enableDex ? true
|
|
, enableDotNet ? true
|
|
, enableMacho ? true
|
|
, enableMagic ? true, file
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
version = "4.1.1";
|
|
pname = "yara";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "VirusTotal";
|
|
repo = "yara";
|
|
rev = "v${version}";
|
|
sha256 = "185j7firn7i5506rcp0va7sxdbminwrm06jsm4c70jf98qxmv522";
|
|
};
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
|
|
|
buildInputs = [ pcre protobufc ]
|
|
++ lib.optionals withCrypto [ openssl ]
|
|
++ lib.optionals enableMagic [ file ]
|
|
++ lib.optionals enableCuckoo [ jansson ]
|
|
;
|
|
|
|
preConfigure = "./bootstrap.sh";
|
|
|
|
configureFlags = [
|
|
(lib.withFeature withCrypto "crypto")
|
|
(lib.enableFeature enableCuckoo "cuckoo")
|
|
(lib.enableFeature enableDex "dex")
|
|
(lib.enableFeature enableDotNet "dotnet")
|
|
(lib.enableFeature enableMacho "macho")
|
|
(lib.enableFeature enableMagic "magic")
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "The pattern matching swiss knife for malware researchers";
|
|
homepage = "http://Virustotal.github.io/yara/";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ fab ];
|
|
platforms = platforms.all;
|
|
};
|
|
}
|