2021-02-05 14:13:00 +00:00
|
|
|
{ lib, stdenv, callPackage, fetchFromGitHub, leiningen, openjdk11
|
|
|
|
, graalvm11-ce, babashka }:
|
2019-12-06 23:45:12 +00:00
|
|
|
|
2021-02-05 14:13:00 +00:00
|
|
|
let
|
2019-12-06 23:45:12 +00:00
|
|
|
pname = "clojure-lsp";
|
2021-02-16 03:53:39 +00:00
|
|
|
version = "2021.02.14-19.46.47";
|
2021-02-05 14:13:00 +00:00
|
|
|
leiningen11 = leiningen.override ({ jdk = openjdk11; });
|
2019-12-06 23:45:12 +00:00
|
|
|
|
2021-02-05 14:13:00 +00:00
|
|
|
src = fetchFromGitHub {
|
2021-02-04 03:56:20 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-02-05 14:13:00 +00:00
|
|
|
sha256 = "sha256-Zj7/8RcuxCy2xdd+5jeOb1GTsQsX0EVW32k32fA6uf4=";
|
|
|
|
};
|
|
|
|
|
|
|
|
repository = callPackage ./repository.nix {
|
|
|
|
inherit src pname version;
|
|
|
|
leiningen = leiningen11;
|
2021-02-04 03:56:20 +00:00
|
|
|
};
|
2021-02-05 14:13:00 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
inherit src pname version;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Hack to set maven cache in another directory since MAVEN_OPTS doesn't work
|
|
|
|
substituteInPlace project.clj \
|
|
|
|
--replace ":main" ":local-repo \"${repository}\" :main"
|
|
|
|
'';
|
2021-02-04 03:56:20 +00:00
|
|
|
|
2021-02-05 14:13:00 +00:00
|
|
|
GRAALVM_HOME = graalvm11-ce;
|
2019-12-06 23:45:12 +00:00
|
|
|
|
2021-02-05 14:13:00 +00:00
|
|
|
buildInputs = [ graalvm11-ce leiningen11 repository ];
|
2021-02-04 03:06:28 +00:00
|
|
|
|
|
|
|
buildPhase = with lib; ''
|
2021-02-05 14:13:00 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
export LEIN_HOME="$(mktemp -d)"
|
|
|
|
bash ./graalvm/native-unix-compile.sh
|
|
|
|
|
|
|
|
runHook postBuild
|
2021-02-04 03:06:28 +00:00
|
|
|
'';
|
2020-12-28 15:59:15 +00:00
|
|
|
|
2019-12-06 23:45:12 +00:00
|
|
|
installPhase = ''
|
2021-02-05 14:13:00 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 ./clojure-lsp $out/bin/clojure-lsp
|
|
|
|
|
|
|
|
runHook postInstall
|
2021-02-04 03:06:28 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-04 03:56:20 +00:00
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
2021-02-05 14:13:00 +00:00
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
${babashka}/bin/bb ./integration-test/run-all.clj ./clojure-lsp
|
|
|
|
|
|
|
|
runHook postCheck
|
2019-12-06 23:45:12 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2019-12-06 23:45:12 +00:00
|
|
|
description = "Language Server Protocol (LSP) for Clojure";
|
|
|
|
homepage = "https://github.com/snoe/clojure-lsp";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.ericdallo ];
|
2021-02-04 03:06:28 +00:00
|
|
|
platforms = graalvm11-ce.meta.platforms;
|
2019-12-06 23:45:12 +00:00
|
|
|
};
|
|
|
|
}
|