4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
46 lines
1.1 KiB
Nix
46 lines
1.1 KiB
Nix
{ lib, stdenv
|
|
, fetchFromGitHub
|
|
, autoreconfHook
|
|
, pcre
|
|
, pkg-config
|
|
, protobufc
|
|
, withCrypto ? true, openssl
|
|
, enableMagic ? true, file
|
|
, enableCuckoo ? true, jansson
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
version = "4.0.1";
|
|
pname = "yara";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "VirusTotal";
|
|
repo = "yara";
|
|
rev = "v${version}";
|
|
sha256 = "0dy8jf0pdn0wilxy1pj6pqjxg7icxkwax09w54np87gl9p00f5rk";
|
|
};
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
|
|
|
buildInputs = [ pcre protobufc ]
|
|
++ stdenv.lib.optionals withCrypto [ openssl ]
|
|
++ stdenv.lib.optionals enableMagic [ file ]
|
|
++ stdenv.lib.optionals enableCuckoo [ jansson ]
|
|
;
|
|
|
|
preConfigure = "./bootstrap.sh";
|
|
|
|
configureFlags = [
|
|
(stdenv.lib.withFeature withCrypto "crypto")
|
|
(stdenv.lib.enableFeature enableMagic "magic")
|
|
(stdenv.lib.enableFeature enableCuckoo "cuckoo")
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "The pattern matching swiss knife for malware researchers";
|
|
homepage = "http://Virustotal.github.io/yara/";
|
|
license = licenses.asl20;
|
|
platforms = platforms.all;
|
|
};
|
|
}
|