unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#29660] [PATCH] gnu: notmuch: Move elisp directory and generate autoloads.
@ 2017-12-11 14:24 Arun Isaac
  2017-12-12 16:11 ` Marius Bakke
  0 siblings, 1 reply; 5+ messages in thread
From: Arun Isaac @ 2017-12-11 14:24 UTC (permalink / raw)
  To: 29660

* gnu/packages/mail.scm (notmuch)[arguments]: Move elisp files to
share/emacs/site-lisp/guix.d/notmuch-<version>.
Add make-autoloads phase.
---
 gnu/packages/mail.scm | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 21db46341..198be11ba 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -703,7 +703,13 @@ invoking @command{notifymuch} from the post-new hook.")
                 "1fyx20rjpwbf2j1v5fpa5s0rjnwhcgvijzh2qyinp8rlbh1qxmab"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:make-flags (list "V=1") ; Verbose test output.
+     `(#:modules ((guix build gnu-build-system)
+                  ((guix build emacs-build-system) #:prefix emacs:)
+                  (guix build utils))
+       #:imported-modules (,@%gnu-build-system-modules
+                           (guix build emacs-build-system)
+                           (guix build emacs-utils))
+       #:make-flags (list "V=1") ; Verbose test output.
        #:phases (modify-phases %standard-phases
                   (add-after 'unpack 'patch-notmuch-lib.el
                     (lambda _
@@ -715,16 +721,25 @@ invoking @command{notifymuch} from the post-new hook.")
                       (setenv "CC" "gcc")
                       (setenv "CONFIG_SHELL" (which "sh"))
 
-                      (let ((out (assoc-ref outputs "out")))
-                        (zero? (system* "./configure"
-                                        (string-append "--prefix=" out))))))
+                      (let* ((out (assoc-ref outputs "out"))
+                             (elisp
+                              (string-append out "/share/emacs/site-lisp/guix.d/"
+                                             ,name "-" ,version)))
+                        (zero?
+                         (system*
+                          "./configure"
+                          (string-append "--prefix=" out)
+                          (string-append "--emacslispdir=" elisp)
+                          (string-append "--emacsetcdir=" elisp))))))
                   (add-before 'check 'prepare-test-environment
                     (lambda _
                       (setenv "TEST_CC" "gcc")
                       ;; Patch various inline shell invocations.
                       (substitute* (find-files "test" "\\.sh$")
                         (("/bin/sh") (which "sh")))
-                      #t)))))
+                      #t))
+                  (add-after 'install 'make-autoloads
+                    (assoc-ref emacs:%standard-phases 'make-autoloads)))))
     (native-inputs
      `(("bash-completion" ,bash-completion)
        ("emacs" ,emacs-no-x) ; Minimal lacks libxml, needed for some tests.
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#29660] [PATCH] gnu: notmuch: Move elisp directory and generate autoloads.
  2017-12-11 14:24 [bug#29660] [PATCH] gnu: notmuch: Move elisp directory and generate autoloads Arun Isaac
@ 2017-12-12 16:11 ` Marius Bakke
  2017-12-13  6:53   ` Arun Isaac
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Bakke @ 2017-12-12 16:11 UTC (permalink / raw)
  To: Arun Isaac, 29660

[-- Attachment #1: Type: text/plain, Size: 465 bytes --]

Arun Isaac <arunisaac@systemreboot.net> writes:

> * gnu/packages/mail.scm (notmuch)[arguments]: Move elisp files to
> share/emacs/site-lisp/guix.d/notmuch-<version>.
> Add make-autoloads phase.

I had to dive into emacs-build-system to understand what this patch
does.  AFAICT the purpose is to move the emacs files to a versioned
subdirectory instead of "polluting" site-lisp, and that's why the
make-autoloads phase is necessary?

I haven't tested it, but LGTM.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#29660] [PATCH] gnu: notmuch: Move elisp directory and generate autoloads.
  2017-12-12 16:11 ` Marius Bakke
@ 2017-12-13  6:53   ` Arun Isaac
  2017-12-13  7:16     ` Marius Bakke
  0 siblings, 1 reply; 5+ messages in thread
From: Arun Isaac @ 2017-12-13  6:53 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 29660

Marius Bakke <mbakke@fastmail.com> writes:

> Arun Isaac <arunisaac@systemreboot.net> writes:
>
>> * gnu/packages/mail.scm (notmuch)[arguments]: Move elisp files to
>> share/emacs/site-lisp/guix.d/notmuch-<version>.
>> Add make-autoloads phase.
>
> I had to dive into emacs-build-system to understand what this patch
> does.  AFAICT the purpose is to move the emacs files to a versioned
> subdirectory instead of "polluting" site-lisp

Yes, this is what the configure flags do. And, all other emacs packages
in Guix follow this convention. So, I thought it appropriate for notmuch
to do the same.

> and that's why the make-autoloads phase is necessary?

The make-autoloads phase generates autoloads for notmuch commands so
that the full elisp files are loaded only at the last moment when some
notmuch command is actually invoked. This reduces the emacs startup
time. Again, all emacs packages in Guix have autoloads.

> I haven't tested it, but LGTM.

Shall I push?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#29660] [PATCH] gnu: notmuch: Move elisp directory and generate autoloads.
  2017-12-13  6:53   ` Arun Isaac
@ 2017-12-13  7:16     ` Marius Bakke
  2017-12-13 18:40       ` bug#29660: " Arun Isaac
  0 siblings, 1 reply; 5+ messages in thread
From: Marius Bakke @ 2017-12-13  7:16 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 29660

[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]

Arun Isaac <arunisaac@systemreboot.net> writes:

> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Arun Isaac <arunisaac@systemreboot.net> writes:
>>
>>> * gnu/packages/mail.scm (notmuch)[arguments]: Move elisp files to
>>> share/emacs/site-lisp/guix.d/notmuch-<version>.
>>> Add make-autoloads phase.
>>
>> I had to dive into emacs-build-system to understand what this patch
>> does.  AFAICT the purpose is to move the emacs files to a versioned
>> subdirectory instead of "polluting" site-lisp
>
> Yes, this is what the configure flags do. And, all other emacs packages
> in Guix follow this convention. So, I thought it appropriate for notmuch
> to do the same.

Makes sense.

>> and that's why the make-autoloads phase is necessary?
>
> The make-autoloads phase generates autoloads for notmuch commands so
> that the full elisp files are loaded only at the last moment when some
> notmuch command is actually invoked. This reduces the emacs startup
> time. Again, all emacs packages in Guix have autoloads.

Neat.

>> I haven't tested it, but LGTM.
>
> Shall I push?

SGTM!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#29660: [PATCH] gnu: notmuch: Move elisp directory and generate autoloads.
  2017-12-13  7:16     ` Marius Bakke
@ 2017-12-13 18:40       ` Arun Isaac
  0 siblings, 0 replies; 5+ messages in thread
From: Arun Isaac @ 2017-12-13 18:40 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 29660-done


>> Shall I push?
>
> SGTM!

Pushed, thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-13 18:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-11 14:24 [bug#29660] [PATCH] gnu: notmuch: Move elisp directory and generate autoloads Arun Isaac
2017-12-12 16:11 ` Marius Bakke
2017-12-13  6:53   ` Arun Isaac
2017-12-13  7:16     ` Marius Bakke
2017-12-13 18:40       ` bug#29660: " Arun Isaac

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).