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.
main
Will Dietz 2 years ago committed by GitHub
parent d60e768cb1
commit 4558d28cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      pkgs/development/tools/scalafix/default.nix
  2. 1
      pkgs/top-level/all-packages.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 = ''

@ -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 { };

Loading…
Cancel
Save