anchor.diff:    nativeBuildInputs = [
       pkg-config
       python3
  -    perl
  -    ncurses
  +    ncurses # tic for terminfo
     ];
   
  -  buildInputs = runtimeDeps;
  +  buildInputs = [
  +    fontconfig
  +    zlib
  +  ] ++ lib.optionals stdenv.isLinux [
  +    libX11
  +    libxcb
  +    libxkbcommon
  +    openssl
  +    wayland
  +    xcbutil
  +    xcbutilimage
  +    xcbutilkeysyms
  +    xcbutilwm # contains xcb-ewmh among others
  +  ] ++ lib.optionals stdenv.isDarwin [
  +    Cocoa
  +    CoreGraphics
  +    Foundation
  +    libiconv
  +  ];
   
     postInstall = ''
       # terminfo
  
positive.code: , Foundation
  , libiconv
  }:
  let
    runtimeDeps = [
      zlib
      fontconfig
      freetype
    ] ++ lib.optionals stdenv.isLinux [
      libX11
      xcbutil
      libxcb
      xcbutilimage
      xcbutilkeysyms
      xcbutilwm
      libxkbcommon
      dbus
      libglvnd
      egl-wayland
      wayland
      libGLU
      libGL
      openssl
    ] ++ lib.optionals stdenv.isDarwin [
      Foundation
      CoreGraphics
      Cocoa
      libiconv
    ];
  in
  
  rustPlatform.buildRustPackage rec {
    pname = "wezterm";
    version = "20210814-124438-54e29167";
  
    src = fetchFromGitHub {
      owner = "wez";
      repo = pname;
      rev = version;
      sha256 = "sha256-6HXTftgAs6JMzOMCY+laN74in8xfjE8yJc5xSl9PQCE=";
      fetchSubmodules = true;
    };
  
    outputs = [ "out" "terminfo" ];
  
    postPatch = ''
      echo ${version} > .tag
  
negative.code: , fetchFromGitHub
  , ncurses
  , pkg-config
  , python3
  , fontconfig
  , openssl
  , libGL
  , libX11
  , libxcb
  , libxkbcommon
  , xcbutil
  , xcbutilimage
  , xcbutilkeysyms
  , xcbutilwm
  , wayland
  , zlib
    # Apple frameworks
  , CoreGraphics
  