2020-11-09 15:59:12 +00:00
|
|
|
{ stdenv, lib, graalvm11-ce, fetchurl }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "clj-kondo";
|
2021-10-01 09:20:50 +00:00
|
|
|
version = "2021.09.25";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-04-25 03:57:28 +00:00
|
|
|
url = "https://github.com/clj-kondo/${pname}/releases/download/v${version}/${pname}-${version}-standalone.jar";
|
2021-10-01 09:20:50 +00:00
|
|
|
sha256 = "sha256-kS6bwsYH/cbjJlIeiDAy6QsAw+D1uHp26d4NBLfStjg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2020-11-09 15:59:12 +00:00
|
|
|
buildInputs = [ graalvm11-ce ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2021-10-04 12:37:57 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
# https://github.com/clj-kondo/clj-kondo/blob/v2021.09.25/script/compile#L17-L21
|
|
|
|
args=("-jar" "$src"
|
|
|
|
"-H:CLibraryPath=${graalvm11-ce.lib}/lib"
|
|
|
|
# Required to build babashka on darwin. Do not remove.
|
|
|
|
"${lib.optionalString stdenv.isDarwin "-H:-CheckToolchain"}"
|
|
|
|
"-H:+ReportExceptionStackTraces"
|
|
|
|
"--verbose"
|
|
|
|
"--no-fallback"
|
|
|
|
"-J-Xmx3g")
|
|
|
|
|
|
|
|
native-image ''${args[@]}
|
|
|
|
|
|
|
|
runHook postBuild
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp clj-kondo $out/bin/clj-kondo
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "A linter for Clojure code that sparks joy";
|
2021-04-25 03:57:28 +00:00
|
|
|
homepage = "https://github.com/clj-kondo/clj-kondo";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.epl10;
|
2020-11-09 15:59:12 +00:00
|
|
|
platforms = graalvm11-ce.meta.platforms;
|
2021-10-04 12:37:57 +00:00
|
|
|
maintainers = with maintainers; [ jlesquembre bandresen thiagokokada ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|