2020-11-07 18:52:45 +00:00
|
|
|
{ stdenv, lib, graalvm11-ce, fetchurl }:
|
2019-08-08 19:38:04 +00:00
|
|
|
|
2020-06-07 21:11:08 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-08 19:38:04 +00:00
|
|
|
pname = "clj-kondo";
|
2021-09-30 15:15:59 +00:00
|
|
|
version = "2021.09.25";
|
2019-08-08 19:38:04 +00:00
|
|
|
|
|
|
|
reflectionJson = fetchurl {
|
|
|
|
name = "reflection.json";
|
2021-04-22 14:25:41 +00:00
|
|
|
url = "https://raw.githubusercontent.com/clj-kondo/${pname}/v${version}/reflection.json";
|
|
|
|
sha256 = "sha256-C4QYk5lLienCHKnWXXZPcKmsCTMtIIkXOkvCrZfyIhA=";
|
2019-08-08 19:38:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-04-22 14:25:41 +00:00
|
|
|
url = "https://github.com/clj-kondo/${pname}/releases/download/v${version}/${pname}-${version}-standalone.jar";
|
2021-09-30 15:15:59 +00:00
|
|
|
sha256 = "sha256-kS6bwsYH/cbjJlIeiDAy6QsAw+D1uHp26d4NBLfStjg=";
|
2019-08-08 19:38:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2020-11-07 18:52:45 +00:00
|
|
|
buildInputs = [ graalvm11-ce ];
|
2019-08-08 19:38:04 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
native-image \
|
|
|
|
-jar ${src} \
|
|
|
|
-H:Name=clj-kondo \
|
2021-02-02 22:16:43 +00:00
|
|
|
${lib.optionalString stdenv.isDarwin ''-H:-CheckToolchain''} \
|
2019-08-08 19:38:04 +00:00
|
|
|
-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; {
|
2020-10-11 05:55:05 +00:00
|
|
|
description = "A linter for Clojure code that sparks joy";
|
2021-04-22 14:25:41 +00:00
|
|
|
homepage = "https://github.com/clj-kondo/clj-kondo";
|
2019-08-08 19:38:04 +00:00
|
|
|
license = licenses.epl10;
|
2020-11-07 18:52:45 +00:00
|
|
|
platforms = graalvm11-ce.meta.platforms;
|
2019-11-03 15:20:54 +00:00
|
|
|
maintainers = with maintainers; [ jlesquembre bandresen ];
|
2019-08-08 19:38:04 +00:00
|
|
|
};
|
|
|
|
}
|