chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / wa / waveterm / package.nix
blobcc1053d58fe21222894fc69c5f12ea9fbbc294bc
2   lib,
3   stdenv,
4   fetchurl,
5   makeDesktopItem,
6   copyDesktopItems,
7   unzip,
8   autoPatchelfHook,
9   atk,
10   at-spi2-atk,
11   cups,
12   libdrm,
13   gtk3,
14   pango,
15   cairo,
16   libX11,
17   libXcomposite,
18   libXdamage,
19   libXext,
20   libXfixes,
21   libXrandr,
22   mesa,
23   expat,
24   libxcb,
25   alsa-lib,
26   nss,
27   nspr,
28   vips,
29   wrapGAppsHook3,
30   udev,
31   libGL,
34 let
35   inherit (stdenv.hostPlatform) system;
36   throwSystem = throw "Unsupported system: ${system}";
38   pname = "waveterm";
39   version = "0.8.8";
41   suffix =
42     {
43       x86_64-linux = "waveterm-linux-x64-${version}.zip";
44       aarch64-linux = "waveterm-linux-arm64-${version}.zip";
45       x86_64-darwin = "Wave-darwin-universal-${version}.zip ";
46       aarch64-darwin = "Wave-darwin-arm64-${version}.zip";
47     }
48     .${system} or throwSystem;
50   src = fetchurl {
51     url = "https://github.com/wavetermdev/waveterm/releases/download/v${version}/${suffix}";
52     hash =
53       {
54         x86_64-linux = "sha256-hRpJTFVoBQZyJD06FTRbBPj/1DlYlDWPRjJ1IKeK7Cs=";
55         aarch64-linux = "sha256-T3VqsoHhPYYrAe/dEd0SUH+G4jpHjKpJTrFy8/AgoKI=";
56         x86_64-darwin = "sha256-UlyNl2Qu59L4hnK8rTeUV30YVD45L7ub5SP8f97aJrw=";
57         aarch64-darwin = "sha256-cP+z8DQsNBJc3p57xQdGqqq7jvYcRQRIa+P+6kD3eCc=";
58       }
59       .${system} or throwSystem;
60   };
62   desktopItems = [
63     (makeDesktopItem {
64       name = "waveterm";
65       exec = "waveterm --no-sandbox %U";
66       icon = fetchurl {
67         url = "https://raw.githubusercontent.com/wavetermdev/waveterm/refs/tags/v${version}/build/appicon.png";
68         hash = "sha256-qob27/64C9XPBtXghxg5/g0qRaiOUOpuFYL1n7/aEB0=";
69       };
70       startupWMClass = "Wave";
71       comment = "Open-Source AI-Native Terminal Built for Seamless Workflows";
72       desktopName = "Wave";
73       genericName = "Terminal Emulator";
74       categories = [
75         "Development"
76         "Utility"
77         "TerminalEmulator"
78       ];
79       keywords = [
80         "developer"
81         "terminal"
82         "emulator"
83       ];
84     })
85   ];
87   unpackPhase = ''
88     runHook preUnpack
89     unzip ${src} -d ./
90     runHook postUnpack
91   '';
93   meta = {
94     description = "Open-source, cross-platform terminal for seamless workflows";
95     homepage = "https://www.waveterm.dev";
96     mainProgram = "waveterm";
97     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
98     license = lib.licenses.asl20;
99     platforms = [
100       "aarch64-linux"
101       "aarch64-darwin"
102       "x86_64-linux"
103       "x86_64-darwin"
104     ];
105     maintainers = with lib.maintainers; [ aucub ];
106   };
108   linux = stdenv.mkDerivation {
109     inherit
110       pname
111       version
112       src
113       desktopItems
114       unpackPhase
115       ;
117     nativeBuildInputs = [
118       unzip
119       copyDesktopItems
120       autoPatchelfHook
121       wrapGAppsHook3
122     ];
124     buildInputs = [
125       atk
126       at-spi2-atk
127       cups
128       libdrm
129       gtk3
130       pango
131       cairo
132       libX11
133       libXcomposite
134       libXdamage
135       libXext
136       libXfixes
137       libXrandr
138       mesa
139       expat
140       libxcb
141       alsa-lib
142       nss
143       nspr
144       vips
145     ];
147     runtimeDependencies = map lib.getLib [
148       udev
149     ];
151     installPhase = ''
152       runHook preInstall
153       mkdir -p $out/waveterm $out/bin
154       cp -r ./* $out/waveterm/
155       runHook postInstall
156     '';
158     preFixup = ''
159       makeWrapper $out/waveterm/waveterm $out/bin/waveterm \
160         --prefix LD_LIBRARY_PATH : "${
161           lib.makeLibraryPath [
162             libGL
163           ]
164         }"
165     '';
166   };
168   darwin = stdenv.mkDerivation {
169     inherit
170       pname
171       version
172       src
173       unpackPhase
174       meta
175       ;
177     nativeBuildInputs = [
178       unzip
179     ];
181     sourceRoot = "Wave.app";
183     installPhase = ''
184       runHook preInstall
185       mkdir -p $out/Applications/Wave.app
186       cp -R . $out/Applications/Wave.app
187       runHook postInstall
188     '';
189   };
191 if stdenv.hostPlatform.isDarwin then darwin else linux