From 15ebd7cc3d7b3463c144d549ff5137259276d352 Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Tue, 4 Oct 2022 03:55:32 +0800 Subject: [PATCH] mu: enable AOT native-comp for emacs lisp --- pkgs/tools/networking/mu/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/tools/networking/mu/default.nix b/pkgs/tools/networking/mu/default.nix index 6a578b472398..9a4d47808a77 100644 --- a/pkgs/tools/networking/mu/default.nix +++ b/pkgs/tools/networking/mu/default.nix @@ -31,6 +31,17 @@ stdenv.mkDerivation rec { --replace "/bin/rm" "${coreutils}/bin/rm" ''; + # AOT native-comp, mostly copied from pkgs/build-support/emacs/generic.nix + postInstall = lib.optionalString (emacs.nativeComp or false) '' + mkdir -p $out/share/emacs/native-lisp + export EMACSLOADPATH=$out/share/emacs/site-lisp/mu4e: + export EMACSNATIVELOADPATH=$out/share/emacs/native-lisp: + + find $out/share/emacs -type f -name '*.el' -print0 \ + | xargs -0 -I {} -n 1 -P $NIX_BUILD_CORES sh -c \ + "emacs --batch --eval '(setq large-file-warning-threshold nil)' -f batch-native-compile {} || true" + ''; + buildInputs = [ emacs glib gmime3 texinfo xapian ]; mesonFlags = [