clojure-lsp: use buildGraalvmNativeImage
This commit is contained in:
parent
052fb6a228
commit
7c632551c1
1 changed files with 9 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ lib, stdenv, buildGraalvmNativeImage, graalvm11-ce, babashka, fetchurl, fetchFromGitHub, clojure, writeScript }:
|
{ lib, stdenv, buildGraalvmNativeImage, babashka, fetchurl, fetchFromGitHub, clojure, writeScript }:
|
||||||
|
|
||||||
buildGraalvmNativeImage rec {
|
buildGraalvmNativeImage rec {
|
||||||
pname = "clojure-lsp";
|
pname = "clojure-lsp";
|
||||||
|
@ -16,26 +16,25 @@ buildGraalvmNativeImage rec {
|
||||||
sha256 = "sha256-k0mzibcLAspklCPE6f2qsUm9bwSvcJRgWecMBq7mpF0=";
|
sha256 = "sha256-k0mzibcLAspklCPE6f2qsUm9bwSvcJRgWecMBq7mpF0=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
executable = "clojure-lsp";
|
||||||
|
|
||||||
|
# https://github.com/clojure-lsp/clojure-lsp/blob/2021.11.02-15.24.47/graalvm/native-unix-compile.sh#L18-L27
|
||||||
|
DTLV_LIB_EXTRACT_DIR = "/tmp";
|
||||||
|
|
||||||
extraNativeImageBuildArgs = [
|
extraNativeImageBuildArgs = [
|
||||||
"-H:CLibraryPath=$DTLV_LIB_EXTRACT_DIR"
|
"-H:CLibraryPath=${DTLV_LIB_EXTRACT_DIR}"
|
||||||
"--verbose"
|
"--verbose"
|
||||||
"--no-fallback"
|
"--no-fallback"
|
||||||
"--native-image-info"
|
"--native-image-info"
|
||||||
];
|
];
|
||||||
|
|
||||||
preBuild = ''
|
|
||||||
# https://github.com/clojure-lsp/clojure-lsp/blob/2021.11.02-15.24.47/graalvm/native-unix-compile.sh#L18-L27
|
|
||||||
DTLV_LIB_EXTRACT_DIR=$(mktemp -d)
|
|
||||||
export DTLV_LIB_EXTRACT_DIR=$DTLV_LIB_EXTRACT_DIR
|
|
||||||
'';
|
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
runHook preCheck
|
runHook preCheck
|
||||||
|
|
||||||
export HOME="$(mktemp -d)"
|
export HOME="$(mktemp -d)"
|
||||||
./clojure-lsp --version | fgrep -q '${version}'
|
./${executable} --version | fgrep -q '${version}'
|
||||||
${babashka}/bin/bb integration-test ./clojure-lsp
|
${babashka}/bin/bb integration-test ./${executable}
|
||||||
|
|
||||||
runHook postCheck
|
runHook postCheck
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue