git.iko.soy/typeable/nixpkgs
on master help sign in
yara: init at 3.4.0
commit0c754ba8242707b6a7c3df7419e92d505daa066a authorStéphane Jourdois <sjourdois@gmail.com> dateSat 31 Oct 2015, 22:59 (11 years ago) parented1355e
2 files changed+66
pkgs/tools/security/yara/default.nix+64 pkgs/top-level/all-packages.nix+2
pkgs/tools/security/yara/default.nixnew file+64
@@ -0,0 +1,64 @@
1+{ stdenv, fetchurl, fetchFromGitHub, autoconf, automake, libtool, pcre
2+, withCrypto ? true, openssl
3+, enableMagic ? true, file
4+, enableCuckoo ? true, jansson
5+}:
6+
7+stdenv.mkDerivation rec {
8+ version = "3.4.0";
9+ name = "yara-${version}";
10+
11+ src = fetchFromGitHub {
12+ owner = "plusvic";
13+ repo = "yara";
14+ rev = "v${version}";
15+ sha256 = "1rv1xixbjqx1vkcij8r01rq08ncqgy6nn98xvkrpixwvi4fy956s";
16+ };
17+
18+ # FIXME: this is probably not the right way to make it work
19+ # make[2]: *** No rule to make target 'libyara/.libs/libyara.a', needed by 'yara'. Stop.
20+ dynamic_library_extension = ""
21+ + stdenv.lib.optionalString stdenv.isLinux "so"
22+ + stdenv.lib.optionalString stdenv.isDarwin "dylib"
23+ ;
24+ prePatch = ''
25+ cat >staticlibrary.patch <<EOF
26+ --- a/Makefile.am 2015-11-01 11:39:12.000000000 +0100
27+ +++ b/Makefile.am 2015-11-01 11:45:32.000000000 +0100
28+ @@ -12 +12 @@
29+ -yara_LDADD = libyara/.libs/libyara.a
30+ +yara_LDADD = libyara/.libs/libyara.${dynamic_library_extension}
31+ @@ -15 +15 @@
32+ -yarac_LDADD = libyara/.libs/libyara.a
33+ +yarac_LDADD = libyara/.libs/libyara.${dynamic_library_extension}
34+ EOF
35+ '';
36+ patches = [
37+ (fetchurl {
38+ url = "https://github.com/plusvic/yara/pull/261.diff";
39+ sha256 = "1fkxnk84ryvrjq7p225xvw9pn5gm2bjia2jz38fclwbsaxdi6p3b";
40+ })
41+ "staticlibrary.patch"
42+ ];
43+
44+ buildInputs = [ autoconf automake libtool pcre]
45+ ++ stdenv.lib.optionals withCrypto [ openssl ]
46+ ++ stdenv.lib.optionals enableMagic [ file ]
47+ ++ stdenv.lib.optionals enableCuckoo [ jansson ]
48+ ;
49+
50+ preConfigure = "./bootstrap.sh";
51+
52+ configureFlags = ""
53+ + stdenv.lib.optionalString withCrypto "--with-crypto "
54+ + stdenv.lib.optionalString enableMagic "--enable-magic "
55+ + stdenv.lib.optionalString enableCuckoo "--enable-cuckoo "
56+ ;
57+
58+ meta = with stdenv.lib; {
59+ description = "The pattern matching swiss knife for malware researchers";
60+ homepage = http://plusvic.github.io/yara/;
61+ license = licenses.asl20;
62+ platforms = stdenv.lib.platforms.all;
63+ };
64+}
pkgs/top-level/all-packages.nix+2
@@ -15291,6 +15291,8 @@ let
1529115291
1529215292 yandex-disk = callPackage ../tools/filesystems/yandex-disk { };
1529315293
15294+ yara = callPackage ../tools/security/yara { };
15295+
1529415296 zdfmediathk = callPackage ../applications/video/zdfmediathk { };
1529515297
1529615298 zopfli = callPackage ../tools/compression/zopfli { };