evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / yaramod / default.nix
blob87cd9ffcee7f81161de7c9dfaa882f5264c083f9
2   lib,
3   buildPythonPackage,
4   cmake,
5   fetchFromGitHub,
6   pytestCheckHook,
7   libxcrypt,
8   gtest,
9   pybind11,
10   nlohmann_json,
11   setuptools,
14 let
15   pog = fetchFromGitHub {
16     owner = "metthal";
17     repo = "pog";
18     rev = "b09bbf9cea573ee62aab7eccda896e37961d16cd";
19     hash = "sha256-El4WA92t2O/L4wUqH6Xj8w+ANtb6liRwafDhqn8jxjQ=";
20   };
22 buildPythonPackage rec {
23   pname = "yaramod";
24   version = "4.0.1";
25   pyproject = true;
27   src = fetchFromGitHub {
28     owner = "avast";
29     repo = "yaramod";
30     rev = "refs/tags/v${version}";
31     hash = "sha256-EkGG3J84mTFnor1YX9B1TyjvW6mCCF/AH904DaVX+VU=";
32   };
34   postPatch = ''
35     rm -r deps/googletest deps/pog/ deps/pybind11/ deps/json/json.hpp
36     cp -r --no-preserve=all ${pog} deps/pog/
37     cp -r --no-preserve=all ${nlohmann_json.src}/single_include/nlohmann/json.hpp deps/json/
38     cp -r --no-preserve=all ${pybind11.src} deps/pybind11/
39     cp -r --no-preserve=all ${gtest.src} deps/googletest/
40   '';
42   dontUseCmakeConfigure = true;
44   buildInputs = [ libxcrypt ];
46   nativeBuildInputs = [
47     cmake
48     pog
49   ];
51   build-system = [ setuptools ];
53   env.ENV_YARAMOD_BUILD_WITH_UNIT_TESTS = true;
55   nativeCheckInputs = [
56     gtest
57     pytestCheckHook
58   ];
60   pytestFlagsArray = [ "tests/" ];
62   pythonImportsCheck = [ "yaramod" ];
64   meta = with lib; {
65     description = "Parsing of YARA rules into AST and building new rulesets in C++";
66     homepage = "https://github.com/avast/yaramod";
67     changelog = "https://github.com/avast/yaramod/blob/v${version}/CHANGELOG.md";
68     license = licenses.mit;
69     maintainers = with maintainers; [ msm ];
70   };