From 529b6eee47ea8ed038aa9432179a49b80241aa9b Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 29 May 2021 20:38:07 +0100 Subject: [PATCH 1/2] yara: 4.0.5 -> 4.1.1 (cherry picked from commit 2d7f554229393ddb0441dd31e37db7ad7b48dab0) --- pkgs/tools/security/yara/default.nix | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/pkgs/tools/security/yara/default.nix b/pkgs/tools/security/yara/default.nix index 506bf0f719d..3d4411d9087 100644 --- a/pkgs/tools/security/yara/default.nix +++ b/pkgs/tools/security/yara/default.nix @@ -1,5 +1,4 @@ { lib, stdenv -, fetchpatch , fetchFromGitHub , autoreconfHook , pcre @@ -14,14 +13,14 @@ }: stdenv.mkDerivation rec { - version = "4.0.5"; + version = "4.1.1"; pname = "yara"; src = fetchFromGitHub { owner = "VirusTotal"; repo = "yara"; rev = "v${version}"; - sha256 = "1gkdll2ygdlqy1f27a5b84gw2bq75ss7acsx06yhiss90qwdaalq"; + sha256 = "185j7firn7i5506rcp0va7sxdbminwrm06jsm4c70jf98qxmv522"; }; nativeBuildInputs = [ autoreconfHook pkg-config ]; @@ -34,19 +33,6 @@ stdenv.mkDerivation rec { preConfigure = "./bootstrap.sh"; - # If static builds are disabled, `make all-am` will fail to find libyara.a and - # cause a build failure. It appears that somewhere between yara 4.0.1 and - # 4.0.5, linking the yara binaries dynamically against libyara.so was broken. - # - # This was already fixed in yara master. Backport the patch to yara 4.0.5. - patches = [ - (fetchpatch { - name = "fix-build-with-no-static.patch"; - url = "https://github.com/VirusTotal/yara/commit/52e6866023b9aca26571c78fb8759bc3a51ba6dc.diff"; - sha256 = "074cf99j0rqiyacp60j1hkvjqxia7qwd11xjqgcr8jmfwihb38nr"; - }) - ]; - configureFlags = [ (lib.withFeature withCrypto "crypto") (lib.enableFeature enableCuckoo "cuckoo") From abc7f8ee129deb7422330561de66acb44afacc04 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 29 May 2021 20:47:22 +0100 Subject: [PATCH 2/2] yara: add enableStatic mode useful because tests can be enabled in this mode (cherry picked from commit 8cda1cc59e7cd01ce2ff18bc78f6b7a0e7faed19) --- pkgs/tools/security/yara/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/tools/security/yara/default.nix b/pkgs/tools/security/yara/default.nix index 3d4411d9087..3eb5495d2c9 100644 --- a/pkgs/tools/security/yara/default.nix +++ b/pkgs/tools/security/yara/default.nix @@ -10,6 +10,7 @@ , enableDotNet ? true , enableMacho ? true , enableMagic ? true, file +, enableStatic ? false }: stdenv.mkDerivation rec { @@ -40,8 +41,11 @@ stdenv.mkDerivation rec { (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/";