nixpkgs/pkgs/development/tools/misc/clojure-lsp/default.nix

57 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, stdenv, graalvm11-ce, babashka, fetchurl, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "clojure-lsp";
version = "2021.04.13-12.47.33";
src = fetchFromGitHub {
2021-02-04 03:56:20 +00:00
owner = pname;
repo = pname;
rev = version;
sha256 = "1la0d28pvp1fqnxp3scb2vawcblilwyx42djxn379vag403p1i2d";
};
jar = fetchurl {
url = "https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/clojure-lsp.jar";
sha256 = "059gz7y2rzwdxpyqy80w4lghzgxi5lb4rxmks1721yq6k7ljjyqy";
2021-02-04 03:56:20 +00:00
};
GRAALVM_HOME = graalvm11-ce;
CLOJURE_LSP_JAR = jar;
buildInputs = [ graalvm11-ce ];
buildPhase = with lib; ''
runHook preBuild
bash ./graalvm/native-unix-compile.sh
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 ./clojure-lsp $out/bin/clojure-lsp
runHook postInstall
'';
2021-02-04 03:56:20 +00:00
doCheck = true;
checkPhase = ''
runHook preCheck
${babashka}/bin/bb integration-test/run-all.clj ./clojure-lsp
runHook postCheck
'';
meta = with lib; {
description = "Language Server Protocol (LSP) for Clojure";
homepage = "https://github.com/clojure-lsp/clojure-lsp";
license = licenses.mit;
maintainers = [ maintainers.ericdallo ];
platforms = graalvm11-ce.meta.platforms;
};
}