mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-27 16:15:05 +00:00
65 lines
1.4 KiB
Nix
65 lines
1.4 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
|
|
, enableStatic ? false
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "yara";
|
|
version = "4.2.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "VirusTotal";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-Ol2btm1A8JdvYrjD0hPtc17A4L9wgr4l30C8VrImVoE=";
|
|
};
|
|
|
|
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")
|
|
(lib.enableFeature enableStatic "static")
|
|
];
|
|
|
|
doCheck = enableStatic;
|
|
|
|
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;
|
|
};
|
|
}
|