mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-26 10:30:32 +00:00
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.
This commit is contained in:
@@ -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"
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user