Merge pull request #170975 from SuperSandro2000/wezterm

wezterm: build terminfo file without compiling wezterm
This commit is contained in:
Sandro 2022-05-02 14:45:33 +02:00 committed by GitHub
commit 1b5f5cf42a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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; {