mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-05 21:33:07 +00:00
Merge pull request #15330 from markus1189/scalafmt
scalafmt: init at 0.2.3
This commit is contained in:
commit
89008a2c58
36
pkgs/development/tools/scalafmt/default.nix
Normal file
36
pkgs/development/tools/scalafmt/default.nix
Normal file
@ -0,0 +1,36 @@
|
||||
{ stdenv, fetchurl, unzip, jre }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "0.2.3";
|
||||
baseName = "scalafmt";
|
||||
name = "${baseName}-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/olafurpg/scalafmt/releases/download/v${version}/${baseName}.tar.gz";
|
||||
sha256 = "0klzm86771wl6d8cq5cf4a4mfz8idcis6wrg0x2ix5rcc5zi0d4d";
|
||||
};
|
||||
|
||||
unpackPhase = "tar xvzf $src";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p "$out/bin"
|
||||
mkdir -p "$out/lib"
|
||||
|
||||
cp cli/target/scala-2.11/scalafmt.jar "$out/lib/${name}.jar"
|
||||
|
||||
cat > "$out/bin/${baseName}" << EOF
|
||||
#!${stdenv.shell}
|
||||
exec ${jre}/bin/java -jar "$out/lib/${name}.jar" "\$@"
|
||||
EOF
|
||||
|
||||
chmod a+x "$out/bin/${baseName}"
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Opinionated code formatter for Scala";
|
||||
homepage = http://scalafmt.org;
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.linux;
|
||||
maintainers = [ maintainers.markus1189 ];
|
||||
};
|
||||
}
|
@ -5231,6 +5231,8 @@ in
|
||||
scala_2_11 = callPackage ../development/compilers/scala { };
|
||||
scala = scala_2_11;
|
||||
|
||||
scalafmt = callPackage ../development/tools/scalafmt { };
|
||||
|
||||
sdcc = callPackage ../development/compilers/sdcc { boost = boost159; };
|
||||
|
||||
smlnjBootstrap = callPackage ../development/compilers/smlnj/bootstrap.nix { };
|
||||
|
Loading…
Reference in New Issue
Block a user