{ stdenv, fetchurl, makeWrapper, jre }: stdenv.mkDerivation rec { name = "ktlint-${version}"; version = "0.31.0"; src = fetchurl { url = "https://github.com/shyiko/ktlint/releases/download/${version}/ktlint"; sha256 = "0bqpflvnh423w54162r0d6l503lql1bwqykxw18s2fx1n1gb3n9a"; }; nativeBuildInputs = [ makeWrapper ]; propagatedBuildInputs = [ jre ]; unpackCmd = '' mkdir -p ${name} cp $curSrc ${name}/ktlint ''; installPhase = '' mkdir -p $out/bin mv ktlint $out/bin/ktlint chmod +x $out/bin/ktlint ''; postFixup = '' wrapProgram $out/bin/ktlint --prefix PATH : "${jre}/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; maintainers = with maintainers; [ tadfisher ]; }; }