nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 37 lines 1.2 kB view raw
1{ lib, stdenv, fetchurl, makeWrapper, jre }: 2 3stdenv.mkDerivation rec { 4 version = "10.1"; 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-raVTkfJou6mLgjZd4vriPOAeM+mrlWf3lo9kFstMpT8="; 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 license = licenses.lgpl21; 34 maintainers = with maintainers; [ pSub ]; 35 platforms = jre.meta.platforms; 36 }; 37}