nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchurl, unzip, makeWrapper, openjdk }:
2
3stdenv.mkDerivation rec {
4 pname = "pmd";
5 version = "6.43.0";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/pmd/pmd-bin-${version}.zip";
9 sha256 = "sha256-+eJCN890vm4WBcMZ2VCGOS8WUyIckL+DfQVNaUSovGE=";
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 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 ];
28 };
29}