nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 47 lines 1.2 kB view raw
1{ 2 lib, 3 fetchFromGitHub, 4 jre_headless, 5 makeWrapper, 6 maven, 7}: 8 9maven.buildMavenPackage rec { 10 pname = "ktfmt"; 11 version = "0.51"; 12 13 src = fetchFromGitHub { 14 owner = "facebook"; 15 repo = "ktfmt"; 16 tag = "v${version}"; 17 hash = "sha256-TIYV/V6vtGTTSLFf9dcKo8Ezx61e7Vvz3vQvbh0Kj/Y="; 18 }; 19 20 patches = [ ./pin-default-maven-plugin-versions.patch ]; 21 22 mvnHash = "sha256-f/Uwc0ynROEKl2+zsgqj5ctRu1QcNblF5suU/0+fvKw="; 23 24 mvnParameters = "-Dproject.build.outputTimestamp=1980-01-01T00:00:02Z"; 25 26 nativeBuildInputs = [ makeWrapper ]; 27 28 installPhase = '' 29 runHook preInstall 30 31 install -Dm644 core/target/ktfmt-*-jar-with-dependencies.jar $out/share/ktfmt/ktfmt.jar 32 33 makeWrapper ${jre_headless}/bin/java $out/bin/ktfmt \ 34 --add-flags "-jar $out/share/ktfmt/ktfmt.jar" 35 36 runHook postInstall 37 ''; 38 39 meta = with lib; { 40 description = "Program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions"; 41 homepage = "https://github.com/facebook/ktfmt"; 42 license = licenses.asl20; 43 mainProgram = "ktfmt"; 44 maintainers = with maintainers; [ ghostbuster91 ]; 45 inherit (jre_headless.meta) platforms; 46 }; 47}