summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/editors/emacs
diff options
context:
space:
mode:
authorAndreas Fuchs <asf@boinkor.net>2020-08-26 20:37:35 -0400
committerAndreas Fuchs <asf@boinkor.net>2020-08-29 23:10:38 -0400
commita891ae41b36604e20c9ec130940728d673f5ad30 (patch)
treeb4b45d93241f5846cf1d48dea99bb046e69e6126 /pkgs/applications/editors/emacs
parent861f27018d9d6d131f4a717776e81dcebc38b9f8 (diff)
emacs: Set native-comp library path as linker flags instead
Since Darwin's linker does not understand LIBRARY_PATH, we have to set the library path as explicit linker flags: This requires a very recent feature/native-comp emacs revision, but it runs on Darwin and correctly compiles files at runtime.
Diffstat (limited to 'pkgs/applications/editors/emacs')
-rw-r--r--pkgs/applications/editors/emacs/generic.nix18
1 files changed, 9 insertions, 9 deletions
diff --git a/pkgs/applications/editors/emacs/generic.nix b/pkgs/applications/editors/emacs/generic.nix
index 8e2c34988b9b..dcbefb884317 100644
--- a/pkgs/applications/editors/emacs/generic.nix
+++ b/pkgs/applications/editors/emacs/generic.nix
@@ -67,18 +67,18 @@ in stdenv.mkDerivation {
# Make native compilation work both inside and outside of nix build
(lib.optionalString nativeComp (let
- libPath = lib.concatStringsSep ":" [
- "${lib.getLib libgccjit}/lib/gcc/${targetPlatform.config}/${libgccjit.version}"
- "${lib.getLib stdenv.cc.cc}/lib"
- "${lib.getLib stdenv.libc}/lib"
- ];
+ libPath = (lib.concatStringsSep " "
+ (builtins.map (x: ''\"-L${x}\"'') [
+ "${lib.getLib libgccjit}/lib"
+ "${lib.getLib libgccjit}/lib/gcc/${targetPlatform.config}/${libgccjit.version}"
+ "${lib.getLib stdenv.cc.cc}/lib"
+ "${lib.getLib stdenv.libc}/lib"
+ ]));
in ''
substituteInPlace lisp/emacs-lisp/comp.el --replace \
- "(defcustom comp-async-env-modifier-form nil" \
- "(defcustom comp-async-env-modifier-form '((setenv \"LIBRARY_PATH\" (string-join (seq-filter (lambda (v) (null (eq v nil))) (list (getenv \"LIBRARY_PATH\") \"${libPath}\")) \":\")))"
-
+ "(defcustom comp-native-driver-options nil" \
+ "(defcustom comp-native-driver-options '(${libPath})"
''))
-
""
];