2021-07-14 22:03:04 +00:00
|
|
|
{ lib, stdenv, graalvm11-ce, babashka, fetchurl, fetchFromGitHub, clojure }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "clojure-lsp";
|
2021-07-14 22:03:04 +00:00
|
|
|
version = "2021.07.12-12.30.59";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-07-14 22:03:04 +00:00
|
|
|
sha256 = "0iky3yh548xn28285x8gnjzc00f3i2b415wb2dhd9p9y2bgzhkld";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
jar = fetchurl {
|
|
|
|
url = "https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/clojure-lsp.jar";
|
2021-07-14 22:03:04 +00:00
|
|
|
sha256 = "02k1k0slh1lm7k43d52jvgl0fdyp9gcr8csbr6yi71qbhy0axrmp";
|
2021-02-19 19:06:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GRAALVM_HOME = graalvm11-ce;
|
2021-04-26 19:14:03 +00:00
|
|
|
CLOJURE_LSP_JAR = jar;
|
2021-06-28 23:13:55 +00:00
|
|
|
CLOJURE_LSP_XMX = "-J-Xmx4g";
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
buildInputs = [ graalvm11-ce clojure ];
|
2021-02-19 19:06:45 +00:00
|
|
|
|
|
|
|
buildPhase = with lib; ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
bash ./graalvm/native-unix-compile.sh
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
runHook postBuild
|
|
|
|
'';
|
2021-01-05 17:05:55 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2021-02-19 19:06:45 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 ./clojure-lsp $out/bin/clojure-lsp
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
export HOME="$(mktemp -d)"
|
|
|
|
./clojure-lsp --version | fgrep -q '${version}'
|
2021-04-26 19:14:03 +00:00
|
|
|
${babashka}/bin/bb integration-test/run-all.clj ./clojure-lsp
|
2021-02-19 19:06:45 +00:00
|
|
|
|
|
|
|
runHook postCheck
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Language Server Protocol (LSP) for Clojure";
|
2021-04-26 19:14:03 +00:00
|
|
|
homepage = "https://github.com/clojure-lsp/clojure-lsp";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-06-28 23:13:55 +00:00
|
|
|
maintainers = with maintainers; [ ericdallo babariviere ];
|
2021-02-19 19:06:45 +00:00
|
|
|
platforms = graalvm11-ce.meta.platforms;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|