summary refs log tree commit diff
path: root/gnu/packages/mail.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/mail.scm')
-rw-r--r--gnu/packages/mail.scm30
1 files changed, 17 insertions, 13 deletions
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 12a780ca99..f3a0e764bf 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1170,17 +1170,17 @@ repository and Maildir/IMAP as LOCAL repository.")
            "0xazygwdc328m5l31rxjazq9giv2xrygp2p2q455lf3jhdxwq1km"))))
       (build-system gnu-build-system)
       (arguments
-       (let ((elisp-dir #~(string-append #$output "/share/emacs/site-lisp"))
-             (icon-dir  #~(string-append #$output "/share/mew")))
+       (let ((icon-dir  #~(string-append #$output "/share/mew")))
          (list
           #:modules '((guix build gnu-build-system)
                       (guix build utils)
+                      ((guix build emacs-build-system) #:prefix emacs:)
                       (guix build emacs-utils))
-          #:imported-modules `(,@%gnu-build-system-modules
-                               (guix build emacs-utils))
+          #:imported-modules %emacs-build-system-modules
           #:tests? #f
           #:configure-flags
-          #~(list (string-append "--with-elispdir=" #$elisp-dir)
+          #~(list (string-append "--with-elispdir="
+                                 (emacs:elpa-directory #$output))
                   (string-append "--with-etcdir=" #$icon-dir))
           #:phases
           #~(modify-phases %standard-phases
@@ -1191,9 +1191,15 @@ repository and Maildir/IMAP as LOCAL repository.")
                      `(progn
                        (add-to-list 'image-load-path 'mew-icon-directory)
                        ,#$icon-dir)))))
-              (add-after 'install 'generate-autoloads
+              (add-after 'unpack 'generate-autoloads
                 (lambda _
-                  (emacs-generate-autoloads "mew" #$elisp-dir)))))))
+                  (emacs-generate-autoloads "mew" "elisp")
+                  (substitute* "elisp/mew-autoloads.el"
+                    ((";; no-byte-compile.*") ""))
+                  ;; Add generated autoloads to Makefile, so they get compiled
+                  (substitute* "elisp/Makefile"
+                    (("OBJS =") "OBJS = mew-autoloads.elc")
+                    (("SRCS =") "SRCS = mew-autoloads.el"))))))))
       (native-inputs
        (list emacs))
       (propagated-inputs
@@ -4783,14 +4789,12 @@ ex-like commands on it.")
                (for-each (lambda (file)
                            (install-file file (string-append out "/bin")))
                          (list "mailfilter.crm" "mailreaver.crm" "mailtrainer.crm")))))
-         (add-after 'install 'install-emacs-mode
-           (assoc-ref emacs:%standard-phases 'install))
          ;; Run phases from the emacs build system.
-         (add-after 'install-emacs-mode 'make-autoloads
+         (add-after 'unpack 'make-autoloads
            (assoc-ref emacs:%standard-phases 'make-autoloads))
-         (add-after 'make-autoloads 'enable-autoloads-compilation
-           (assoc-ref emacs:%standard-phases 'enable-autoloads-compilation))
-         (add-after 'enable-autoloads-compilation 'emacs-build
+         (add-after 'install 'install-emacs-mode
+           (assoc-ref emacs:%standard-phases 'install))
+         (add-after 'install-emacs-mode 'emacs-build
            (assoc-ref emacs:%standard-phases 'build))
          (add-after 'emacs-build 'validate-compiled-autoloads
            (assoc-ref emacs:%standard-phases 'validate-compiled-autoloads)))))