cloudflare-warp: add versionCheckHook (#358956)

This commit is contained in:
Aleksana
2024-12-05 19:34:24 +08:00
committed by GitHub
+42 -24
View File
@@ -1,39 +1,46 @@
{ stdenv
, lib
, autoPatchelfHook
, copyDesktopItems
, dbus
, dpkg
, fetchurl
, gtk3
, libpcap
, makeDesktopItem
, makeWrapper
, nftables
, nss
, openssl
{
stdenv,
lib,
autoPatchelfHook,
versionCheckHook,
copyDesktopItems,
dbus,
dpkg,
fetchurl,
gtk3,
libpcap,
makeDesktopItem,
makeWrapper,
nftables,
nss,
openssl,
}:
stdenv.mkDerivation rec {
pname = "cloudflare-warp";
version = "2024.11.309";
suffix = {
aarch64-linux = "arm64";
x86_64-linux = "amd64";
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
suffix =
{
aarch64-linux = "arm64";
x86_64-linux = "amd64";
}
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
src = fetchurl {
url = "https://pkg.cloudflareclient.com/pool/noble/main/c/cloudflare-warp/cloudflare-warp_${version}.0_${suffix}.deb";
hash = {
aarch64-linux = "sha256-pdCPN4NxaQqWNRPZY1CN03KnTdzl62vJ3JNfxGozI4k=";
x86_64-linux = "sha256-THxXETyy08rBmvghrc8HIQ2cBSLeNVl8SkD43CVY/tE=";
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
hash =
{
aarch64-linux = "sha256-pdCPN4NxaQqWNRPZY1CN03KnTdzl62vJ3JNfxGozI4k=";
x86_64-linux = "sha256-THxXETyy08rBmvghrc8HIQ2cBSLeNVl8SkD43CVY/tE=";
}
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
};
nativeBuildInputs = [
dpkg
autoPatchelfHook
versionCheckHook
makeWrapper
copyDesktopItems
];
@@ -51,7 +58,11 @@ stdenv.mkDerivation rec {
(makeDesktopItem {
name = "com.cloudflare.WarpCli";
desktopName = "Cloudflare Zero Trust Team Enrollment";
categories = [ "Utility" "Security" "ConsoleOnly" ];
categories = [
"Utility"
"Security"
"ConsoleOnly"
];
noDisplay = true;
mimeTypes = [ "x-scheme-handler/com.cloudflare.warp" ];
exec = "warp-cli --accept-tos registration token %u";
@@ -90,6 +101,10 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/warp-svc --prefix PATH : ${lib.makeBinPath [ nftables ]}
'';
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/${meta.mainProgram}";
versionCheckProgramArg = [ "--version" ];
meta = with lib; {
description = "Replaces the connection between your device and the Internet with a modern, optimized, protocol";
homepage = "https://pkg.cloudflareclient.com/packages/cloudflare-warp";
@@ -100,6 +115,9 @@ stdenv.mkDerivation rec {
devpikachu
marcusramberg
];
platforms = [ "x86_64-linux" "aarch64-linux" ];
platforms = [
"x86_64-linux"
"aarch64-linux"
];
};
}