nixpkgs/pkgs/tools/networking/zap/default.nix
Jörg Thalheim dadc7eb329
treewide: use runtimeShell instead of stdenv.shell whenever possible
Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
2019-02-26 14:10:49 +00:00

38 lines
1021 B
Nix

{ stdenv, fetchFromGitHub, jdk, ant, runtimeShell }:
stdenv.mkDerivation rec {
name = "zap-${version}";
version = "2.7.0";
src = fetchFromGitHub {
owner = "zaproxy";
repo = "zaproxy";
rev ="${version}";
sha256 = "1bz4pgq66v6kxmgj99llacm1d85vj8z78jlgc2z9hv0ha5i57y32";
};
buildInputs = [ jdk ant ];
buildPhase = ''
cd build
echo -n "${version}" > version.txt
ant -f build.xml setup init compile dist copy-source-to-build package-linux
'';
installPhase = ''
mkdir -p "$out/share"
tar xvf "ZAP_${version}_Linux.tar.gz" -C "$out/share/"
mkdir -p "$out/bin"
echo "#!${runtimeShell}" > "$out/bin/zap"
echo \"$out/share/ZAP_${version}/zap.sh\" >> "$out/bin/zap"
chmod +x "$out/bin/zap"
'';
meta = with stdenv.lib; {
homepage = https://www.owasp.org/index.php/ZAP;
description = "Java application for web penetration testing";
maintainers = with maintainers; [ mog ];
platforms = platforms.linux;
license = licenses.asl20;
};
}