about summary refs log tree commit diff
path: root/pkgs/development/python-modules/hyperscan/default.nix
blob: 0d568e15f25b732440c15df2d24720eb11834c30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ lib
, pkgs
, buildPythonPackage
, fetchFromGitHub
, pdm-backend
, setuptools
, wheel
, pcre
, pkg-config
, pytestCheckHook
, pytest-mock
}:

buildPythonPackage rec {
  pname = "hyperscan";
  version = "0.7.7";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "darvid";
    repo = "python-hyperscan";
    rev = "refs/tags/v${version}";
    hash = "sha256-TNiGh89SnGi0WAqfYudsj7GaVhOifi8ZcmTrMtVbk+c=";
  };

  buildInputs = [
    (pkgs.hyperscan.override { withStatic = true; })
    # we need static pcre to be built, by default only shared library is built
    (pcre.overrideAttrs { dontDisableStatic = 0; })
  ];

  nativeBuildInputs = [
    pkg-config
    pdm-backend
    setuptools
    wheel
  ];

  pythonImportsCheck = [ "hyperscan" ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-mock
  ];

  meta = with lib; {
    description = "A CPython extension for the Hyperscan regular expression matching library";
    homepage = "https://github.com/darvid/python-hyperscan";
    changelog = "https://github.com/darvid/python-hyperscan/blob/${src.rev}/CHANGELOG.md";
    platforms = [ "x86_64-linux" "x86_64-darwin" ];
    license = licenses.mit;
    maintainers = with maintainers; [ mbalatsko ];
  };
}