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
|
2021-12-06 16:07:01 +00:00
|
|
|
, perl
|
2020-12-25 13:55:36 +00:00
|
|
|
, pkg-config
|
|
|
|
, python3
|
2021-08-25 08:27:29 +00:00
|
|
|
, fontconfig
|
2022-09-30 11:47:45 +00:00
|
|
|
, installShellFiles
|
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-13 19:44:15 +00:00
|
|
|
, CoreGraphics
|
|
|
|
, Cocoa
|
|
|
|
, Foundation
|
|
|
|
, libiconv
|
2022-08-12 12:06:08 +00:00
|
|
|
, UserNotifications
|
2022-03-30 09:31:56 +00:00
|
|
|
, nixosTests
|
2022-04-27 09:35:20 +00:00
|
|
|
, runCommand
|
2020-12-25 13:55:36 +00:00
|
|
|
}:
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wezterm";
|
2022-11-27 09:42:12 +00:00
|
|
|
version = "20221119-145034-49b9839f";
|
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;
|
2022-11-27 09:42:12 +00:00
|
|
|
sha256 = "sha256-1gnP2Dn4nkhxelUsXMay2VGvgvMjkdEKhFK5AAST++s=";
|
2020-12-25 13:55:36 +00:00
|
|
|
};
|
2021-04-13 19:44:15 +00:00
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
# Rust 1.65 does better at enum packing (according to
|
|
|
|
# 40e08fafe2f6e5b0c70d55996a0814d6813442ef), but Nixpkgs doesn't have 1.65
|
|
|
|
# yet (still in staging), so skip these tests for now.
|
|
|
|
checkFlags = [
|
|
|
|
"--skip=escape::action_size"
|
|
|
|
"--skip=surface::line::storage::test::memory_usage"
|
|
|
|
];
|
|
|
|
|
2021-04-15 00:37:46 +00:00
|
|
|
postPatch = ''
|
|
|
|
echo ${version} > .tag
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
# tests are failing with: Unable to exchange encryption keys
|
|
|
|
rm -r wezterm-ssh/tests
|
2021-04-15 00:37:46 +00:00
|
|
|
'';
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
cargoSha256 = "sha256-D6/biuLsXaCr0KSiopo9BuAVmniF8opAfDH71C3dtt0=";
|
2020-12-25 13:55:36 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
installShellFiles
|
|
|
|
ncurses # tic for terminfo
|
2020-12-25 13:55:36 +00:00
|
|
|
pkg-config
|
|
|
|
python3
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin perl;
|
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
|
2022-08-12 12:06:08 +00:00
|
|
|
UserNotifications
|
2021-08-25 08:27:29 +00:00
|
|
|
];
|
2020-12-25 13:55:36 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
buildFeatures = [ "distro-defaults" ];
|
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
postInstall = ''
|
2022-04-27 09:35:20 +00:00
|
|
|
mkdir -p $out/nix-support
|
|
|
|
echo "${passthru.terminfo}" >> $out/nix-support/propagated-user-env-packages
|
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
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
install -Dm644 assets/shell-integration/wezterm.sh -t $out/etc/profile.d
|
2022-09-30 11:47:45 +00:00
|
|
|
installShellCompletion --cmd wezterm \
|
|
|
|
--bash assets/shell-completion/bash \
|
|
|
|
--fish assets/shell-completion/fish \
|
|
|
|
--zsh assets/shell-completion/zsh
|
|
|
|
|
|
|
|
install -Dm644 assets/wezterm-nautilus.py -t $out/share/nautilus-python/extensions
|
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
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
all-terminfo = nixosTests.allTerminfo;
|
|
|
|
terminal-emulators = nixosTests.terminal-emulators.wezterm;
|
|
|
|
};
|
|
|
|
terminfo = runCommand "wezterm-terminfo"
|
|
|
|
{
|
|
|
|
nativeBuildInputs = [
|
|
|
|
ncurses
|
|
|
|
];
|
|
|
|
} ''
|
|
|
|
mkdir -p $out/share/terminfo $out/nix-support
|
|
|
|
tic -x -o $out/share/terminfo ${src}/termwiz/data/wezterm.terminfo
|
|
|
|
'';
|
2022-04-15 01:41:22 +00:00
|
|
|
};
|
2022-03-30 09:31:56 +00:00
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|