3 , buildGraalvmNativeImage
13 buildGraalvmNativeImage rec {
14 pname = "clojure-lsp";
15 version = "2023.08.06-00.28.06";
17 src = fetchFromGitHub {
21 sha256 = "sha256-wc7M2cPRtdaRzZn3GNu/aCbQ2VqxiDxvu/b7qnBVUBo=";
25 url = "https://github.com/clojure-lsp/clojure-lsp/releases/download/${version}/clojure-lsp-standalone.jar";
26 sha256 = "c301821ac6914999a44f5c1cd371d46b248fe9a2e31d43a666d0bc2656cfdd78";
29 extraNativeImageBuildArgs = [
38 export HOME="$(mktemp -d)"
39 ./${pname} --version | fgrep -q '${version}'
41 # TODO: fix classpath issue per https://github.com/NixOS/nixpkgs/pull/153770
42 #${babashka}/bin/bb integration-test ./${pname}
47 passthru.tests.version = testers.testVersion {
49 package = clojure-lsp;
50 command = "clojure-lsp --version";
53 passthru.updateScript = writeScript "update-clojure-lsp" ''
54 #!/usr/bin/env nix-shell
55 #!nix-shell -i bash -p curl common-updater-scripts gnused jq nix
59 latest_version=$(curl -s https://api.github.com/repos/clojure-lsp/clojure-lsp/releases/latest | jq --raw-output .tag_name)
61 old_jar_hash=$(nix-instantiate --eval --strict -A "clojure-lsp.jar.drvAttrs.outputHash" | tr -d '"' | sed -re 's|[+]|\\&|g')
63 curl -o clojure-lsp-standalone.jar -sL https://github.com/clojure-lsp/clojure-lsp/releases/download/$latest_version/clojure-lsp-standalone.jar
64 new_jar_hash=$(nix-hash --flat --type sha256 clojure-lsp-standalone.jar | sed -re 's|[+]|\\&|g')
66 rm -f clojure-lsp-standalone.jar
68 nixFile=$(nix-instantiate --eval --strict -A "clojure-lsp.meta.position" | sed -re 's/^"(.*):[0-9]+"$/\1/')
70 sed -i "$nixFile" -re "s|\"$old_jar_hash\"|\"$new_jar_hash\"|"
71 update-source-version clojure-lsp "$latest_version"
75 description = "Language Server Protocol (LSP) for Clojure";
76 homepage = "https://github.com/clojure-lsp/clojure-lsp";
77 sourceProvenance = with sourceTypes; [ binaryBytecode ];
78 license = licenses.mit;
79 maintainers = with maintainers; [ ericdallo babariviere ];