From a75ef43adfb56aeefa78bfe29a4acb5154446efd Mon Sep 17 00:00:00 2001 From: QuantMint Date: Sat, 4 Mar 2023 13:18:41 +0100 Subject: wireshark: format --- .../networking/sniffers/wireshark/default.nix | 101 +++++++++++++++------ 1 file changed, 71 insertions(+), 30 deletions(-) (limited to 'pkgs/applications/networking/sniffers') diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix index 5d69667f1bfb..b12e5ba4fb5c 100644 --- a/pkgs/applications/networking/sniffers/wireshark/default.nix +++ b/pkgs/applications/networking/sniffers/wireshark/default.nix @@ -1,18 +1,46 @@ -{ lib, stdenv, buildPackages, fetchurl, pkg-config, pcre2, perl, flex, bison -, gettext, libpcap, libnl, c-ares, gnutls, libgcrypt, libgpg-error, geoip, openssl -, lua5, python3, libcap, glib, libssh, nghttp2, zlib, cmake, makeWrapper, wrapGAppsHook -, withQt ? true, qt5 ? null -, ApplicationServices, SystemConfiguration, gmp +{ lib +, stdenv +, buildPackages +, fetchurl +, pkg-config +, pcre2 +, perl +, flex +, bison +, gettext +, libpcap +, libnl +, c-ares +, gnutls +, libgcrypt +, libgpg-error +, geoip +, openssl +, lua5 +, python3 +, libcap +, glib +, libssh +, nghttp2 +, zlib +, cmake +, makeWrapper +, wrapGAppsHook +, withQt ? true +, qt5 ? null +, ApplicationServices +, SystemConfiguration +, gmp , asciidoctor }: -assert withQt -> qt5 != null; +assert withQt -> qt5 != null; let version = "4.0.3"; variant = if withQt then "qt" else "cli"; - -in stdenv.mkDerivation { +in +stdenv.mkDerivation { pname = "wireshark-${variant}"; inherit version; outputs = [ "out" "dev" ]; @@ -42,12 +70,24 @@ in stdenv.mkDerivation { depsBuildBuild = [ buildPackages.stdenv.cc ]; buildInputs = [ - gettext pcre2 libpcap lua5 libssh nghttp2 openssl libgcrypt - libgpg-error gnutls geoip c-ares glib zlib - ] ++ lib.optionals withQt (with qt5; [ qtbase qtmultimedia qtsvg qttools qtwayland ]) - ++ lib.optionals stdenv.isLinux [ libcap libnl ] - ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ] - ++ lib.optionals (withQt && stdenv.isDarwin) (with qt5; [ qtmacextras ]); + gettext + pcre2 + libpcap + lua5 + libssh + nghttp2 + openssl + libgcrypt + libgpg-error + gnutls + geoip + c-ares + glib + zlib + ] ++ lib.optionals withQt (with qt5; [ qtbase qtmultimedia qtsvg qttools qtwayland ]) + ++ lib.optionals stdenv.isLinux [ libcap libnl ] + ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ] + ++ lib.optionals (withQt && stdenv.isDarwin) (with qt5; [ qtmacextras ]); strictDeps = true; @@ -70,22 +110,23 @@ in stdenv.mkDerivation { install_name_tool -change "$dylib" "$out/lib/$dylib" "$f" done done - '' else lib.optionalString withQt '' - pwd - install -Dm644 -t $out/share/applications ../resources/freedesktop/org.wireshark.Wireshark.desktop - - install -Dm644 ../resources/icons/wsicon.svg $out/share/icons/wireshark.svg - mkdir -pv $dev/include/{epan/{wmem,ftypes,dfilter},wsutil/wmem,wiretap} - - cp config.h $dev/include/wireshark/ - cp ../epan/*.h $dev/include/epan/ - cp ../epan/ftypes/*.h $dev/include/epan/ftypes/ - cp ../epan/dfilter/*.h $dev/include/epan/dfilter/ - cp ../include/ws_*.h $dev/include/ - cp ../wiretap/*.h $dev/include/wiretap/ - cp ../wsutil/*.h $dev/include/wsutil/ - cp ../wsutil/wmem/*.h $dev/include/wsutil/wmem/ - ''); + '' else + lib.optionalString withQt '' + pwd + install -Dm644 -t $out/share/applications ../resources/freedesktop/org.wireshark.Wireshark.desktop + + install -Dm644 ../resources/icons/wsicon.svg $out/share/icons/wireshark.svg + mkdir -pv $dev/include/{epan/{wmem,ftypes,dfilter},wsutil/wmem,wiretap} + + cp config.h $dev/include/wireshark/ + cp ../epan/*.h $dev/include/epan/ + cp ../epan/ftypes/*.h $dev/include/epan/ftypes/ + cp ../epan/dfilter/*.h $dev/include/epan/dfilter/ + cp ../include/ws_*.h $dev/include/ + cp ../wiretap/*.h $dev/include/wiretap/ + cp ../wsutil/*.h $dev/include/wsutil/ + cp ../wsutil/wmem/*.h $dev/include/wsutil/wmem/ + ''); dontFixCmake = true; -- cgit 1.4.1