nixpkgs/pkgs/tools/security/yara/default.nix

57 lines
1.3 KiB
Nix
Raw Normal View History

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