2020-11-07 19:52:45 +01:00
|
|
|
{ stdenv, lib, graalvm11-ce, fetchurl }:
|
2019-08-08 21:38:04 +02:00
|
|
|
|
2020-06-07 23:11:08 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-08 21:38:04 +02:00
|
|
|
pname = "clj-kondo";
|
2020-11-07 19:52:45 +01:00
|
|
|
version = "2020.11.07";
|
2019-08-08 21:38:04 +02:00
|
|
|
|
|
|
|
reflectionJson = fetchurl {
|
|
|
|
name = "reflection.json";
|
|
|
|
url = "https://raw.githubusercontent.com/borkdude/${pname}/v${version}/reflection.json";
|
2020-11-07 19:52:45 +01:00
|
|
|
sha256 = "0mwclqjh38alkddr5r7bfqn5lplx06h9gladi89kp06qdxc1hp7a";
|
2019-08-08 21:38:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/borkdude/${pname}/releases/download/v${version}/${pname}-${version}-standalone.jar";
|
2020-11-07 19:52:45 +01:00
|
|
|
sha256 = "1xqryfcn82bp8wasqnllfgvhl5w9zm63yw8c2kgxz18dayhq4i31";
|
2019-08-08 21:38:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2020-11-07 19:52:45 +01:00
|
|
|
buildInputs = [ graalvm11-ce ];
|
2019-08-08 21:38:04 +02:00
|
|
|
|
|
|
|
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; {
|
2020-10-11 07:55:05 +02:00
|
|
|
description = "A linter for Clojure code that sparks joy";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/borkdude/clj-kondo";
|
2019-08-08 21:38:04 +02:00
|
|
|
license = licenses.epl10;
|
2020-11-07 19:52:45 +01:00
|
|
|
platforms = graalvm11-ce.meta.platforms;
|
2019-11-03 16:20:54 +01:00
|
|
|
maintainers = with maintainers; [ jlesquembre bandresen ];
|
2019-08-08 21:38:04 +02:00
|
|
|
};
|
|
|
|
}
|