diff options
Diffstat (limited to 'pkgs/applications/editors/emacs/generic.nix')
-rw-r--r-- | pkgs/applications/editors/emacs/generic.nix | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/pkgs/applications/editors/emacs/generic.nix b/pkgs/applications/editors/emacs/generic.nix index a84cb41bf30f..101dbdaa2e94 100644 --- a/pkgs/applications/editors/emacs/generic.nix +++ b/pkgs/applications/editors/emacs/generic.nix @@ -42,7 +42,12 @@ assert withXwidgets -> withGTK3 && webkitgtk != null; let -in stdenv.mkDerivation { +in stdenv.mkDerivation (lib.optionalAttrs nativeComp { + NATIVE_FULL_AOT = "1"; + LIBRARY_PATH = "${lib.getLib stdenv.cc.libc}/lib"; +} // lib.optionalAttrs stdenv.isDarwin { + CFLAGS = "-DMAC_OS_X_VERSION_MAX_ALLOWED=101200"; +} // { inherit pname version patches; src = fetchurl { @@ -88,10 +93,6 @@ in stdenv.mkDerivation { "" ]; - CFLAGS = "-DMAC_OS_X_VERSION_MAX_ALLOWED=101200"; - - LIBRARY_PATH = if nativeComp then "${lib.getLib stdenv.cc.libc}/lib" else ""; - nativeBuildInputs = [ pkgconfig makeWrapper ] ++ lib.optionals srcRepo [ autoreconfHook texinfo ] ++ lib.optional (withX && (withGTK3 || withXwidgets)) wrapGAppsHook; @@ -155,6 +156,11 @@ in stdenv.mkDerivation { mv nextstep/Emacs.app $out/Applications '' + lib.optionalString (nativeComp && withNS) '' ln -snf $out/lib/emacs/*/native-lisp $out/Applications/Emacs.app/Contents/native-lisp + '' + lib.optionalString nativeComp '' + mkdir -p $out/share/emacs/native-lisp + $out/bin/emacs --batch \ + --eval "(add-to-list 'comp-eln-load-path \"$out/share/emacs/native-lisp\")" \ + -f batch-native-compile $out/share/emacs/site-lisp/site-start.el ''; postFixup = lib.concatStringsSep "\n" [ @@ -195,4 +201,4 @@ in stdenv.mkDerivation { separately. ''; }; -} +}) |