caido: 0.33.0 -> 0.39.0 (#328499)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
D3vil0p3r 2024-07-26 21:38:52 +02:00 committed by GitHub
parent 09f6f0f3b7
commit a5c855f049
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,40 +1,92 @@
{ lib
, fetchurl
, appimageTools
, makeWrapper
{
lib,
stdenv,
fetchurl,
appimageTools,
makeWrapper,
autoPatchelfHook,
libgcc,
appVariants ? [ ],
}:
let
pname = "caido";
version = "0.33.0";
src = fetchurl {
url = "https://storage.googleapis.com/caido-releases/v${version}/caido-desktop-v${version}-linux-x86_64.AppImage";
hash = "sha256-MUQ1tVcIpLrC2RKsWDqv8MBGaHfh56OxIC/ARArQjiU=";
appVariantList = [
"cli"
"desktop"
];
version = "0.39.0";
cli = fetchurl {
url = "https://storage.googleapis.com/caido-releases/v${version}/caido-cli-v${version}-linux-x86_64.tar.gz";
hash = "sha256-I8UF2rzIKfpcrxyvDa4AReWDIHOKTCj3ERaWhG1xGG0=";
};
desktop = fetchurl {
url = "https://storage.googleapis.com/caido-releases/v${version}/caido-desktop-v${version}-linux-x86_64.AppImage";
hash = "sha256-KYQck2+YYPLJN3L6qchacjyVyyXR3nmJDTX5GPB4WvI=";
};
appimageContents = appimageTools.extractType2 {
inherit pname version;
src = desktop;
};
appimageContents = appimageTools.extractType2 { inherit pname src version; };
in appimageTools.wrapType2 {
inherit pname src version;
wrappedDesktop = appimageTools.wrapType2 {
src = desktop;
inherit pname version;
extraPkgs = pkgs: [ pkgs.libthai ];
extraPkgs = pkgs: [ pkgs.libthai ];
extraInstallCommands = ''
install -m 444 -D ${appimageContents}/caido.desktop -t $out/share/applications
install -m 444 -D ${appimageContents}/caido.png \
$out/share/icons/hicolor/512x512/apps/caido.png
source "${makeWrapper}/nix-support/setup-hook"
wrapProgram $out/bin/${pname} \
--set WEBKIT_DISABLE_COMPOSITING_MODE 1
'';
extraInstallCommands = ''
install -m 444 -D ${appimageContents}/caido.desktop -t $out/share/applications
install -m 444 -D ${appimageContents}/caido.png \
$out/share/icons/hicolor/512x512/apps/caido.png
source "${makeWrapper}/nix-support/setup-hook"
wrapProgram $out/bin/caido \
--set WEBKIT_DISABLE_COMPOSITING_MODE 1
'';
};
meta = with lib; {
wrappedCli = stdenv.mkDerivation {
src = cli;
inherit pname version;
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [ libgcc ];
sourceRoot = ".";
installPhase = ''
runHook preInstall
install -m755 -D caido-cli $out/bin/caido-cli
'';
};
meta = {
description = "Lightweight web security auditing toolkit";
homepage = "https://caido.io/";
changelog = "https://github.com/caido/caido/releases/tag/v${version}";
license = licenses.unfree;
maintainers = with maintainers; [ octodi ];
mainProgram = "caido";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [
octodi
d3vil0p3r
];
platforms = [ "x86_64-linux" ];
};
}
in
lib.checkListOfEnum "${pname}: appVariants" appVariantList appVariants (
if appVariants == [ "desktop" ] then
wrappedDesktop
else if appVariants == [ "cli" ] then
wrappedCli
else
stdenv.mkDerivation {
inherit pname version meta;
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin
ln -s ${wrappedDesktop}/bin/caido $out/bin/caido
ln -s ${wrappedCli}/bin/caido-cli $out/bin/caido-cli
'';
}
)