diff --git a/pkgs/development/tools/ktlint/default.nix b/pkgs/development/tools/ktlint/default.nix index fce25903aca9..b26c328dba85 100644 --- a/pkgs/development/tools/ktlint/default.nix +++ b/pkgs/development/tools/ktlint/default.nix @@ -1,38 +1,31 @@ -{ stdenv, fetchurl, makeWrapper, jre }: +{ stdenv, fetchurl, makeWrapper, jre_headless }: stdenv.mkDerivation rec { pname = "ktlint"; - version = "0.37.2"; + version = "0.39.0"; src = fetchurl { url = "https://github.com/shyiko/ktlint/releases/download/${version}/ktlint"; - sha256 = "1hhycvvp21gy6g71hwf3pk2jnccpnhcf2z7c85shzffhddy1wc0v"; + sha256 = "0lvi4d731ypdjcskj0hdfd37wa3ldspibs2dgaahg7d7zhp1l76g"; }; nativeBuildInputs = [ makeWrapper ]; - propagatedBuildInputs = [ jre ]; - - unpackCmd = '' - mkdir -p ${pname}-${version} - cp $curSrc ${pname}-${version}/ktlint - ''; + dontUnpack = true; installPhase = '' - mkdir -p $out/bin - mv ktlint $out/bin/ktlint - chmod +x $out/bin/ktlint + install -Dm755 $src $out/bin/ktlint ''; postFixup = '' - wrapProgram $out/bin/ktlint --prefix PATH : "${jre}/bin" + wrapProgram $out/bin/ktlint --prefix PATH : "${jre_headless}/bin" ''; meta = with stdenv.lib; { description = "An anti-bikeshedding Kotlin linter with built-in formatter"; homepage = "https://ktlint.github.io/"; license = licenses.mit; - platforms = platforms.all; + platforms = jre_headless.meta.platforms; maintainers = with maintainers; [ tadfisher ]; }; }