about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJustin Gerhardt <justin@gerhardt.link>2020-06-04 02:29:38 -0400
committerBjørn Forsman <bjorn.forsman@gmail.com>2020-06-10 19:53:29 +0200
commit9930b8fd3d98a6d44c4518a10056ee0b9f0866fc (patch)
treea76b27f3a82d3c8575454a2ae16a3cd57c84f7a9
parentf2d1568282807adee0c985ffda243caea7d16b28 (diff)
downloadnixlib-9930b8fd3d98a6d44c4518a10056ee0b9f0866fc.tar
nixlib-9930b8fd3d98a6d44c4518a10056ee0b9f0866fc.tar.gz
nixlib-9930b8fd3d98a6d44c4518a10056ee0b9f0866fc.tar.bz2
nixlib-9930b8fd3d98a6d44c4518a10056ee0b9f0866fc.tar.lz
nixlib-9930b8fd3d98a6d44c4518a10056ee0b9f0866fc.tar.xz
nixlib-9930b8fd3d98a6d44c4518a10056ee0b9f0866fc.tar.zst
nixlib-9930b8fd3d98a6d44c4518a10056ee0b9f0866fc.zip
wireshark: Add Bluetooth
Only applies to Linux
-rw-r--r--pkgs/applications/networking/sniffers/wireshark/default.nix3
-rw-r--r--pkgs/development/libraries/libpcap/default.nix16
2 files changed, 11 insertions, 8 deletions
diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix
index 7166ebe93d71..c6dc66a0ca78 100644
--- a/pkgs/applications/networking/sniffers/wireshark/default.nix
+++ b/pkgs/applications/networking/sniffers/wireshark/default.nix
@@ -12,6 +12,7 @@ with stdenv.lib;
 let
   version = "3.2.4";
   variant = if withQt then "qt" else "cli";
+  pcap = libpcap.override { withBluez = stdenv.isLinux; };
 
 in stdenv.mkDerivation {
   pname = "wireshark-${variant}";
@@ -35,7 +36,7 @@ in stdenv.mkDerivation {
   ] ++ optional withQt qt5.wrapQtAppsHook;
 
   buildInputs = [
-    gettext pcre perl libpcap lua5 libssh nghttp2 openssl libgcrypt
+    gettext pcre perl pcap lua5 libssh nghttp2 openssl libgcrypt
     libgpgerror gnutls geoip c-ares python3 glib zlib makeWrapper
   ] ++ optionals withQt  (with qt5; [ qtbase qtmultimedia qtsvg qttools ])
     ++ optionals stdenv.isLinux  [ libcap libnl ]
diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix
index 123c2f2f0676..35cf4485f72e 100644
--- a/pkgs/development/libraries/libpcap/default.nix
+++ b/pkgs/development/libraries/libpcap/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, flex, bison }:
+{ stdenv, fetchurl, flex, bison, bluez, pkgconfig, withBluez ? false }:
+
+with stdenv.lib;
 
 stdenv.mkDerivation rec {
   pname = "libpcap";
@@ -9,7 +11,8 @@ stdenv.mkDerivation rec {
     sha256 = "153h1378diqyc27jjgz6gg5nxmb4ddk006d9xg69nqavgiikflk3";
   };
 
-  nativeBuildInputs = [ flex bison ];
+  nativeBuildInputs = [ flex bison ]
+    ++ optionals withBluez [ bluez.dev pkgconfig ];
 
   # We need to force the autodetection because detection doesn't
   # work in pure build enviroments.
@@ -18,17 +21,16 @@ stdenv.mkDerivation rec {
       linux = "linux";
       darwin = "bpf";
     }.${stdenv.hostPlatform.parsed.kernel.name})
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [
-    "ac_cv_linux_vers=2"
-  ];
+  ] ++ optionals (stdenv.hostPlatform == stdenv.buildPlatform)
+    [ "ac_cv_linux_vers=2" ];
 
   dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
 
-  prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  prePatch = optionalString stdenv.isDarwin ''
     substituteInPlace configure --replace " -arch i386" ""
   '';
 
-  meta = with stdenv.lib; {
+  meta = {
     homepage = "https://www.tcpdump.org";
     description = "Packet Capture Library";
     platforms = platforms.unix;