1 { lib, stdenv, fetchurl, unzip, makeWrapper, openjdk }:
3 stdenv.mkDerivation rec {
8 url = "https://github.com/pmd/pmd/releases/download/pmd_releases/${version}/pmd-bin-${version}.zip";
9 hash = "sha256-dEKfQIdWkx6XAKnEBHaVI0l729Xj2RnjoHl59t0Kal0=";
12 nativeBuildInputs = [ unzip makeWrapper ];
20 install -Dm755 bin/run.sh $out/libexec/pmd
21 install -Dm644 lib/*.jar -t $out/lib/pmd
23 wrapProgram $out/libexec/pmd \
24 --prefix PATH : ${openjdk.jre}/bin \
25 --set LIB_DIR $out/lib/pmd
27 for app in pmd cpd cpdgui designer bgastviewer designerold ast-dump; do
28 makeWrapper $out/libexec/pmd $out/bin/$app --argv0 $app --add-flags $app
35 description = "An extensible cross-language static code analyzer";
36 homepage = "https://pmd.github.io/";
37 changelog = "https://pmd.github.io/pmd-${version}/pmd_release_notes.html";
38 platforms = platforms.unix;
39 license = with licenses; [ bsdOriginal asl20 ];