summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pcapy-ng/default.nix
blob: 27c97d00494894c99c0a00b300401d1a5bfa18f5 (plain)
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
{
  lib,
  buildPythonPackage,
  cython,
  fetchFromGitHub,
  libpcap,
  pkgconfig,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "pcapy-ng";
  version = "1.0.9";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "stamparm";
    repo = "pcapy-ng";
    rev = version;
    hash = "sha256-6LA2n7Kv0MiZcqUJpi0lDN4Q+GcOttYw7hJwVqK/DU0=";
  };

  nativeBuildInputs = [
    cython
    pkgconfig
  ];

  buildInputs = [ libpcap ];

  nativeCheckInputs = [ pytestCheckHook ];

  preCheck = ''
    cd tests
  '';

  pythonImportsCheck = [ "pcapy" ];

  doCheck = false;

  enabledTestPaths = [ "pcapytests.py" ];

  meta = {
    description = "Module to interface with the libpcap packet capture library";
    homepage = "https://github.com/stamparm/pcapy-ng/";
    license = lib.licenses.bsd2;
    maintainers = with lib.maintainers; [ fab ];
  };
}