Skip to content

Commit 3a2110a

Browse files
authored
zap: add .desktop (#355282)
2 parents af4c849 + 63c3362 commit 3a2110a

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

pkgs/by-name/za/zap/package.nix

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
{ lib, stdenv, fetchurl, jre, runtimeShell }:
1+
{
2+
lib,
3+
stdenv,
4+
fetchurl,
5+
jre,
6+
makeDesktopItem,
7+
copyDesktopItems,
8+
runtimeShell,
9+
}:
210

311
stdenv.mkDerivation rec {
412
pname = "zap";
@@ -8,15 +16,34 @@ stdenv.mkDerivation rec {
816
sha256 = "sha256-ZBDhlrqrRYqSBOKar7V0X8oAOipsA4byxuXAS2diH6c=";
917
};
1018

19+
desktopItems = [
20+
(makeDesktopItem {
21+
name = "zap";
22+
exec = "zap";
23+
icon = "zap";
24+
desktopName = "Zed Attack Proxy";
25+
categories = [
26+
"Development"
27+
"Security"
28+
"System"
29+
];
30+
})
31+
];
32+
1133
buildInputs = [ jre ];
1234

35+
nativeBuildInputs = [ copyDesktopItems ];
36+
1337
# From https://github.com/zaproxy/zaproxy/blob/master/zap/src/main/java/org/parosproxy/paros/Constant.java
1438
version_tag = "20012000";
1539

1640
# Copying config and adding version tag before first use to avoid permission
1741
# issues if zap tries to copy config on it's own.
1842
installPhase = ''
19-
mkdir -p "$out/bin" "$out/share"
43+
runHook preInstall
44+
45+
mkdir -p $out/{bin,share}
46+
2047
cp -pR . "$out/share/${pname}/"
2148
2249
cat >> "$out/bin/${pname}" << EOF
@@ -33,12 +60,17 @@ stdenv.mkDerivation rec {
3360
EOF
3461
3562
chmod u+x "$out/bin/${pname}"
63+
64+
runHook postInstall
3665
'';
3766

3867
meta = with lib; {
3968
homepage = "https://www.zaproxy.org/";
4069
description = "Java application for web penetration testing";
41-
maintainers = with maintainers; [ mog rafael ];
70+
maintainers = with maintainers; [
71+
mog
72+
rafael
73+
];
4274
platforms = platforms.linux;
4375
license = licenses.asl20;
4476
mainProgram = "zap";

0 commit comments

Comments
 (0)