2021-02-04 03:06:28 +00:00
|
|
|
{ lib, stdenv, fetchurl, graalvm11-ce }:
|
2019-12-06 23:45:12 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "clojure-lsp";
|
2021-02-16 03:53:39 +00:00
|
|
|
version = "2021.02.14-19.46.47";
|
2019-12-06 23:45:12 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-01-03 01:53:15 +00:00
|
|
|
url = "https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/${pname}.jar";
|
2021-02-16 03:53:39 +00:00
|
|
|
sha256 = "sha256-fLwubRwWa1fu37bdkaCr2uZK79z37wqPLToOb5BlegY=";
|
2019-12-06 23:45:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2021-02-04 03:06:28 +00:00
|
|
|
buildInputs = [ graalvm11-ce ];
|
|
|
|
|
|
|
|
buildPhase = with lib; ''
|
|
|
|
args=("-jar" "${src}"
|
|
|
|
"-H:Name=clojure-lsp"
|
|
|
|
${optionalString stdenv.isDarwin ''"-H:-CheckToolchain"''}
|
|
|
|
"-J-Dclojure.compiler.direct-linking=true"
|
|
|
|
"-J-Dclojure.spec.skip-macros=true"
|
|
|
|
"-H:+ReportExceptionStackTraces"
|
|
|
|
"--enable-url-protocols=jar"
|
|
|
|
# "-H:+InlineBeforeAnalysis"
|
|
|
|
"-H:Log=registerResource:"
|
|
|
|
"--verbose"
|
|
|
|
"-H:IncludeResources=\"CLOJURE_LSP_VERSION|db/.*|static/.*|templates/.*|.*.yml|.*.xml|.*/org/sqlite/.*|org/sqlite/.*|.*.properties\""
|
|
|
|
"-H:ConfigurationFileDirectories=graalvm"
|
|
|
|
"--initialize-at-build-time"
|
|
|
|
"--report-unsupported-elements-at-runtime"
|
|
|
|
"--no-server"
|
|
|
|
"--no-fallback"
|
|
|
|
"--native-image-info"
|
|
|
|
"--allow-incomplete-classpath"
|
|
|
|
"-H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.AudioFileReader"
|
|
|
|
"-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.MidiFileReader"
|
|
|
|
"-H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.MixerProvider"
|
|
|
|
"-H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.FormatConversionProvider"
|
|
|
|
"-H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.AudioFileWriter"
|
|
|
|
"-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.MidiDeviceProvider"
|
|
|
|
"-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.SoundbankReader"
|
|
|
|
"-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.MidiFileWriter"
|
|
|
|
"-J-Xmx4g")
|
|
|
|
|
|
|
|
native-image "''${args[@]}"
|
|
|
|
'';
|
2020-12-28 15:59:15 +00:00
|
|
|
|
2019-12-06 23:45:12 +00:00
|
|
|
installPhase = ''
|
2021-02-04 03:06:28 +00:00
|
|
|
install -Dm755 clojure-lsp $out/bin/clojure-lsp
|
|
|
|
'';
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/clojure-lsp --version
|
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
|
|
|
};
|
|
|
|
}
|