about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyshark/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pyshark/default.nix')
-rw-r--r--pkgs/development/python-modules/pyshark/default.nix37
1 files changed, 20 insertions, 17 deletions
diff --git a/pkgs/development/python-modules/pyshark/default.nix b/pkgs/development/python-modules/pyshark/default.nix
index cadd47ca07b16..c7b469dbf7604 100644
--- a/pkgs/development/python-modules/pyshark/default.nix
+++ b/pkgs/development/python-modules/pyshark/default.nix
@@ -1,5 +1,6 @@
 { lib
 , buildPythonPackage
+, fetchpatch
 , fetchFromGitHub
 , appdirs
 , lxml
@@ -24,34 +25,36 @@ buildPythonPackage rec {
     hash = "sha256-byll2GWY2841AAf8Xh+KfaCOtMGVKabTsLCe3gCdZ1o=";
   };
 
+  patches = [
+    (fetchpatch {
+      name = "fix-mapping.patch";
+      url =
+        "https://github.com/KimiNewt/pyshark/pull/608/commits/c2feb17ef621390481d6acc29dbf807d6851ed4c.patch";
+      hash = "sha256-TY09HPxqJP3zI8+ugm518aMuBgog7wrXs5uoReHHaEI=";
+    })
+  ];
+
+  # `stripLen` does not seem to work here
+  patchFlags = "-p2";
+
   sourceRoot = "${src.name}/src";
 
-  propagatedBuildInputs = [
-    appdirs
-    py
-    lxml
-    packaging
-  ];
+  # propagate wireshark, so pyshark can find it when used
+  propagatedBuildInputs = [ appdirs py lxml packaging wireshark-cli ];
 
   preCheck = ''
     export HOME=$(mktemp -d)
   '';
 
-  checkInputs = [
-    pytestCheckHook
-    wireshark-cli
-  ];
+  checkInputs = [ pytestCheckHook wireshark-cli ];
 
-  pythonImportsCheck = [
-    "pyshark"
-  ];
+  pythonImportsCheck = [ "pyshark" ];
 
-  pytestFlagsArray = [
-    "../tests/"
-  ];
+  pytestFlagsArray = [ "../tests/" ];
 
   meta = with lib; {
-    description = "Python wrapper for tshark, allowing Python packet parsing using Wireshark dissectors";
+    description =
+      "Python wrapper for tshark, allowing Python packet parsing using Wireshark dissectors";
     homepage = "https://github.com/KimiNewt/pyshark/";
     license = licenses.mit;
     maintainers = with maintainers; [ ];