librewolf: 132.0.1 -> 132.0.1-1 (#355483)
[NixPkgs.git] / pkgs / by-name / wa / waveterm / package.nix
blobb5a335068c3be1610033fb67fcb8541ac609ddc6
2   lib,
3   stdenv,
4   fetchurl,
5   makeDesktopItem,
6   copyDesktopItems,
7   autoPatchelfHook,
8   atk,
9   at-spi2-atk,
10   cups,
11   libdrm,
12   gtk3,
13   pango,
14   cairo,
15   libX11,
16   libXcomposite,
17   libXdamage,
18   libXext,
19   libXfixes,
20   libXrandr,
21   mesa,
22   expat,
23   libxcb,
24   alsa-lib,
25   nss,
26   nspr,
27   vips,
28   wrapGAppsHook3,
29   udev,
30   libGL,
31   fetchzip,
34 let
35   pname = "waveterm";
36   version = "0.9.2";
38   src =
39     let
40       inherit (stdenv.hostPlatform) system;
41       selectSystem = attrs: attrs.${system};
42       suffix = selectSystem {
43         x86_64-linux = "waveterm-linux-x64";
44         aarch64-linux = "waveterm-linux-arm64";
45         x86_64-darwin = "Wave-darwin-x64";
46         aarch64-darwin = "Wave-darwin-arm64";
47       };
48       hash = selectSystem {
49         x86_64-linux = "sha256-s6s/SfLNVwRN50OgqWTohHT8/rFuu4P3hpxfhA7kPOU=";
50         aarch64-linux = "sha256-dxQbTPvge3QY40rWKAOV/uuTPzHsfNk9USxICoF1CQM=";
51         x86_64-darwin = "sha256-/nedzsQxqLclK5uwOKZ/WgRwjoHDCxLuI+/T1B3cyJM=";
52         aarch64-darwin = "sha256-lBJEJHgBozrR+JF5jlbmuG2c0P19qmjJUhwlJtHqkRE=";
53       };
54     in
55     fetchzip {
56       url = "https://github.com/wavetermdev/waveterm/releases/download/v${version}/${suffix}-${version}.zip";
57       inherit hash;
58       stripRoot = false;
59     };
61   passthru.updateScript = ./update.sh;
63   desktopItems = [
64     (makeDesktopItem {
65       name = "waveterm";
66       exec = "waveterm --no-sandbox %U";
67       icon = fetchurl {
68         url = "https://raw.githubusercontent.com/wavetermdev/waveterm/refs/tags/v${version}/build/appicon.png";
69         hash = "sha256-qob27/64C9XPBtXghxg5/g0qRaiOUOpuFYL1n7/aEB0=";
70       };
71       startupWMClass = "Wave";
72       comment = "Open-Source AI-Native Terminal Built for Seamless Workflows";
73       desktopName = "Wave";
74       genericName = "Terminal Emulator";
75       categories = [
76         "Development"
77         "Utility"
78         "TerminalEmulator"
79       ];
80       keywords = [
81         "developer"
82         "terminal"
83         "emulator"
84       ];
85     })
86   ];
88   meta = {
89     description = "Open-source, cross-platform terminal for seamless workflows";
90     homepage = "https://www.waveterm.dev";
91     mainProgram = "waveterm";
92     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
93     license = lib.licenses.asl20;
94     platforms = [
95       "aarch64-linux"
96       "aarch64-darwin"
97       "x86_64-linux"
98       "x86_64-darwin"
99     ];
100     maintainers = with lib.maintainers; [ aucub ];
101   };
103   linux = stdenv.mkDerivation {
104     inherit
105       pname
106       version
107       src
108       desktopItems
109       meta
110       passthru
111       ;
113     nativeBuildInputs = [
114       copyDesktopItems
115       autoPatchelfHook
116       wrapGAppsHook3
117     ];
119     buildInputs = [
120       atk
121       at-spi2-atk
122       cups
123       libdrm
124       gtk3
125       pango
126       cairo
127       libX11
128       libXcomposite
129       libXdamage
130       libXext
131       libXfixes
132       libXrandr
133       mesa
134       expat
135       libxcb
136       alsa-lib
137       nss
138       nspr
139       vips
140     ];
142     runtimeDependencies = map lib.getLib [
143       udev
144     ];
146     installPhase = ''
147       runHook preInstall
149       mkdir -p $out/waveterm $out/bin
150       cp -r ./* $out/waveterm/
152       runHook postInstall
153     '';
155     preFixup = ''
156       makeWrapper $out/waveterm/waveterm $out/bin/waveterm \
157         --prefix LD_LIBRARY_PATH : "${
158           lib.makeLibraryPath [
159             libGL
160           ]
161         }"
162     '';
163   };
165   darwin = stdenv.mkDerivation {
166     inherit
167       pname
168       version
169       src
170       meta
171       passthru
172       ;
174     sourceRoot = "Wave.app";
176     installPhase = ''
177       runHook preInstall
179       mkdir -p $out/Applications/Wave.app
180       cp -R . $out/Applications/Wave.app
182       runHook postInstall
183     '';
184   };
186 if stdenv.hostPlatform.isDarwin then darwin else linux