2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, unzip, makeWrapper, openjdk }:
|
2009-06-18 12:51:51 +00:00
|
|
|
|
2015-03-12 20:19:03 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-06-05 06:10:59 +00:00
|
|
|
pname = "pmd";
|
2023-03-02 18:19:05 +00:00
|
|
|
version = "6.55.0";
|
2009-06-18 12:51:51 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-07-26 05:10:06 +00:00
|
|
|
url = "https://github.com/pmd/pmd/releases/download/pmd_releases/${version}/pmd-bin-${version}.zip";
|
2023-03-02 18:19:05 +00:00
|
|
|
hash = "sha256-Iaz5bUPLQNWRyszMHCCmb8eW6t32nqYYEllER7rHoR0=";
|
2009-06-18 12:51:51 +00:00
|
|
|
};
|
|
|
|
|
2020-07-01 19:30:31 +00:00
|
|
|
nativeBuildInputs = [ unzip makeWrapper ];
|
|
|
|
|
2022-07-26 05:10:06 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
2009-06-18 12:51:51 +00:00
|
|
|
installPhase = ''
|
2019-06-05 06:10:59 +00:00
|
|
|
runHook preInstall
|
2022-07-26 05:10:06 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2019-06-05 06:10:59 +00:00
|
|
|
runHook postInstall
|
2009-06-18 12:51:51 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2018-11-09 12:37:30 +00:00
|
|
|
description = "An extensible cross-language static code analyzer";
|
2019-06-05 06:10:59 +00:00
|
|
|
homepage = "https://pmd.github.io/";
|
|
|
|
changelog = "https://pmd.github.io/pmd-${version}/pmd_release_notes.html";
|
2018-10-11 11:20:01 +00:00
|
|
|
platforms = platforms.unix;
|
2022-02-17 12:41:51 +00:00
|
|
|
license = with licenses; [ bsdOriginal asl20 ];
|
2009-06-18 12:51:51 +00:00
|
|
|
};
|
|
|
|
}
|