diff --git a/pkgs/applications/science/electronics/gtkwave/default.nix b/pkgs/applications/science/electronics/gtkwave/default.nix index d82438a31119..9028d3a80288 100644 --- a/pkgs/applications/science/electronics/gtkwave/default.nix +++ b/pkgs/applications/science/electronics/gtkwave/default.nix @@ -12,6 +12,7 @@ , tk , wrapGAppsHook3 , xz +, desktopToDarwinBundle }: stdenv.mkDerivation rec { @@ -23,7 +24,11 @@ stdenv.mkDerivation rec { sha256 = "sha256-VKpFeI1tUq+2WcOu8zWq/eDvLImQp3cPjqpk5X8ic0Y="; }; - nativeBuildInputs = [ pkg-config wrapGAppsHook3 ]; + nativeBuildInputs = [ + pkg-config wrapGAppsHook3 + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ + desktopToDarwinBundle + ]; buildInputs = [ bzip2 glib gperf gtk3 judy tcl tk xz ] ++ lib.optional stdenv.hostPlatform.isDarwin gtk-mac-integration; @@ -42,6 +47,14 @@ stdenv.mkDerivation rec { "--enable-gtk3" ]; + postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' + mv $out/bin/.gtkwave-wrapped $out/Applications/GTKWave.app/Contents/MacOS/.gtkwave-wrapped + makeWrapper $out/Applications/GTKWave.app/Contents/MacOS/.gtkwave-wrapped $out/Applications/GTKWave.app/Contents/MacOS/GTKWave \ + --inherit-argv0 \ + "''${gappsWrapperArgs[@]}" + ln -sf $out/Applications/GTKWave.app/Contents/MacOS/GTKWave $out/bin/gtkwave + ''; + meta = { description = "VCD/Waveform viewer for Unix and Win32"; homepage = "https://gtkwave.sourceforge.net";