From 0c05fb262a52eb6189ef6e9650c956ec2d41342b Mon Sep 17 00:00:00 2001 From: Kevin Rauscher Date: Wed, 24 Oct 2018 19:00:00 +0200 Subject: [PATCH] scalafix: init at 0.9.0 --- pkgs/development/tools/scalafix/default.nix | 43 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/tools/scalafix/default.nix diff --git a/pkgs/development/tools/scalafix/default.nix b/pkgs/development/tools/scalafix/default.nix new file mode 100644 index 00000000000..bd8a013fe2d --- /dev/null +++ b/pkgs/development/tools/scalafix/default.nix @@ -0,0 +1,43 @@ +{ stdenv, jdk, jre, coursier, makeWrapper }: + +let + baseName = "scalafix"; + version = "0.9.0"; + deps = stdenv.mkDerivation { + name = "${baseName}-deps-${version}"; + buildCommand = '' + export COURSIER_CACHE=$(pwd) + ${coursier}/bin/coursier fetch ch.epfl.scala:scalafix-cli_2.12.7:${version} > deps + mkdir -p $out/share/java + cp $(< deps) $out/share/java/ + ''; + outputHashMode = "recursive"; + outputHashAlgo = "sha256"; + outputHash = "19j260prx7k010nxyvc1m9jj1ncxr73m2cym7if39360v5dc05c0"; + }; +in +stdenv.mkDerivation rec { + name = "${baseName}-${version}"; + + buildInputs = [ jdk makeWrapper deps ]; + + doCheck = true; + + phases = [ "installPhase" "checkPhase" ]; + + installPhase = '' + makeWrapper ${jre}/bin/java $out/bin/${baseName} \ + --add-flags "-cp $CLASSPATH scalafix.cli.Cli" + ''; + + checkPhase = '' + $out/bin/${baseName} --version | grep -q "${version}" + ''; + + meta = with stdenv.lib; { + description = "Refactoring and linting tool for Scala"; + homepage = https://scalacenter.github.io/scalafix/; + license = licenses.bsd3; + maintainers = [ maintainers.tomahna ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 45984c3e967..e8406e7a358 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7375,6 +7375,7 @@ with pkgs; scala_2_12 = callPackage ../development/compilers/scala { jre = jre8; }; scala = scala_2_12; + scalafix = callPackage ../development/tools/scalafix { }; scalafmt = callPackage ../development/tools/scalafmt { }; sdcc = callPackage ../development/compilers/sdcc {