Skip to content

Commit

Permalink
Merge pull request #117873 from fabaff/apkid
Browse files Browse the repository at this point in the history
apkid: init at 2.1.1, python3Packages.yara-python: init at 4.0.5
  • Loading branch information
dotlambda committed Apr 13, 2021
2 parents fc43a7f + d549dc3 commit 650553a
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 2 deletions.
41 changes: 41 additions & 0 deletions pkgs/development/python-modules/yara-python/default.nix
@@ -0,0 +1,41 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, yara
}:

buildPythonPackage rec {
pname = "yara-python";
version = "4.0.5";

src = fetchFromGitHub {
owner = "VirusTotal";
repo = "yara-python";
rev = "v${version}";
sha256 = "1qd0aw5p48ay77hgj0hgzpvbmq1933mknk134aqdb32036rlc5sq";
};

buildInputs = [
yara
];

checkInputs = [
pytestCheckHook
];

setupPyBuildFlags = [
"--dynamic-linking"
];

pytestFlagsArray = [ "tests.py" ];

pythonImportsCheck = [ "yara" ];

meta = with lib; {
description = "Python interface for YARA";
homepage = "https://github.com/VirusTotal/yara-python";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ fab ];
};
}
44 changes: 44 additions & 0 deletions pkgs/development/tools/apkid/default.nix
@@ -0,0 +1,44 @@
{ lib
, fetchFromGitHub
, python3
}:

python3.pkgs.buildPythonApplication rec {
pname = "apkid";
version = "2.1.1";

src = fetchFromGitHub {
owner = "rednaga";
repo = "APKiD";
rev = "v${version}";
sha256 = "1p6kdjjw2jhwr875445w43k46n6zwpz0l0phkl8d3y1v4gi5l6dx";
};

propagatedBuildInputs = with python3.pkgs; [
yara-python
];

checkInputs = with python3.pkgs; [
pytestCheckHook
];

preBuild = ''
# Prepare the YARA rules
${python3.interpreter} prep-release.py
'';

postPatch = ''
# The next release will have support for later yara-python releases
substituteInPlace setup.py \
--replace "yara-python==3.11.0" "yara-python"
'';

pythonImportsCheck = [ "apkid" ];

meta = with lib; {
description = "Android Application Identifier";
homepage = "https://github.com/rednaga/APKiD";
license = with licenses; [ gpl3Only ];
maintainers = with maintainers; [ fab ];
};
}
11 changes: 9 additions & 2 deletions pkgs/tools/security/yara/default.nix
Expand Up @@ -6,8 +6,11 @@
, pkg-config
, protobufc
, withCrypto ? true, openssl
, enableMagic ? true, file
, enableCuckoo ? true, jansson
, enableDex ? true
, enableDotNet ? true
, enableMacho ? true
, enableMagic ? true, file
}:

stdenv.mkDerivation rec {
Expand Down Expand Up @@ -46,14 +49,18 @@ stdenv.mkDerivation rec {

configureFlags = [
(lib.withFeature withCrypto "crypto")
(lib.enableFeature enableMagic "magic")
(lib.enableFeature enableCuckoo "cuckoo")
(lib.enableFeature enableDex "dex")
(lib.enableFeature enableDotNet "dotnet")
(lib.enableFeature enableMacho "macho")
(lib.enableFeature enableMagic "magic")
];

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;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -961,6 +961,8 @@ in
lua = lua5_3;
};

apkid = callPackage ../development/tools/apkid { };

apktool = callPackage ../development/tools/apktool {
inherit (androidenv.androidPkgs_9_0) build-tools;
};
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -9160,6 +9160,8 @@ in {

Yapsy = callPackage ../development/python-modules/yapsy { };

yara-python = callPackage ../development/python-modules/yara-python { };

yarg = callPackage ../development/python-modules/yarg { };

yarl = callPackage ../development/python-modules/yarl { };
Expand Down

0 comments on commit 650553a

Please sign in to comment.