git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #117873 from fabaff/apkid

apkid: init at 2.1.1, python3Packages.yara-python: init at 4.0.5

commit650553aa9b414df79ba2c1358b32f74ba2e49750 authorRobert Schütz <dev@schuetz-co.de> dateTue 13 Apr 2021, 09:54 (6 years ago) parentfc43a7fd549dc3
5 files changed+98−2
pkgs/development/python-modules/yara-python/default.nix+41 pkgs/development/tools/apkid/default.nix+44 pkgs/tools/security/yara/default.nix+9−2 pkgs/top-level/all-packages.nix+2 pkgs/top-level/python-packages.nix+2
pkgs/development/python-modules/yara-python/default.nixnew file+41
@@ -0,0 +1,41 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, pytestCheckHook
5+, yara
6+}:
7+
8+buildPythonPackage rec {
9+ pname = "yara-python";
10+ version = "4.0.5";
11+
12+ src = fetchFromGitHub {
13+ owner = "VirusTotal";
14+ repo = "yara-python";
15+ rev = "v${version}";
16+ sha256 = "1qd0aw5p48ay77hgj0hgzpvbmq1933mknk134aqdb32036rlc5sq";
17+ };
18+
19+ buildInputs = [
20+ yara
21+ ];
22+
23+ checkInputs = [
24+ pytestCheckHook
25+ ];
26+
27+ setupPyBuildFlags = [
28+ "--dynamic-linking"
29+ ];
30+
31+ pytestFlagsArray = [ "tests.py" ];
32+
33+ pythonImportsCheck = [ "yara" ];
34+
35+ meta = with lib; {
36+ description = "Python interface for YARA";
37+ homepage = "https://github.com/VirusTotal/yara-python";
38+ license = with licenses; [ asl20 ];
39+ maintainers = with maintainers; [ fab ];
40+ };
41+}
pkgs/development/tools/apkid/default.nixnew file+44
@@ -0,0 +1,44 @@
1+{ lib
2+, fetchFromGitHub
3+, python3
4+}:
5+
6+python3.pkgs.buildPythonApplication rec {
7+ pname = "apkid";
8+ version = "2.1.1";
9+
10+ src = fetchFromGitHub {
11+ owner = "rednaga";
12+ repo = "APKiD";
13+ rev = "v${version}";
14+ sha256 = "1p6kdjjw2jhwr875445w43k46n6zwpz0l0phkl8d3y1v4gi5l6dx";
15+ };
16+
17+ propagatedBuildInputs = with python3.pkgs; [
18+ yara-python
19+ ];
20+
21+ checkInputs = with python3.pkgs; [
22+ pytestCheckHook
23+ ];
24+
25+ preBuild = ''
26+ # Prepare the YARA rules
27+ ${python3.interpreter} prep-release.py
28+ '';
29+
30+ postPatch = ''
31+ # The next release will have support for later yara-python releases
32+ substituteInPlace setup.py \
33+ --replace "yara-python==3.11.0" "yara-python"
34+ '';
35+
36+ pythonImportsCheck = [ "apkid" ];
37+
38+ meta = with lib; {
39+ description = "Android Application Identifier";
40+ homepage = "https://github.com/rednaga/APKiD";
41+ license = with licenses; [ gpl3Only ];
42+ maintainers = with maintainers; [ fab ];
43+ };
44+}
pkgs/tools/security/yara/default.nix+9−2
@@ -6,8 +6,11 @@
66, pkg-config
77, protobufc
88, withCrypto ? true, openssl
9−, enableMagic ? true, file
109, enableCuckoo ? true, jansson
10+, enableDex ? true
11+, enableDotNet ? true
12+, enableMacho ? true
13+, enableMagic ? true, file
1114}:
1215
1316stdenv.mkDerivation rec {
@@ -46,14 +49,18 @@ stdenv.mkDerivation rec {
4649
4750 configureFlags = [
4851 (lib.withFeature withCrypto "crypto")
49− (lib.enableFeature enableMagic "magic")
5052 (lib.enableFeature enableCuckoo "cuckoo")
53+ (lib.enableFeature enableDex "dex")
54+ (lib.enableFeature enableDotNet "dotnet")
55+ (lib.enableFeature enableMacho "macho")
56+ (lib.enableFeature enableMagic "magic")
5157 ];
5258
5359 meta = with lib; {
5460 description = "The pattern matching swiss knife for malware researchers";
5561 homepage = "http://Virustotal.github.io/yara/";
5662 license = licenses.asl20;
63+ maintainers = with maintainers; [ fab ];
5764 platforms = platforms.all;
5865 };
5966}
pkgs/top-level/all-packages.nix+2
@@ -961,6 +961,8 @@ in
961961 lua = lua5_3;
962962 };
963963
964+ apkid = callPackage ../development/tools/apkid { };
965+
964966 apktool = callPackage ../development/tools/apktool {
965967 inherit (androidenv.androidPkgs_9_0) build-tools;
966968 };
pkgs/top-level/python-packages.nix+2
@@ -9160,6 +9160,8 @@ in {
91609160
91619161 Yapsy = callPackage ../development/python-modules/yapsy { };
91629162
9163+ yara-python = callPackage ../development/python-modules/yara-python { };
9164+
91639165 yarg = callPackage ../development/python-modules/yarg { };
91649166
91659167 yarl = callPackage ../development/python-modules/yarl { };