2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, jdk, jre, coursier, makeWrapper }:
|
2018-10-24 18:00:00 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
baseName = "scalafix";
|
|
|
|
version = "0.9.0";
|
|
|
|
deps = stdenv.mkDerivation {
|
|
|
|
name = "${baseName}-deps-${version}";
|
|
|
|
buildCommand = ''
|
|
|
|
export COURSIER_CACHE=$(pwd)
|
2021-10-29 01:48:26 +01:00
|
|
|
${coursier}/bin/cs fetch ch.epfl.scala:scalafix-cli_2.12.7:${version} > deps
|
2018-10-24 18:00:00 +01:00
|
|
|
mkdir -p $out/share/java
|
|
|
|
cp $(< deps) $out/share/java/
|
|
|
|
'';
|
|
|
|
outputHashMode = "recursive";
|
|
|
|
outputHashAlgo = "sha256";
|
|
|
|
outputHash = "19j260prx7k010nxyvc1m9jj1ncxr73m2cym7if39360v5dc05c0";
|
|
|
|
};
|
|
|
|
in
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2021-07-25 00:27:41 +01:00
|
|
|
pname = baseName;
|
|
|
|
inherit version;
|
2018-10-24 18:00:00 +01:00
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jdk deps ];
|
2018-10-24 18:00:00 +01:00
|
|
|
|
2021-07-25 00:27:41 +01:00
|
|
|
dontUnpack = true;
|
2018-10-24 18:00:00 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
makeWrapper ${jre}/bin/java $out/bin/${baseName} \
|
|
|
|
--add-flags "-cp $CLASSPATH scalafix.cli.Cli"
|
|
|
|
'';
|
|
|
|
|
2021-07-25 00:27:41 +01:00
|
|
|
installCheckPhase = ''
|
2018-10-24 18:00:00 +01:00
|
|
|
$out/bin/${baseName} --version | grep -q "${version}"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-10-24 18:00:00 +01:00
|
|
|
description = "Refactoring and linting tool for Scala";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://scalacenter.github.io/scalafix/";
|
2018-10-24 18:00:00 +01:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.tomahna ];
|
|
|
|
};
|
|
|
|
}
|