2021-01-09 10:05:03 +00:00
|
|
|
{ stdenv
|
|
|
|
, rustPlatform
|
2020-12-25 13:55:36 +00:00
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2021-06-06 07:54:09 +00:00
|
|
|
, ncurses
|
2020-12-25 13:55:36 +00:00
|
|
|
, pkg-config
|
|
|
|
, python3
|
2021-08-25 08:27:29 +00:00
|
|
|
, fontconfig
|
2020-12-25 13:55:36 +00:00
|
|
|
, openssl
|
2021-08-25 08:27:29 +00:00
|
|
|
, libGL
|
2020-12-25 13:55:36 +00:00
|
|
|
, libX11
|
|
|
|
, libxcb
|
2021-08-25 08:27:29 +00:00
|
|
|
, libxkbcommon
|
|
|
|
, xcbutil
|
2021-04-13 19:44:15 +00:00
|
|
|
, xcbutilimage
|
2020-12-25 13:55:36 +00:00
|
|
|
, xcbutilkeysyms
|
2021-08-25 08:27:29 +00:00
|
|
|
, xcbutilwm
|
2020-12-25 13:55:36 +00:00
|
|
|
, wayland
|
|
|
|
, zlib
|
2021-04-15 00:37:46 +00:00
|
|
|
# Apple frameworks
|
2021-04-13 19:44:15 +00:00
|
|
|
, CoreGraphics
|
|
|
|
, Cocoa
|
|
|
|
, Foundation
|
|
|
|
, libiconv
|
2020-12-25 13:55:36 +00:00
|
|
|
}:
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wezterm";
|
2021-08-18 13:19:15 +00:00
|
|
|
version = "20210814-124438-54e29167";
|
2020-12-25 13:55:36 +00:00
|
|
|
|
2021-08-25 08:27:29 +00:00
|
|
|
outputs = [ "out" "terminfo" ];
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wez";
|
|
|
|
repo = pname;
|
2021-05-20 23:08:51 +00:00
|
|
|
rev = version;
|
2020-12-25 13:55:36 +00:00
|
|
|
fetchSubmodules = true;
|
2021-08-25 08:27:29 +00:00
|
|
|
sha256 = "sha256-6HXTftgAs6JMzOMCY+laN74in8xfjE8yJc5xSl9PQCE=";
|
2020-12-25 13:55:36 +00:00
|
|
|
};
|
2021-04-13 19:44:15 +00:00
|
|
|
|
2021-04-15 00:37:46 +00:00
|
|
|
postPatch = ''
|
|
|
|
echo ${version} > .tag
|
|
|
|
'';
|
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
cargoSha256 = "sha256-yjTrWoqIKoRV4oZQ0mfTGrIGmm89AaKJd16WL1Ozhnw=";
|
2020-12-25 13:55:36 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
|
|
|
python3
|
2021-08-25 08:27:29 +00:00
|
|
|
ncurses # tic for terminfo
|
2020-12-25 13:55:36 +00:00
|
|
|
];
|
|
|
|
|
2021-08-25 08:27:29 +00:00
|
|
|
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
|
|
|
|
];
|
2020-12-25 13:55:36 +00:00
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
postInstall = ''
|
2021-08-18 13:19:15 +00:00
|
|
|
# terminfo
|
2021-06-06 07:54:09 +00:00
|
|
|
mkdir -p $terminfo/share/terminfo/w $out/nix-support
|
|
|
|
tic -x -o $terminfo/share/terminfo termwiz/data/wezterm.terminfo
|
|
|
|
echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
# desktop icon
|
2021-08-05 21:33:18 +00:00
|
|
|
install -Dm644 assets/icon/terminal.png $out/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png
|
|
|
|
install -Dm644 assets/wezterm.desktop $out/share/applications/org.wezfurlong.wezterm.desktop
|
|
|
|
install -Dm644 assets/wezterm.appdata.xml $out/share/metainfo/org.wezfurlong.wezterm.appdata.xml
|
2021-08-18 13:19:15 +00:00
|
|
|
|
|
|
|
# helper scripts
|
|
|
|
install -Dm644 assets/shell-integration/wezterm.sh $out/share/wezterm/shell-integration/wezterm.sh
|
2021-06-06 07:54:09 +00:00
|
|
|
'';
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
preFixup = lib.optionalString stdenv.isLinux ''
|
2021-08-25 08:27:29 +00:00
|
|
|
patchelf --add-needed "${libGL}/lib/libEGL.so.1" $out/bin/wezterm-gui
|
2021-01-17 00:15:33 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2021-04-13 19:44:15 +00:00
|
|
|
mkdir -p "$out/Applications"
|
|
|
|
OUT_APP="$out/Applications/WezTerm.app"
|
|
|
|
cp -r assets/macos/WezTerm.app "$OUT_APP"
|
|
|
|
rm $OUT_APP/*.dylib
|
|
|
|
cp -r assets/shell-integration/* "$OUT_APP"
|
|
|
|
ln -s $out/bin/{wezterm,wezterm-mux-server,wezterm-gui,strip-ansi-escapes} "$OUT_APP"
|
2020-12-25 13:55:36 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
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;
|
2021-08-25 08:27:29 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2020-12-25 13:55:36 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|