@@ -0,0 +1,85 @@
1+{ rustPlatform
2+, lib
3+, fetchFromGitHub
4+
5+, pkg-config
6+, fontconfig
7+, python3
8+, openssl
9+, perl
10+
11+, dbus
12+, libX11
13+, xcbutil
14+, libxcb
15+, xcbutilkeysyms
16+, xcbutilwm # contains xcb-ewmh among others
17+, libxkbcommon
18+, libglvnd # libEGL.so.1
19+, egl-wayland
20+, wayland
21+, libGLU
22+, libGL
23+, freetype
24+, zlib
25+}:
26+let
27+ runtimeDeps = [
28+ libX11
29+ xcbutil
30+ libxcb
31+ xcbutilkeysyms
32+ xcbutilwm
33+ libxkbcommon
34+ dbus
35+ libglvnd
36+ zlib
37+ egl-wayland
38+ wayland
39+ libGLU
40+ libGL
41+ fontconfig
42+ freetype
43+ ];
44+ pname = "wezterm";
45+in
46+
47+rustPlatform.buildRustPackage {
48+ inherit pname;
49+ version = "unstable-2020-11-22";
50+
51+ src = fetchFromGitHub {
52+ owner = "wez";
53+ repo = pname;
54+ rev = "3bd8d8c84591f4d015ff9a47ddb478e55c231fda";
55+ sha256 = "13xf3685kir4p159hsxrqkj9p2lwgfp0n13h9zadslrd44l8b8j8";
56+ };
57+ cargoSha256 = "1i983ix7kdq7kd1i14kk3ra7jiihrd7n4pxmfifbj48g3kyxn2pq";
58+
59+ nativeBuildInputs = [
60+ pkg-config
61+ python3
62+ openssl.dev
63+ perl
64+ ];
65+
66+ buildInputs = runtimeDeps;
67+
68+ installPhase = ''
69+ for artifact in wezterm wezterm-gui wezterm-mux-server strip-ansi-escapes; do
70+ patchelf --set-rpath "${lib.makeLibraryPath runtimeDeps}" $releaseDir/$artifact
71+ install -D $releaseDir/$artifact -t $out/bin
72+ done
73+ '';
74+
75+ # prevent further changes to the RPATH
76+ dontPatchELF = true;
77+
78+ meta = with lib; {
79+ description = "A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust";
80+ homepage = "https://wezfurlong.org/wezterm";
81+ license = licenses.mit;
82+ maintainers = with maintainers; [ steveej ];
83+ platforms = platforms.unix;
84+ };
85+}