From 7c632551c1f5e6430779f03e45ce0d0296e54442 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 23 Nov 2021 12:26:19 -0300 Subject: [PATCH] clojure-lsp: use buildGraalvmNativeImage --- .../tools/misc/clojure-lsp/default.nix | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/pkgs/development/tools/misc/clojure-lsp/default.nix b/pkgs/development/tools/misc/clojure-lsp/default.nix index 66166e469a80..c36f1695702d 100644 --- a/pkgs/development/tools/misc/clojure-lsp/default.nix +++ b/pkgs/development/tools/misc/clojure-lsp/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, buildGraalvmNativeImage, graalvm11-ce, babashka, fetchurl, fetchFromGitHub, clojure, writeScript }: +{ lib, stdenv, buildGraalvmNativeImage, babashka, fetchurl, fetchFromGitHub, clojure, writeScript }: buildGraalvmNativeImage rec { pname = "clojure-lsp"; @@ -16,26 +16,25 @@ buildGraalvmNativeImage rec { 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 = [ - "-H:CLibraryPath=$DTLV_LIB_EXTRACT_DIR" + "-H:CLibraryPath=${DTLV_LIB_EXTRACT_DIR}" "--verbose" "--no-fallback" "--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; checkPhase = '' runHook preCheck export HOME="$(mktemp -d)" - ./clojure-lsp --version | fgrep -q '${version}' - ${babashka}/bin/bb integration-test ./clojure-lsp + ./${executable} --version | fgrep -q '${version}' + ${babashka}/bin/bb integration-test ./${executable} runHook postCheck '';