diff options
| author | Thiago Kenji Okada <thiagokokada@gmail.com> | 2022-01-06 19:47:44 -0300 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2022-01-10 02:32:14 +0000 |
| commit | e74848c095dbadfbab07778f87cb8b23879c3b3e (patch) | |
| tree | f18f6467cd1ec01b869b4de587e0f9c3d04dbd35 | |
| parent | Merge pull request #154210 from NixOS/backport-154016-to-release-21.11 (diff) | |
| download | nixpkgs-e74848c095dbadfbab07778f87cb8b23879c3b3e.tar.gz | |
clojure-lsp: fix build on macOS
Instead of setting the environment variable using Nix, use `preBuild`
hook to inject the value `DTLV_LIB_EXTRACT_DIR` on directly to
`nativeImageBuildArgs`. This will allow us to use a dynamically value
generated with `mktemp -d`.
Fix issue #153765.
(cherry picked from commit e1c79ccfe4076fe4ac8d61aaf87565c7582bfd2e)
| -rw-r--r-- | pkgs/development/tools/misc/clojure-lsp/default.nix | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/development/tools/misc/clojure-lsp/default.nix b/pkgs/development/tools/misc/clojure-lsp/default.nix index 5e3c750852df..2e11ad9f8add 100644 --- a/pkgs/development/tools/misc/clojure-lsp/default.nix +++ b/pkgs/development/tools/misc/clojure-lsp/default.nix @@ -17,10 +17,14 @@ buildGraalvmNativeImage rec { }; # 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"; + # Needs to be inject on `nativeImageBuildArgs` inside shell environment, + # otherwise we can't expand to the value set in `mktemp -d` call + preBuild = '' + export DTLV_LIB_EXTRACT_DIR="$(mktemp -d)" + nativeImageBuildArgs+=("-H:CLibraryPath=$DTLV_LIB_EXTRACT_DIR") + ''; extraNativeImageBuildArgs = [ - "-H:CLibraryPath=${DTLV_LIB_EXTRACT_DIR}" "--no-fallback" "--native-image-info" ]; |
