diff --git a/pkgs/development/tools/analysis/checkstyle/default.nix b/pkgs/development/tools/analysis/checkstyle/default.nix index 34b9e53f6e4..690db9a30e1 100644 --- a/pkgs/development/tools/analysis/checkstyle/default.nix +++ b/pkgs/development/tools/analysis/checkstyle/default.nix @@ -1,19 +1,24 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchurl, makeWrapper, jre }: stdenv.mkDerivation rec { - version = "8.11"; + version = "8.12"; name = "checkstyle-${version}"; src = fetchurl { url = "https://github.com/checkstyle/checkstyle/releases/download/checkstyle-${version}/checkstyle-${version}-all.jar"; - sha256 = "13x4m4rn7rix64baclcm2jqbizkj38njif2ba0ycmvyjm62smfwv"; + sha256 = "000048flqhkwnjn37bh07wgn6q4m12s3h3p9piqgvxswrjc95x3y"; }; - phases = [ "installPhase" ]; + nativeBuildInputs = [ makeWrapper jre ]; + + unpackPhase = ":"; installPhase = '' - mkdir -p $out/checkstyle - cp $src $out/checkstyle/checkstyle-all.jar + runHook preInstall + install -D $src $out/checkstyle/checkstyle-all.jar + makeWrapper ${jre}/bin/java $out/bin/checkstyle \ + --add-flags "-jar $out/checkstyle/checkstyle-all.jar" + runHook postInstall ''; meta = with stdenv.lib; {