From 2ce014a48bf6845b9bbeca6eabbff9ba5783c30d Mon Sep 17 00:00:00 2001 From: Brian Leung Date: Sat, 3 Dec 2022 10:57:51 -0800 Subject: Revert "Remove unnecessary substituteInPlace" This reverts commit 336402eba8c78f6f36fa995549add0b834be994c. --- overlays/emacs.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'overlays') diff --git a/overlays/emacs.nix b/overlays/emacs.nix index 16ea55dbd7d2..7731175a8bc7 100644 --- a/overlays/emacs.nix +++ b/overlays/emacs.nix @@ -31,7 +31,27 @@ let substituteInPlace lisp/loadup.el \ --replace '(emacs-repository-get-version)' '"${repoMeta.rev}"' \ --replace '(emacs-repository-get-branch)' '"master"' - ''; + '' + + # XXX: remove when https://github.com/NixOS/nixpkgs/pull/193621 is merged + (super.lib.optionalString (old ? NATIVE_FULL_AOT) + (let backendPath = (super.lib.concatStringsSep " " + (builtins.map (x: ''\"-B${x}\"'') [ + # Paths necessary so the JIT compiler finds its libraries: + "${super.lib.getLib self.libgccjit}/lib" + "${super.lib.getLib self.libgccjit}/lib/gcc" + "${super.lib.getLib self.stdenv.cc.libc}/lib" + + # Executable paths necessary for compilation (ld, as): + "${super.lib.getBin self.stdenv.cc.cc}/bin" + "${super.lib.getBin self.stdenv.cc.bintools}/bin" + "${super.lib.getBin self.stdenv.cc.bintools.bintools}/bin" + ])); + in '' + substituteInPlace lisp/emacs-lisp/comp.el --replace \ + "(defcustom comp-libgccjit-reproducer nil" \ + "(setq native-comp-driver-options '(${backendPath})) +(defcustom comp-libgccjit-reproducer nil" + '')); } ) ) -- cgit 1.4.1