2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
2024-02-29 20:09:43 +00:00
|
|
|
, stdenv
|
2023-11-16 04:20:00 +00:00
|
|
|
, fetchurl
|
2024-02-29 20:09:43 +00:00
|
|
|
, autoPatchelfHook
|
2023-11-16 04:20:00 +00:00
|
|
|
, undmg
|
2024-02-29 20:09:43 +00:00
|
|
|
, zstd
|
|
|
|
, curl
|
|
|
|
, fontconfig
|
|
|
|
, libglvnd
|
|
|
|
, libxkbcommon
|
|
|
|
, vulkan-loader
|
2024-05-15 15:35:15 +00:00
|
|
|
, wayland
|
2024-02-29 20:09:43 +00:00
|
|
|
, xdg-utils
|
|
|
|
, xorg
|
|
|
|
, zlib
|
2024-05-15 15:35:15 +00:00
|
|
|
, makeWrapper
|
|
|
|
, waylandSupport ? false
|
2023-11-16 04:20:00 +00:00
|
|
|
}:
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
let
|
|
|
|
pname = "warp-terminal";
|
2024-04-21 15:54:59 +00:00
|
|
|
versions = lib.importJSON ./versions.json;
|
|
|
|
passthru.updateScript = ./update.sh;
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
linux_arch =
|
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux"
|
|
|
|
then "x86_64"
|
|
|
|
else "aarch64";
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
linux = stdenv.mkDerivation (finalAttrs: {
|
2024-04-21 15:54:59 +00:00
|
|
|
inherit pname meta passthru;
|
2024-09-19 14:19:46 +00:00
|
|
|
inherit (versions."linux_${linux_arch}") version;
|
2024-02-29 20:09:43 +00:00
|
|
|
src = fetchurl {
|
2024-09-19 14:19:46 +00:00
|
|
|
inherit (versions."linux_${linux_arch}") hash;
|
|
|
|
url = "https://releases.warp.dev/stable/v${finalAttrs.version}/warp-terminal-v${finalAttrs.version}-1-${linux_arch}.pkg.tar.zst";
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace usr/bin/warp-terminal \
|
|
|
|
--replace-fail /opt/ $out/opt/
|
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook zstd makeWrapper ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
curl
|
|
|
|
fontconfig
|
|
|
|
stdenv.cc.cc.lib # libstdc++.so libgcc_s.so
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDependencies = [
|
|
|
|
libglvnd # for libegl
|
|
|
|
libxkbcommon
|
|
|
|
stdenv.cc.libc
|
|
|
|
vulkan-loader
|
|
|
|
xdg-utils
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libxcb
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXi
|
2024-05-15 15:35:15 +00:00
|
|
|
] ++ lib.optionals waylandSupport [wayland];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir $out
|
|
|
|
cp -r opt usr/* $out
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
'' + lib.optionalString waylandSupport ''
|
|
|
|
wrapProgram $out/bin/warp-terminal --set WARP_ENABLE_WAYLAND 1
|
|
|
|
'' + ''
|
2024-02-29 20:09:43 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
|
|
|
darwin = stdenvNoCC.mkDerivation (finalAttrs: {
|
2024-04-21 15:54:59 +00:00
|
|
|
inherit pname meta passthru;
|
|
|
|
inherit (versions.darwin) version;
|
2023-11-16 04:20:00 +00:00
|
|
|
src = fetchurl {
|
2024-04-21 15:54:59 +00:00
|
|
|
inherit (versions.darwin) hash;
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "https://releases.warp.dev/stable/v${finalAttrs.version}/Warp.dmg";
|
|
|
|
};
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ undmg ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
cp -r *.app $out/Applications
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2024-02-29 20:09:43 +00:00
|
|
|
});
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Rust-based terminal";
|
|
|
|
homepage = "https://www.warp.dev";
|
|
|
|
license = licenses.unfree;
|
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = with maintainers; [ emilytrau imadnyc donteatoreo johnrtitor ];
|
2024-09-19 14:19:46 +00:00
|
|
|
platforms = platforms.darwin ++ [ "x86_64-linux" "aarch64-linux" ];
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
2024-09-26 11:04:55 +00:00
|
|
|
if stdenvNoCC.hostPlatform.isDarwin
|
2024-02-29 20:09:43 +00:00
|
|
|
then darwin
|
|
|
|
else linux
|