about summary refs log tree commit diff
path: root/pkgs/applications/editors/emacs/elisp-packages
diff options
context:
space:
mode:
authorLin Jian <me@linj.tech>2023-09-04 01:16:20 +0800
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-09-06 16:27:13 +0000
commitac4f5079f7e668afa312458d621dad7fc0320f9b (patch)
tree3b7326b355507082c31339c0d5faac7cc5e803e4 /pkgs/applications/editors/emacs/elisp-packages
parent2081e7e07de42d7e991d863ab8ec72ce3718ae12 (diff)
downloadnixlib-ac4f5079f7e668afa312458d621dad7fc0320f9b.tar
nixlib-ac4f5079f7e668afa312458d621dad7fc0320f9b.tar.gz
nixlib-ac4f5079f7e668afa312458d621dad7fc0320f9b.tar.bz2
nixlib-ac4f5079f7e668afa312458d621dad7fc0320f9b.tar.lz
nixlib-ac4f5079f7e668afa312458d621dad7fc0320f9b.tar.xz
nixlib-ac4f5079f7e668afa312458d621dad7fc0320f9b.tar.zst
nixlib-ac4f5079f7e668afa312458d621dad7fc0320f9b.zip
emacsPackages.mu4e: init at 1.10.7
This patch packages mu4e as an Emacs lisp package based on the mu4e
output of the multiple-output package mu, which makes mu4e a good
citizen of Emacs lisp packages in two aspects.

First, mu4e now utilizes the Emacs lisp package infrastructure in
Nixpkgs.  This allows users who want to do AOT native compilation for
non-default Emacs variants[0] to build only mu4e itself instead of the
whole mu package[1].

Second, mu4e now conforms to the Emacs builtin package manager[2].
Without this patch, mu4e autoloaded commands do not work
out-of-the-box[3] because its directory is added to load-path by
site-start.el after the initialization of package-directory-list,
which causes package-activate-all to not load mu4e-autoloads.el.  This
patch fixes this issue when mu4e is installed to Emacs using the
withPackages wrapper[4].

[0]: such as emacs-pgtk
[1]: mu.override { emacs = emacs-pgtk; }
[2]: package.el
[3]: either (require 'mu4e) or (require 'mu4e-autoloads) is needed to
be called before an autoloaded command is called
[4]: emacs-pgtk.pkgs.withPackages (epkgs: [ epkgs.mu4e ])
Diffstat (limited to 'pkgs/applications/editors/emacs/elisp-packages')
-rw-r--r--pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix2
-rw-r--r--pkgs/applications/editors/emacs/elisp-packages/manual-packages/mu4e/default.nix33
2 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix
index 5bb88c835610..0f28ed8f8f02 100644
--- a/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix
+++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages.nix
@@ -61,6 +61,8 @@ in
     _map = self.map;
   };
 
+  mu4e = callPackage ./manual-packages/mu4e { };
+
   ott-mode = callPackage ./manual-packages/ott-mode { };
 
   perl-completion = callPackage ./manual-packages/perl-completion { };
diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/mu4e/default.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/mu4e/default.nix
new file mode 100644
index 000000000000..81fd973ecbd9
--- /dev/null
+++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/mu4e/default.nix
@@ -0,0 +1,33 @@
+{ elpaBuild, mu }:
+
+let
+  pname = "mu4e";
+  version = mu.mu4e.version;
+in
+elpaBuild {
+  inherit pname version;
+
+  src = mu.mu4e;
+
+  propagatedUserEnvPkgs = [ mu ];
+
+  dontUnpack = false;
+
+  # prepare a multi-file package tar archive according to info
+  # "(elisp) Multi-file Packages" for elpaBuild to install
+  postUnpack = ''
+    pushd mu-*-mu4e
+    local content_directory=${pname}-${version}
+    mkdir $content_directory
+    cp --verbose share/emacs/site-lisp/mu4e/*.el $content_directory/
+    rm --verbose --force $content_directory/mu4e-autoloads.el
+    cp --verbose share/info/* $content_directory/
+    src=$PWD/$content_directory.tar
+    tar --create --verbose --file=$src $content_directory
+    popd
+  '';
+
+  meta = mu.meta // {
+    description = "A full-featured e-mail client";
+  };
+}