summary refs log tree commit diff
path: root/pkgs/applications/networking/sniffers/wireshark/default.nix
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2019-04-08 21:46:15 +0200
committerMatthieu Coudron <mattator@gmail.com>2019-04-09 11:09:06 +0900
commit064bcdb22fc61bf7e7f6b3aa823dc2809369a515 (patch)
tree14a57f068bb93fdcd660d24bf6bd3509516edcbe /pkgs/applications/networking/sniffers/wireshark/default.nix
parent5e19cec49185c8ca2d29d7bb7aa7842b0a887cb3 (diff)
downloadnixpkgs-064bcdb22fc61bf7e7f6b3aa823dc2809369a515.tar
nixpkgs-064bcdb22fc61bf7e7f6b3aa823dc2809369a515.tar.gz
nixpkgs-064bcdb22fc61bf7e7f6b3aa823dc2809369a515.tar.bz2
nixpkgs-064bcdb22fc61bf7e7f6b3aa823dc2809369a515.tar.lz
nixpkgs-064bcdb22fc61bf7e7f6b3aa823dc2809369a515.tar.xz
nixpkgs-064bcdb22fc61bf7e7f6b3aa823dc2809369a515.tar.zst
nixpkgs-064bcdb22fc61bf7e7f6b3aa823dc2809369a515.zip
wireshark: fix darwin build
Fixing the cycle in the cmake files is also needed on darwin.
Diffstat (limited to 'pkgs/applications/networking/sniffers/wireshark/default.nix')
-rw-r--r--pkgs/applications/networking/sniffers/wireshark/default.nix31
1 files changed, 15 insertions, 16 deletions
diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix
index 5119c70ab31..40fc03a8120 100644
--- a/pkgs/applications/networking/sniffers/wireshark/default.nix
+++ b/pkgs/applications/networking/sniffers/wireshark/default.nix
@@ -56,25 +56,29 @@ in stdenv.mkDerivation {
     export LD_LIBRARY_PATH="$PWD/run"
   '';
 
-  postInstall = if (stdenv.isDarwin && withQt) then ''
-      mkdir -p $out/Applications
-      mv $out/bin/Wireshark.app $out/Applications/Wireshark.app
-
-      for so in $out/Applications/Wireshark.app/Contents/PlugIns/wireshark/*.so; do
+  postInstall = ''
+    # to remove "cycle detected in the references"
+    mkdir -p $dev/lib/wireshark
+    mv $out/lib/wireshark/cmake $dev/lib/wireshark
+  '' + (if stdenv.isDarwin && withQt then ''
+    mkdir -p $out/Applications
+    mv $out/bin/Wireshark.app $out/Applications/Wireshark.app
+
+    for so in $out/Applications/Wireshark.app/Contents/PlugIns/wireshark/*.so; do
         install_name_tool $so -change libwireshark.10.dylib $out/lib/libwireshark.10.dylib
         install_name_tool $so -change libwiretap.7.dylib $out/lib/libwiretap.7.dylib
         install_name_tool $so -change libwsutil.8.dylib $out/lib/libwsutil.8.dylib
-      done
+    done
 
-      wrapProgram $out/Applications/Wireshark.app/Contents/MacOS/Wireshark \
+    wrapProgram $out/Applications/Wireshark.app/Contents/MacOS/Wireshark \
         --set QT_PLUGIN_PATH ${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}
   '' else optionalString withQt ''
-      install -Dm644 -t $out/share/applications ../wireshark.desktop
-      wrapProgram $out/bin/wireshark \
+    install -Dm644 -t $out/share/applications ../wireshark.desktop
+    wrapProgram $out/bin/wireshark \
         --set QT_PLUGIN_PATH ${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}
 
     substituteInPlace $out/share/applications/*.desktop \
-      --replace "Exec=wireshark" "Exec=$out/bin/wireshark"
+        --replace "Exec=wireshark" "Exec=$out/bin/wireshark"
 
     install -Dm644 ../image/wsicon.svg $out/share/icons/wireshark.svg
     mkdir $dev/include/{epan/{wmem,ftypes,dfilter},wsutil,wiretap} -pv
@@ -87,12 +91,7 @@ in stdenv.mkDerivation {
     cp ../epan/dfilter/*.h $dev/include/epan/dfilter/
     cp ../wsutil/*.h $dev/include/wsutil/
     cp ../wiretap/*.h $dev/include/wiretap
-
-  '' + ''
-      # to remove "cycle detected in the references"
-      mkdir -p $dev/lib/wireshark
-      mv $out/lib/wireshark/cmake $dev/lib/wireshark
-    '';
+  '');
 
   enableParallelBuilding = true;