diff options
author | Will Dietz <w@wdtz.org> | 2022-05-02 21:34:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 21:34:51 -0500 |
commit | 4558d28cfce57227fd78a7a15120f275c9cf0389 (patch) | |
tree | 4ff1999b5de6075d5e3ec6495ea77716a4306f97 | |
parent | d60e768cb1560188df672c5d08ef962ba81d96be (diff) |
scalafix: 0.9.0 -> 0.10.0, completions, setup-hook instead of jdk (#171074)
* scalafix: 0.9.0 -> 0.10.0 Bump scala version 2.12.7 -> 2.13.8 (latest AFAICT), as well. Prefer hash format that matches what nix outputs these days for easier updating. * scalafix: shell completion (bash, zsh) * scalafix: use setJavaClassPath, drop jdk dep No need to pull in entire JDK just to use the setup-hook.
-rw-r--r-- | pkgs/development/tools/scalafix/default.nix | 17 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 1 |
2 files changed, 10 insertions, 8 deletions
diff --git a/pkgs/development/tools/scalafix/default.nix b/pkgs/development/tools/scalafix/default.nix index a38b6cee85242..3d57bdbd92c58 100644 --- a/pkgs/development/tools/scalafix/default.nix +++ b/pkgs/development/tools/scalafix/default.nix @@ -1,33 +1,36 @@ -{ lib, stdenv, jdk, jre, coursier, makeWrapper }: +{ lib, stdenv, jre, coursier, makeWrapper, installShellFiles, setJavaClassPath }: let baseName = "scalafix"; - version = "0.9.0"; + version = "0.10.0"; deps = stdenv.mkDerivation { name = "${baseName}-deps-${version}"; buildCommand = '' export COURSIER_CACHE=$(pwd) - ${coursier}/bin/cs fetch ch.epfl.scala:scalafix-cli_2.12.7:${version} > deps + ${coursier}/bin/cs fetch ch.epfl.scala:scalafix-cli_2.13.8:${version} > deps mkdir -p $out/share/java cp $(< deps) $out/share/java/ ''; outputHashMode = "recursive"; - outputHashAlgo = "sha256"; - outputHash = "19j260prx7k010nxyvc1m9jj1ncxr73m2cym7if39360v5dc05c0"; + outputHash = "sha256-lDeg90L484MggtQ2a9OyHv4UcfLPjzG3OJZCaWW2AC8="; }; in stdenv.mkDerivation { pname = baseName; inherit version; - nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ jdk deps ]; + nativeBuildInputs = [ makeWrapper installShellFiles setJavaClassPath ]; + buildInputs = [ deps ]; dontUnpack = true; installPhase = '' makeWrapper ${jre}/bin/java $out/bin/${baseName} \ --add-flags "-cp $CLASSPATH scalafix.cli.Cli" + + installShellCompletion --cmd ${baseName} \ + --bash <($out/bin/${baseName} --bash) \ + --zsh <($out/bin/${baseName} --zsh) ''; installCheckPhase = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5e6f2140bb71a..5aca0f5950a79 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13815,7 +13815,6 @@ with pkgs; metals = callPackage ../development/tools/metals { }; scalafix = callPackage ../development/tools/scalafix { jre = jre8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731 - jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731 }; scalafmt = callPackage ../development/tools/scalafmt { }; |