2019-08-08 20:38:04 +01:00
|
|
|
{ stdenv, lib, graalvm8, fetchurl }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec{
|
|
|
|
pname = "clj-kondo";
|
2020-04-05 14:17:59 +01:00
|
|
|
version = "2020.04.05";
|
2019-08-08 20:38:04 +01:00
|
|
|
|
|
|
|
reflectionJson = fetchurl {
|
|
|
|
name = "reflection.json";
|
|
|
|
url = "https://raw.githubusercontent.com/borkdude/${pname}/v${version}/reflection.json";
|
|
|
|
sha256 = "1m6kja38p6aypawbynkyq8bdh8wpdjmyqrhslinqid9r8cl25rcq";
|
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/borkdude/${pname}/releases/download/v${version}/${pname}-${version}-standalone.jar";
|
2020-04-05 14:17:59 +01:00
|
|
|
sha256 = "0k9samcqkpkdgzbzr2bpixf75987lsabh97101v1fg12qvjhf187";
|
2019-08-08 20:38:04 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
buildInputs = [ graalvm8 ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
native-image \
|
|
|
|
-jar ${src} \
|
|
|
|
-H:Name=clj-kondo \
|
|
|
|
-H:+ReportExceptionStackTraces \
|
|
|
|
-J-Dclojure.spec.skip-macros=true \
|
|
|
|
-J-Dclojure.compiler.direct-linking=true \
|
|
|
|
"-H:IncludeResources=clj_kondo/impl/cache/built_in/.*" \
|
|
|
|
-H:ReflectionConfigurationFiles=${reflectionJson} \
|
|
|
|
--initialize-at-build-time \
|
|
|
|
-H:Log=registerResource: \
|
|
|
|
--verbose \
|
|
|
|
--no-fallback \
|
|
|
|
--no-server \
|
|
|
|
"-J-Xmx3g"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp clj-kondo $out/bin/clj-kondo
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A linter for Clojure code that sparks joy.";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/borkdude/clj-kondo";
|
2019-08-08 20:38:04 +01:00
|
|
|
license = licenses.epl10;
|
|
|
|
platforms = graalvm8.meta.platforms;
|
2019-11-03 15:20:54 +00:00
|
|
|
maintainers = with maintainers; [ jlesquembre bandresen ];
|
2019-08-08 20:38:04 +01:00
|
|
|
};
|
|
|
|
}
|