From 2e234161a7008c7e06ce05fe6764939171522bf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Lafuente?= Date: Thu, 8 Aug 2019 21:38:04 +0200 Subject: [PATCH] clj-kondo: init at 2019.07.31-alpha --- pkgs/development/tools/clj-kondo/default.nix | 51 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/development/tools/clj-kondo/default.nix diff --git a/pkgs/development/tools/clj-kondo/default.nix b/pkgs/development/tools/clj-kondo/default.nix new file mode 100644 index 000000000000..919061c6d963 --- /dev/null +++ b/pkgs/development/tools/clj-kondo/default.nix @@ -0,0 +1,51 @@ +{ stdenv, lib, graalvm8, fetchurl }: + +stdenv.mkDerivation rec{ + pname = "clj-kondo"; + version = "2019.07.31-alpha"; + + 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"; + sha256 = "03ipl7br9pgx2hdbiaxv9ip0ibafkyzkc8qlx8xyi528bcfi54bf"; + }; + + 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."; + homepage = https://github.com/borkdude/clj-kondo; + license = licenses.epl10; + platforms = graalvm8.meta.platforms; + maintainers = with maintainers; [ jlesquembre ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f5b089be81bf..a18d191bdd9c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -151,6 +151,8 @@ in castxml = callPackage ../development/tools/castxml { }; + clj-kondo = callPackage ../development/tools/clj-kondo { }; + cmark = callPackage ../development/libraries/cmark { }; conftest = callPackage ../development/tools/conftest {};