diff options
author | Andreas Fuchs <asf@boinkor.net> | 2020-08-26 20:37:35 -0400 |
---|---|---|
committer | Andreas Fuchs <asf@boinkor.net> | 2020-08-29 23:10:38 -0400 |
commit | a891ae41b36604e20c9ec130940728d673f5ad30 (patch) | |
tree | b4b45d93241f5846cf1d48dea99bb046e69e6126 /pkgs/applications/editors/emacs | |
parent | 861f27018d9d6d131f4a717776e81dcebc38b9f8 (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.nix | 18 |
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})" '')) - "" ]; |