From 5a5699b71eca4084da9234c238479bfeee639267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 30 Apr 2022 03:36:12 +0200 Subject: [PATCH] wezterm: build terminfo file without compiling wezterm --- .../terminal-emulators/wezterm/default.nix | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/terminal-emulators/wezterm/default.nix b/pkgs/applications/terminal-emulators/wezterm/default.nix index c51aee526865..8f15a38111c8 100644 --- a/pkgs/applications/terminal-emulators/wezterm/default.nix +++ b/pkgs/applications/terminal-emulators/wezterm/default.nix @@ -23,14 +23,13 @@ , Foundation , libiconv , nixosTests +, runCommand }: rustPlatform.buildRustPackage rec { pname = "wezterm"; version = "20220408-101518-b908e2dd"; - outputs = [ "out" "terminfo" ]; - src = fetchFromGitHub { owner = "wez"; repo = pname; @@ -75,10 +74,8 @@ rustPlatform.buildRustPackage rec { ]; postInstall = '' - # terminfo - 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 + mkdir -p $out/nix-support + echo "${passthru.terminfo}" >> $out/nix-support/propagated-user-env-packages # desktop icon install -Dm644 assets/icon/terminal.png $out/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png @@ -100,9 +97,20 @@ rustPlatform.buildRustPackage rec { ln -s $out/bin/{wezterm,wezterm-mux-server,wezterm-gui,strip-ansi-escapes} "$OUT_APP" ''; - passthru.tests = { - all-terminfo = nixosTests.allTerminfo; - test = nixosTests.terminal-emulators.wezterm; + 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 + ''; }; meta = with lib; {