From 51bd7cf0d05f996c74b8fabebc755a2fe253b50e Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Wed, 8 Jun 2022 02:41:06 +0800 Subject: [PATCH] emacs: enable native-comp --- .../from_md/release-notes/rl-2211.section.xml | 28 +++++++++++++++++++ .../manual/release-notes/rl-2211.section.md | 4 +++ pkgs/applications/editors/emacs/generic.nix | 2 +- pkgs/top-level/aliases.nix | 2 ++ pkgs/top-level/all-packages.nix | 5 ---- 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml index 2e3dfea8cb6..ce161fca5b4 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml @@ -70,6 +70,34 @@ with any supported NixOS release. + + + emacs enables native compilation which + means: + + + + + emacs packages from nixpkgs, builtin or not, will do + native compilation ahead of time so you can enjoy the + benefit of native compilation without compiling them on + you machine; + + + + + emacs packages from somewhere else, e.g. + package-install, will do asynchronously + deferred native compilation. If you do not want this, + maybe to avoid CPU consumption for compilation, you can + use + (setq native-comp-deferred-compilation nil) + to disable it while still enjoy the benefit of native + compilation for packages from nixpkgs. + + + + nixos-generate-config now generates diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md index 6bc7d1917ca..eea3eef2640 100644 --- a/nixos/doc/manual/release-notes/rl-2211.section.md +++ b/nixos/doc/manual/release-notes/rl-2211.section.md @@ -35,6 +35,10 @@ In addition to numerous new and upgraded packages, this release has the followin for a transition period so that in time the ecosystem can switch without breaking compatibility with any supported NixOS release. +- `emacs` enables native compilation which means: + - emacs packages from nixpkgs, builtin or not, will do native compilation ahead of time so you can enjoy the benefit of native compilation without compiling them on you machine; + - emacs packages from somewhere else, e.g. `package-install`, will do asynchronously deferred native compilation. If you do not want this, maybe to avoid CPU consumption for compilation, you can use `(setq native-comp-deferred-compilation nil)` to disable it while still enjoy the benefit of native compilation for packages from nixpkgs. + - `nixos-generate-config` now generates configurations that can be built in pure mode. This is achieved by setting the new `nixpkgs.hostPlatform` option. diff --git a/pkgs/applications/editors/emacs/generic.nix b/pkgs/applications/editors/emacs/generic.nix index b1c8a8d6cc9..1f49c3c23af 100644 --- a/pkgs/applications/editors/emacs/generic.nix +++ b/pkgs/applications/editors/emacs/generic.nix @@ -26,7 +26,7 @@ , withWebP ? false , srcRepo ? true, autoreconfHook ? null, texinfo ? null , siteStart ? ./site-start.el -, nativeComp ? false +, nativeComp ? true , withAthena ? false , withToolkitScrollBars ? true , withPgtk ? false diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index c19acf8ce4e..d41a60a697f 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -380,8 +380,10 @@ mapAliases ({ electrum-dash = throw "electrum-dash has been removed from nixpkgs as the project is abandoned"; # Added 2022-01-01 # Emacs + emacs28NativeComp = emacs28; # Added 2022-06-08 emacs28Packages = emacs28.pkgs; # Added 2021-10-04 emacs28WithPackages = emacs28.pkgs.withPackages; # Added 2021-10-04 + emacsNativeComp = emacs28NativeComp; # Added 2022-06-08 emacsPackages = emacs.pkgs; # Added 2020-12-18 emacsPackagesGen = throw "'emacsPackagesGen' has been renamed to/replaced by 'emacsPackagesFor'"; # Converted to throw 2022-02-22 emacsPackagesNg = emacs.pkgs; # Added 2019-08-07 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2e6a1a37376..b9fd05408f7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26720,7 +26720,6 @@ with pkgs; em = callPackage ../applications/editors/em { }; emacs = emacs28; - emacsNativeComp = emacs28NativeComp; emacs-nox = emacs28-nox; emacs28 = callPackage ../applications/editors/emacs/28.nix { @@ -26735,10 +26734,6 @@ with pkgs; inherit (darwin) sigtool; }; - emacs28NativeComp = emacs28.override { - nativeComp = true; - }; - emacs28-nox = lowPrio (emacs28.override { withX = false; withNS = false;