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
|
2023-05-24 13:37:59 +00:00
|
|
|
, System
|
2021-04-13 19:44:15 +00:00
|
|
|
, 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
|
2023-03-04 12:14:45 +00:00
|
|
|
, vulkan-loader
|
2020-12-25 13:55:36 +00:00
|
|
|
}:
|
|
|
|
|
2021-04-13 19:44:15 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "wezterm";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "20230712-072601-f4abf8fd";
|
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;
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-B6AakLbTWIN123qAMQk/vFN83HHNRSNkqicNRU1GaCc=";
|
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-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
|
|
|
'';
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"image-0.24.5" = "sha256-fTajVwm88OInqCPZerWcSAm1ga46ansQ3EzAmbT58Js=";
|
2023-07-15 17:15:38 +00:00
|
|
|
"xcb-1.2.1" = "sha256-zkuW5ATix3WXBAj2hzum1MJ5JTX3+uVQ01R1vL6F1rY=";
|
|
|
|
"xcb-imdkit-0.2.0" = "sha256-L+NKD0rsCk9bFABQF4FZi9YoqBHr4VAZeKAWgsaAegw=";
|
2023-03-27 19:17:25 +00:00
|
|
|
};
|
|
|
|
};
|
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
|
2023-05-24 13:37:59 +00:00
|
|
|
System
|
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" ];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
env.NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework System";
|
|
|
|
|
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 ''
|
2023-03-04 12:14:45 +00:00
|
|
|
patchelf \
|
|
|
|
--add-needed "${libGL}/lib/libEGL.so.1" \
|
|
|
|
--add-needed "${vulkan-loader}/lib/libvulkan.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"
|
|
|
|
{
|
2023-02-22 10:55:15 +00:00
|
|
|
nativeBuildInputs = [ ncurses ];
|
2022-04-27 09:35:20 +00:00
|
|
|
} ''
|
|
|
|
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; {
|
2023-02-22 10:55:15 +00:00
|
|
|
description = "GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust";
|
2020-12-25 13:55:36 +00:00
|
|
|
homepage = "https://wezfurlong.org/wezterm";
|
|
|
|
license = licenses.mit;
|
2023-04-29 16:46:19 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 mimame ];
|
2020-12-25 13:55:36 +00:00
|
|
|
};
|
|
|
|
}
|