1{ stdenv, fetchurl, unzip, makeWrapper, openjdk }:
2
3stdenv.mkDerivation rec {
4 pname = "pmd";
5 version = "6.26.0";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/pmd/pmd-bin-${version}.zip";
9 sha256 = "1vlqwrbqk2cbp8kgxkm61c4blai81ib35yjf6wms16w0hvbqf2b4";
10 };
11
12 nativeBuildInputs = [ unzip makeWrapper ];
13
14 installPhase = ''
15 runHook preInstall
16 mkdir -p $out
17 cp -R {bin,lib} $out
18 wrapProgram $out/bin/run.sh --prefix PATH : ${openjdk.jre}/bin
19 runHook postInstall
20 '';
21
22 meta = with stdenv.lib; {
23 description = "An extensible cross-language static code analyzer";
24 homepage = "https://pmd.github.io/";
25 changelog = "https://pmd.github.io/pmd-${version}/pmd_release_notes.html";
26 platforms = platforms.unix;
27 license = with licenses; [ bsdOriginal asl20 lgpl3Plus ];
28 };
29}