Skip to content

Commit

Permalink
python38Packages.yaramod: init at 3.12.2
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Schütz <[email protected]>
Co-authored-by: Fabian Affolter <[email protected]>
  • Loading branch information
3 people committed Jan 22, 2023
1 parent 0aa2211 commit f3cfcee
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
89 changes: 89 additions & 0 deletions pkgs/development/python-modules/yaramod/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{ lib
, buildPythonPackage
, cmake
, fetchFromGitHub
, pytestCheckHook
, libxcrypt
, pythonOlder
, gtest
}:

let
pog = fetchFromGitHub {
owner = "metthal";
repo = "pog";
rev = "b09bbf9cea573ee62aab7eccda896e37961d16cd";
hash = "sha256-El4WA92t2O/L4wUqH6Xj8w+ANtb6liRwafDhqn8jxjQ=";
};
pybind11 = fetchFromGitHub {
owner = "pybind";
repo = "pybind11";
rev = "refs/tags/v2.9.2";
hash = "sha256-O3bkexUBa+gfiJEM6KSR8y/iVqHqlCFmz/9EghxdIpw=";
};
json = fetchFromGitHub {
owner = "nlohmann";
repo = "json";
rev = "refs/tags/v3.9.1";
hash = "sha256-THordDPdH2qwk6lFTgeFmkl7iDuA/7YH71PTUe6vJCs=";
};
in
buildPythonPackage rec {
pname = "yaramod";
version = "3.16.1";
format = "setuptools";

disabled = pythonOlder "3.7";

src = fetchFromGitHub {
owner = "avast";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-1q+lzNtm8qko9ZAxJjkmPOQjHD5GxB6YyEz0tr+QWGk=";
};

postPatch = ''
rm -r deps/googletest deps/pog deps/pybind11 deps/json
cp -r --no-preserve=all ${pog} deps/pog
cp -r --no-preserve=all ${json} deps/json
cp -r --no-preserve=all ${pybind11} deps/pybind11
cp -r --no-preserve=all ${gtest.src} deps/googletest
cp --no-preserve=all deps/json/single_include/nlohmann/json.hpp deps/json/
'';

dontUseCmakeConfigure = true;

buildInputs = [
libxcrypt
];

nativeBuildInputs = [
cmake
pog
gtest
];

setupPyBuildFlags = [
"--with-unit-tests"
];

checkInputs = [
pytestCheckHook
];

pytestFlagsArray = [
"tests/"
];

pythonImportsCheck = [
"yaramod"
];

meta = with lib; {
description = "Parsing of YARA rules into AST and building new rulesets in C++";
homepage = "https://github.com/avast/yaramod";
changelog = "https://github.com/avast/yaramod/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ msm ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12396,6 +12396,8 @@ self: super: with self; {

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

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

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

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

0 comments on commit f3cfcee

Please sign in to comment.