blob: 4695854dbfad94d1635daf7368eec3540fe3359a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
{ lib, stdenv, fetchurl, unzip, makeWrapper, openjdk }:
stdenv.mkDerivation rec {
pname = "pmd";
version = "6.49.0";
src = fetchurl {
url = "https://github.com/pmd/pmd/releases/download/pmd_releases/${version}/pmd-bin-${version}.zip";
hash = "sha256-dEKfQIdWkx6XAKnEBHaVI0l729Xj2RnjoHl59t0Kal0=";
};
nativeBuildInputs = [ unzip makeWrapper ];
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
install -Dm755 bin/run.sh $out/libexec/pmd
install -Dm644 lib/*.jar -t $out/lib/pmd
wrapProgram $out/libexec/pmd \
--prefix PATH : ${openjdk.jre}/bin \
--set LIB_DIR $out/lib/pmd
for app in pmd cpd cpdgui designer bgastviewer designerold ast-dump; do
makeWrapper $out/libexec/pmd $out/bin/$app --argv0 $app --add-flags $app
done
runHook postInstall
'';
meta = with lib; {
description = "An extensible cross-language static code analyzer";
homepage = "https://pmd.github.io/";
changelog = "https://pmd.github.io/pmd-${version}/pmd_release_notes.html";
platforms = platforms.unix;
license = with licenses; [ bsdOriginal asl20 ];
};
}
|