1{ lib, stdenv, fetchurl, makeWrapper, jre }:
2
3stdenv.mkDerivation rec {
4 version = "10.12.0";
5 pname = "checkstyle";
6
7 src = fetchurl {
8 url = "https://github.com/checkstyle/checkstyle/releases/download/checkstyle-${version}/checkstyle-${version}-all.jar";
9 sha256 = "sha256-pA1K58kBZ3lZVgzg0NFYt+vA1JHOW+yW41t0ARlqvJE=";
10 };
11
12 nativeBuildInputs = [ makeWrapper ];
13 buildInputs = [ jre ];
14
15 dontUnpack = true;
16
17 installPhase = ''
18 runHook preInstall
19 install -D $src $out/checkstyle/checkstyle-all.jar
20 makeWrapper ${jre}/bin/java $out/bin/checkstyle \
21 --add-flags "-jar $out/checkstyle/checkstyle-all.jar"
22 runHook postInstall
23 '';
24
25 meta = with lib; {
26 description = "Checks Java source against a coding standard";
27 longDescription = ''
28 checkstyle is a development tool to help programmers write Java code that
29 adheres to a coding standard. By default it supports the Sun Code
30 Conventions, but is highly configurable.
31 '';
32 homepage = "http://checkstyle.sourceforge.net/";
33 sourceProvenance = with sourceTypes; [ binaryBytecode ];
34 license = licenses.lgpl21;
35 maintainers = with maintainers; [ pSub ];
36 platforms = jre.meta.platforms;
37 };
38}