anchor.diff:  , gobject-introspection
   , gnome-wrapper
   , json-glib
  -, librsvg
   , libxkbcommon
   , mesa_noglu
   , pango
  
positive.code:     (wtFlag "x" (xorg != null) null)
    ];
  
    nativeBuildInputs = [
      gettext
      perl
    ];
  
    propagatedBuildInputs = [
      gnome-wrapper
    ];
  
    buildInputs = [
      adwaita-icon-theme
      atk
      at-spi2-atk
      cairo
      colord
      cups
      epoxy
      expat
      fontconfig
      gdk-pixbuf
      glib
      gobject-introspection
      json-glib
      librsvg
      libxkbcommon
      mesa_noglu
      pango
      rest
      shared_mime_info
      wayland
      xorg.inputproto
      xorg.libICE
      xorg.libSM
      xorg.libX11
      xorg.libXcomposite
      xorg.libXcursor
      xorg.libXdamage
      xorg.libXext
      xorg.libXfixes
      xorg.libXi
      xorg.libXinerama
      xorg.libXrandr
      xorg.libXrender
    ];
  
    postInstall = "rm -rvf $out/share/gtk-doc";
  
    # TODO: disable unnecessary tests
    doCheck = false;
    enableParallelBuilding = true;
  
    passthru = {
      gtkExeEnvPostBuild = ''
        rm $out/lib/gtk-3.0/3.0.0/immodules.cache
        $out/bin/gtk-query-immodules-3.0 $out/lib/gtk-3.0/3.0.0/immodules/*.so > \
          $out/lib/gtk-3.0/3.0.0/immodules.cache
      ''; # workaround for bug of nix-mode for Emacs */ '';
  
negative.code: with {
    inherit (stdenv.lib)
      enFlag
      optionals
      wtFlag;
  };
  
  assert xorg != null ->
    xorg.inputproto != null
    && xorg.libICE != null
    && xorg.libSM != null
    && xorg.libX11 != null
    && xorg.libXcomposite != null
    && xorg.libXcursor != null
    && xorg.libXdamage != null
    && xorg.libXext != null
    && xorg.libXfixes != null
    && xorg.libXi != null
    && xorg.libXinerama != null
    && xorg.libXrandr != null
    && xorg.libXrender != null;
  
  stdenv.mkDerivation rec {
    name = "gtk+-${version}";
  