at 25.11-pre 1.0 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 dpkt, 5 fetchFromGitHub, 6 libpcap, 7 pytestCheckHook, 8}: 9 10buildPythonPackage rec { 11 pname = "pypcap"; 12 version = "1.3.0"; 13 format = "setuptools"; 14 15 src = fetchFromGitHub { 16 owner = "pynetwork"; 17 repo = pname; 18 # No release was tagged and PyPI doesn't contain tests. 19 rev = "968859f0ffb5b7c990506dffe82457b7de23a026"; 20 hash = "sha256-NfyEC3qEBm6TjebcDIsoz8tJWaJ625ZFPfx7AMyynWE="; 21 }; 22 23 postPatch = '' 24 # Add the path to libpcap in the nix-store 25 substituteInPlace setup.py --replace "('/usr', sys.prefix)" "'${libpcap}'" 26 # Remove coverage from test run 27 sed -i "/--cov/d" setup.cfg 28 ''; 29 30 buildInputs = [ libpcap ]; 31 32 nativeCheckInputs = [ 33 dpkt 34 pytestCheckHook 35 ]; 36 37 pytestFlagsArray = [ "tests" ]; 38 39 pythonImportsCheck = [ "pcap" ]; 40 41 meta = with lib; { 42 homepage = "https://github.com/pynetwork/pypcap"; 43 description = "Simplified object-oriented Python wrapper for libpcap"; 44 license = licenses.bsd3; 45 maintainers = with maintainers; [ oxzi ]; 46 }; 47}