python312Packages.lottie: 0.7.0 -> 0.7.1 (#361686)
[NixPkgs.git] / pkgs / by-name / wa / waveterm / package.nix
blob98844812d916c438341f6b260c8b053438de1ab2
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,
32   unzip,
35 let
36   inherit (stdenv.hostPlatform) system;
37   selectSystem = attrs: attrs.${system};
38   pname = "waveterm";
39   version = "0.9.3";
40   passthru.updateScript = ./update.sh;
42   desktopItems = [
43     (makeDesktopItem {
44       name = "waveterm";
45       exec = "waveterm --no-sandbox %U";
46       icon = fetchurl {
47         url = "https://raw.githubusercontent.com/wavetermdev/waveterm/refs/tags/v${version}/build/appicon.png";
48         hash = "sha256-qob27/64C9XPBtXghxg5/g0qRaiOUOpuFYL1n7/aEB0=";
49       };
50       startupWMClass = "Wave";
51       comment = "Open-Source AI-Native Terminal Built for Seamless Workflows";
52       desktopName = "Wave";
53       genericName = "Terminal Emulator";
54       categories = [
55         "Development"
56         "Utility"
57         "TerminalEmulator"
58       ];
59       keywords = [
60         "developer"
61         "terminal"
62         "emulator"
63       ];
64     })
65   ];
67   meta = {
68     description = "Open-source, cross-platform terminal for seamless workflows";
69     homepage = "https://www.waveterm.dev";
70     mainProgram = "waveterm";
71     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
72     license = lib.licenses.asl20;
73     platforms = [
74       "aarch64-linux"
75       "aarch64-darwin"
76       "x86_64-linux"
77       "x86_64-darwin"
78     ];
79     maintainers = with lib.maintainers; [ aucub ];
80   };
82   linux = stdenv.mkDerivation {
83     inherit
84       pname
85       version
86       desktopItems
87       meta
88       passthru
89       ;
91     src =
92       let
93         suffix = selectSystem {
94           x86_64-linux = "waveterm-linux-x64";
95           aarch64-linux = "waveterm-linux-arm64";
96         };
97         hash = selectSystem {
98           x86_64-linux = "sha256-zmmWQnZklnmhVrZp0F0dkVHVMW+K/VynSvbF9Zer/RE=";
99           aarch64-linux = "sha256-HRZRRUV6CVqUQYuvXBmnNcAsbZwgNDZiEf+gjdLDaPQ=";
100         };
101       in
102       fetchzip {
103         url = "https://github.com/wavetermdev/waveterm/releases/download/v${version}/${suffix}-${version}.zip";
104         inherit hash;
105         stripRoot = false;
106       };
108     nativeBuildInputs = [
109       copyDesktopItems
110       autoPatchelfHook
111       wrapGAppsHook3
112     ];
114     buildInputs = [
115       atk
116       at-spi2-atk
117       cups
118       libdrm
119       gtk3
120       pango
121       cairo
122       libX11
123       libXcomposite
124       libXdamage
125       libXext
126       libXfixes
127       libXrandr
128       mesa
129       expat
130       libxcb
131       alsa-lib
132       nss
133       nspr
134       vips
135     ];
137     runtimeDependencies = map lib.getLib [
138       udev
139     ];
141     installPhase = ''
142       runHook preInstall
144       mkdir -p $out/waveterm $out/bin
145       cp -r ./* $out/waveterm/
147       runHook postInstall
148     '';
150     preFixup = ''
151       makeWrapper $out/waveterm/waveterm $out/bin/waveterm \
152         --prefix LD_LIBRARY_PATH : "${
153           lib.makeLibraryPath [
154             libGL
155           ]
156         }"
157     '';
158   };
160   darwin = stdenv.mkDerivation rec {
161     inherit
162       pname
163       version
164       meta
165       passthru
166       ;
168     src =
169       let
170         suffix = selectSystem {
171           x86_64-darwin = "Wave-darwin-x64";
172           aarch64-darwin = "Wave-darwin-arm64";
173         };
174         hash = selectSystem {
175           x86_64-darwin = "sha256-NSpNWUWdRkB2H5l/WnI/Xyv68h0OXX7SIKyDAq0LIJM=";
176           aarch64-darwin = "sha256-QkJMrmqrveFc2StL5gVpE78DlC1OBcEV+tY7p2nJ/6I=";
177         };
178       in
179       fetchurl {
180         url = "https://github.com/wavetermdev/waveterm/releases/download/v${version}/${suffix}-${version}.zip";
181         inherit hash;
182       };
184     nativeBuildInputs = [
185       unzip
186     ];
188     unpackPhase = ''
189       runHook preUnpack
191       unzip ${src} -d ./
193       runHook postUnpack
194     '';
196     sourceRoot = "Wave.app";
198     installPhase = ''
199       runHook preInstall
201       mkdir -p $out/Applications/Wave.app
202       cp -r . $out/Applications/Wave.app
204       runHook postInstall
205     '';
206   };
208 if stdenv.hostPlatform.isDarwin then darwin else linux