anchor.diff:  , rustPlatform
   , lib
   , fetchFromGitHub
  -
   , pkg-config
   , fontconfig
   , python3
   , openssl
   , perl
  -
  -# Apple frameworks
  -, CoreGraphics
  -, Cocoa
  -, Foundation
  -, libiconv
  -
   , dbus
   , libX11
   , xcbutil
  
positive.code:     description = "A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust";
      homepage = "https://wezfurlong.org/wezterm";
      license = licenses.mit;
      maintainers = with maintainers; [ steveej ];
      platforms = platforms.unix;
    };
  }
  
negative.code:     wayland
      libGLU
      libGL
      openssl
    ] ++ lib.optionals (stdenv.isDarwin) [
      Foundation
      CoreGraphics
      Cocoa
      libiconv
    ];
  in
  
  rustPlatform.buildRustPackage rec {
    pname = "wezterm";
    version = "20210407-nightly";
  
    src = fetchFromGitHub {
      owner = "wez";
      repo = pname;
      rev = "d2419fb99e567e3b260980694cc840a1a3b86922";
      sha256 = "4tVjrdDlrDPKzcbTYK9vRlzfC9tfvkD+D0aN19A8RWE=";
      fetchSubmodules = true;
    };
  
    cargoSha256 = "sha256-UaXeeuRuQk+CWF936mEAaWTjZuTSRPmxbQ/9E2oZIqg=";
  
    nativeBuildInputs = [
      pkg-config
      python3
      perl
    ];
  
    buildInputs = runtimeDeps;
  
    preFixup = lib.optionalString stdenv.isLinux ''
      for artifact in wezterm wezterm-gui wezterm-mux-server strip-ansi-escapes; do
        patchelf --set-rpath "${lib.makeLibraryPath runtimeDeps}" $out/bin/$artifact
      done
  