Merge pull request #170975 from SuperSandro2000/wezterm
wezterm: build terminfo file without compiling wezterm
This commit is contained in:
commit
1b5f5cf42a
1 changed files with 17 additions and 9 deletions
|
@ -23,14 +23,13 @@
|
||||||
, Foundation
|
, Foundation
|
||||||
, libiconv
|
, libiconv
|
||||||
, nixosTests
|
, nixosTests
|
||||||
|
, runCommand
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "wezterm";
|
pname = "wezterm";
|
||||||
version = "20220408-101518-b908e2dd";
|
version = "20220408-101518-b908e2dd";
|
||||||
|
|
||||||
outputs = [ "out" "terminfo" ];
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "wez";
|
owner = "wez";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
|
@ -75,10 +74,8 @@ rustPlatform.buildRustPackage rec {
|
||||||
];
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
# terminfo
|
mkdir -p $out/nix-support
|
||||||
mkdir -p $terminfo/share/terminfo/w $out/nix-support
|
echo "${passthru.terminfo}" >> $out/nix-support/propagated-user-env-packages
|
||||||
tic -x -o $terminfo/share/terminfo termwiz/data/wezterm.terminfo
|
|
||||||
echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
|
|
||||||
|
|
||||||
# desktop icon
|
# desktop icon
|
||||||
install -Dm644 assets/icon/terminal.png $out/share/icons/hicolor/128x128/apps/org.wezfurlong.wezterm.png
|
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"
|
ln -s $out/bin/{wezterm,wezterm-mux-server,wezterm-gui,strip-ansi-escapes} "$OUT_APP"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests = {
|
passthru = {
|
||||||
all-terminfo = nixosTests.allTerminfo;
|
tests = {
|
||||||
test = nixosTests.terminal-emulators.wezterm;
|
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; {
|
meta = with lib; {
|
||||||
|
|
Loading…
Reference in a new issue