btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / gt / gtkwave / package.nix
blob9028d3a802887afbc0d1a72765ab5c1296cf2a11
1 { bzip2
2 , fetchurl
3 , glib
4 , gperf
5 , gtk3
6 , gtk-mac-integration
7 , judy
8 , lib
9 , pkg-config
10 , stdenv
11 , tcl
12 , tk
13 , wrapGAppsHook3
14 , xz
15 , desktopToDarwinBundle
18 stdenv.mkDerivation rec {
19   pname = "gtkwave";
20   version = "3.3.121";
22   src = fetchurl {
23     url = "mirror://sourceforge/gtkwave/${pname}-gtk3-${version}.tar.gz";
24     sha256 = "sha256-VKpFeI1tUq+2WcOu8zWq/eDvLImQp3cPjqpk5X8ic0Y=";
25   };
27   nativeBuildInputs = [
28     pkg-config wrapGAppsHook3
29   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
30     desktopToDarwinBundle
31   ];
32   buildInputs = [ bzip2 glib gperf gtk3 judy tcl tk xz ]
33     ++ lib.optional stdenv.hostPlatform.isDarwin gtk-mac-integration;
35   # fix compilation under Darwin
36   # remove these patches upon next release
37   # https://github.com/gtkwave/gtkwave/pull/136
38   patches = [
39     ./0001-Fix-detection-of-quartz-in-gdk-3.0-target.patch
40     ./0002-Check-GDK_WINDOWING_X11-macro-when-using-GtkPlug.patch
41   ];
43   configureFlags = [
44     "--with-tcl=${tcl}/lib"
45     "--with-tk=${tk}/lib"
46     "--enable-judy"
47     "--enable-gtk3"
48   ];
50   postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
51     mv $out/bin/.gtkwave-wrapped $out/Applications/GTKWave.app/Contents/MacOS/.gtkwave-wrapped
52     makeWrapper $out/Applications/GTKWave.app/Contents/MacOS/.gtkwave-wrapped $out/Applications/GTKWave.app/Contents/MacOS/GTKWave \
53       --inherit-argv0 \
54       "''${gappsWrapperArgs[@]}"
55     ln -sf $out/Applications/GTKWave.app/Contents/MacOS/GTKWave $out/bin/gtkwave
56   '';
58   meta = {
59     description = "VCD/Waveform viewer for Unix and Win32";
60     homepage = "https://gtkwave.sourceforge.net";
61     license = lib.licenses.gpl2Plus;
62     maintainers = with lib.maintainers; [ thoughtpolice jiegec jleightcap ];
63     platforms = lib.platforms.linux ++ lib.platforms.darwin;
64   };