1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-05 15:22:36 +03:00
nixpkgs/pkgs/development/python-modules/pypcap/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1,012 B
Nix
Raw Normal View History

{ lib
, buildPythonPackage
, dpkt
, fetchFromGitHub
, libpcap
, pytestCheckHook
}:
2017-10-08 19:13:36 +02:00
buildPythonPackage rec {
pname = "pypcap";
2022-10-03 18:35:23 +02:00
version = "1.3.0";
src = fetchFromGitHub {
owner = "pynetwork";
repo = pname;
2022-10-03 18:35:23 +02:00
# No release was tagged and PyPI doesn't contain tests.
rev = "968859f0ffb5b7c990506dffe82457b7de23a026";
sha256 = "sha256-NfyEC3qEBm6TjebcDIsoz8tJWaJ625ZFPfx7AMyynWE=";
2017-10-08 19:13:36 +02:00
};
postPatch = ''
# Add the path to libpcap in the nix-store
substituteInPlace setup.py --replace "('/usr', sys.prefix)" "'${libpcap}'"
# Remove coverage from test run
sed -i "/--cov/d" setup.cfg
'';
2017-11-16 09:22:11 +01:00
buildInputs = [ libpcap ];
checkInputs = [
dpkt
pytestCheckHook
];
pytestFlagsArray = [ "tests" ];
pythonImportsCheck = [ "pcap" ];
2017-10-08 19:13:36 +02:00
meta = with lib; {
homepage = "https://github.com/pynetwork/pypcap";
2017-10-08 19:13:36 +02:00
description = "Simplified object-oriented Python wrapper for libpcap";
license = licenses.bsd3;
maintainers = with maintainers; [ oxzi ];
2017-10-08 19:13:36 +02:00
};
}