unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Xinglu Chen <public@yoctocell.xyz>
To: Andrew Tropin <andrew@trop.in>, 50077@debbugs.gnu.org
Subject: [bug#50077] [PATCH v2 3/3] gnu: Add emacs-notmuch.
Date: Tue, 14 Sep 2021 17:29:53 +0200	[thread overview]
Message-ID: <87lf3ztbta.fsf@yoctocell.xyz> (raw)
In-Reply-To: <878rzzmxir.fsf@trop.in>

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

On Tue, Sep 14 2021, Andrew Tropin wrote:

> On 2021-09-04 11:42, Xinglu Chen wrote:
>
>> * gnu/packages/mail.scm (notmuch)[arguments]: Remove Emacs-related stuff.
>> * gnu/packages/emacs-xyz.scm (emacs-consult-notmuch)[propagated-inputs]: Add
>> ‘emacs-notmuch’.
>> (emacs-counsel-notmuch)[propagated-inputs]: Use ‘emacs-notmuch’ instead of
>> ‘notmuch’.
>> (emacs-helm-notmuch): Likewise.
>> (emacs-notmuch-maildir): Likewise.
>> ---
>>  gnu/packages/emacs-xyz.scm |  8 +++---
>>  gnu/packages/mail.scm      | 52 +++++++++++++++++++++++---------------
>>  2 files changed, 37 insertions(+), 23 deletions(-)
>>
>> diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
>> index 030809f5ac..67ba8bf523 100644
>> --- a/gnu/packages/emacs-xyz.scm
>> +++ b/gnu/packages/emacs-xyz.scm
>> @@ -8304,7 +8304,7 @@ list of candidates.")
>>      (build-system emacs-build-system)
>>      (propagated-inputs
>>       `(("emacs-consult" ,emacs-consult)
>> -       ("notmuch" ,notmuch)))
>> +       ("emacs-notmuch" ,emacs-notmuch)))
>>      (home-page "https://codeberg.org/jao/consult-notmuch")
>>      (synopsis "Search and preview Notmuch emails using Consult")
>>      (description
>> @@ -9490,6 +9490,8 @@ queries using counsel.")
>>         `(("emacs-counsel" ,emacs-counsel)
>>           ("notmuch" ,notmuch)
>>           ("emacs-s" ,emacs-s)))
>> +      (propagated-inputs
>> +       `(("emacs-notmuch" ,emacs-notmuch)))
>>        (home-page "https://github.com/fuxialexander/counsel-notmuch")
>>        (synopsis "Search emails in Notmuch asynchronously with Ivy")
>>        (description
>> @@ -23952,7 +23954,7 @@ workspaces with a LSP-compliant server running.")
>>      (build-system emacs-build-system)
>>      (propagated-inputs
>>       `(("emacs-helm" ,emacs-helm)
>> -       ("notmuch" ,notmuch)))
>> +       ("emacs-notmuch" ,emacs-notmuch)))
>>      (synopsis "Search emails with Emacs Notmuch and Helm")
>>      (description
>>       "This package can be used to search emails in Emacs, searching result
>> @@ -23975,7 +23977,7 @@ real search.")
>>                  "0pmikf1djkr07067nkgmdcxyn7l7ibswx6qlnai8v1v51f9h1g9q"))))
>>      (build-system emacs-build-system)
>>      (propagated-inputs
>> -     `(("notmuch" ,notmuch)))
>> +     `(("emacs-notmuch" ,emacs-notmuch)))
>>      (home-page "https://git.sr.ht/~tarsius/notmuch-maildir")
>>      (synopsis "Visualize maildirs as a tree")
>>      (description
>> diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
>> index 173982cb12..729e47cb95 100644
>> --- a/gnu/packages/mail.scm
>> +++ b/gnu/packages/mail.scm
>> @@ -167,6 +167,7 @@
>>    #:use-module (guix build-system gnu)
>>    #:use-module (guix build-system go)
>>    #:use-module (guix build-system guile)
>> +  #:use-module (guix build-system emacs)
>>    #:use-module (guix build-system meson)
>>    #:use-module (guix build-system perl)
>>    #:use-module (guix build-system python)
>> @@ -1342,31 +1343,18 @@ invoking @command{notifymuch} from the post-new hook.")
>>                  "1myylb19hj5nb1vriqng252vfjwwkgbi3gxj93pi2q1fzyw7w2lf"))))
>>      (build-system gnu-build-system)
>>      (arguments
>> -     `(#: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
>> +     `(#:make-flags
>>         (list "V=1"                      ; verbose test output
>>               "NOTMUCH_TEST_TIMEOUT=1h") ; don't fail on slow machines
>>         #:phases (modify-phases %standard-phases
>> -                  (add-after 'unpack 'patch-notmuch-lib.el
>> -                    (lambda _
>> -                      (substitute* "emacs/notmuch-lib.el"
>> -                        (("/bin/sh") (which "sh")))))
>>                    (replace 'configure
>>                      (lambda* (#:key outputs #:allow-other-keys)
>>                        (setenv "CC" ,(cc-for-target))
>>                        (setenv "CONFIG_SHELL" (which "sh"))
>> -
>> -                      (let* ((out (assoc-ref outputs "out"))
>> -                             (elisp (emacs:elpa-directory out)))
>> +                      (let* ((out (assoc-ref outputs "out")))
>>                          (invoke "./configure"
>>                                  (string-append "--prefix=" out)
>> -                                (string-append "--emacslispdir=" elisp)
>> -                                (string-append "--emacsetcdir=" elisp)))))
>> +                                "--without-emacs"))))
>>                    (add-before 'check 'disable-failing-tests
>>                      ;; FIXME: Investigate why these tests are failing,
>>                      ;; and try removing this for notmuch versions > 0.31.
>> @@ -1378,12 +1366,9 @@ invoking @command{notifymuch} from the post-new hook.")
>>                        (setenv "TEST_CC" ,(cc-for-target))
>>                        ;; Patch various inline shell invocations.
>>                        (substitute* (find-files "test" "\\.sh$")
>> -                        (("/bin/sh") (which "sh")))))
>> -                  (add-after 'install 'make-autoloads
>> -                    (assoc-ref emacs:%standard-phases 'make-autoloads)))))
>> +                        (("/bin/sh") (which "sh"))))))))
>>      (native-inputs
>>       `(("bash-completion" ,bash-completion)
>> -       ("emacs" ,emacs-no-x)    ; -minimal lacks libxml, needed for some tests
>>         ("pkg-config" ,pkg-config)
>>         ("python" ,python)
>>         ("python-docutils" ,python-docutils)
>> @@ -1391,6 +1376,7 @@ invoking @command{notifymuch} from the post-new hook.")
>>         ("texinfo" ,texinfo)
>>  
>>         ;; The following are required for tests only.
>> +       ("emacs" ,emacs-no-x)    ; -minimal lacks libxml, needed for some tests
>>         ("which" ,which)
>>         ("dtach" ,dtach)
>>         ("gnupg" ,gnupg)
>> @@ -1409,6 +1395,32 @@ invoking @command{notifymuch} from the post-new hook.")
>>  ing, and tagging large collections of email messages.")
>>      (license license:gpl3+)))
>>  
>> +(define-public emacs-notmuch
>> +  (package
>> +    (inherit notmuch)
>> +    (name "emacs-notmuch")
>> +    (build-system emacs-build-system)
>> +    (native-inputs '())
>> +    (inputs
>> +     `(("notmuch" ,notmuch)))
>> +    (arguments
>> +     `(#:exclude (cons* "make-deps.el" "rstdoc.el" %default-exclude)
>> +       #:phases
>> +       (modify-phases %standard-phases
>> +         (add-after 'unpack 'chdir
>> +           (lambda _
>> +             (chdir "emacs")))
>> +         (add-after 'chdir 'patch-paths
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             (let ((notmuch (assoc-ref inputs "notmuch")))
>> +               (substitute* "notmuch-lib.el"
>> +                 (("\"notmuch\"")
>> +                  (string-append "\"" notmuch "/bin/notmuch\"")))))))))
>
> Not sure if we need to hardcode the path to notmuch binary (some people
> can use guix for managing emacs packages, but not system), but I think
> it's a rare case and this default is reasonable and easily fixable by
> simple `(setq notmuch-command "notmuch")` in the cases, when notmuch
> itslef provided by other package manager.

Yeah, this default should work for most people, and as you said, people
who haven’t installed Notmuch via Guix can just set to the
‘notmuch-command’ to the appropriate value.  It’s Emacs after all... ;-)

Also, since there was a consensus that Emacs packages that were included
in “regular” packages should be packaged as separate ‘emacs-’ packages,
I think it would be a good idea to add a paragraph about that in the
manual.

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

  reply	other threads:[~2021-09-14 16:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 14:10 [bug#50077] [PATCH 0/3] Various improvements to Notmuch Xinglu Chen
2021-08-16 14:12 ` [bug#50077] [PATCH 1/3] gnu: notmuch: Add separate 'emacs' output Xinglu Chen
     [not found]   ` <87o89owoi0.fsf@trop.in>
2021-08-28 10:34     ` Xinglu Chen
2021-08-30  7:14       ` Andrew Tropin
2021-08-30 13:33         ` [bug#50077] Separate ‘emacs’ output vs separate ‘emacs-’ package (was Re: [bug#50077] [PATCH 1/3] gnu: notmuch: Add separate 'emacs' output.) Xinglu Chen
2021-09-01  9:50           ` Andrew Tropin
     [not found]             ` <874kb4lcvf.fsf@yoctocell.xyz>
     [not found]               ` <456243eca955ecc83b26663ed4e7e22d5170f03d.camel@student.tugraz.at>
     [not found]                 ` <87sfynq2xm.fsf@zancanaro.id.au>
2021-09-03 16:14                   ` Xinglu Chen
2021-08-16 14:12 ` [bug#50077] [PATCH 2/3] gnu: notmuch: Build Info manual Xinglu Chen
2021-08-16 14:12 ` [bug#50077] [PATCH 3/3] gnu: notmuch: Use 'cc-for-target' instead of hardcoding 'gcc' Xinglu Chen
2021-09-04  9:41 ` [bug#50077] [PATCH v2 0/3] Improvements to Notmuch Xinglu Chen
2021-09-04  9:41   ` [bug#50077] [PATCH v2 1/3] gnu: notmuch: Build Texinfo manual Xinglu Chen
2021-09-04  9:41   ` [bug#50077] [PATCH v2 2/3] gnu: notmuch: Make cross-compilable Xinglu Chen
2021-09-04  9:42   ` [bug#50077] [PATCH v2 3/3] gnu: Add emacs-notmuch Xinglu Chen
2021-09-14  7:22     ` Andrew Tropin
2021-09-14 15:29       ` Xinglu Chen [this message]
2021-09-14 15:35         ` zimoun
2021-09-14 19:20           ` Xinglu Chen
2021-09-14  7:05   ` bug#50077: [PATCH v2 0/3] Improvements to Notmuch Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lf3ztbta.fsf@yoctocell.xyz \
    --to=public@yoctocell.xyz \
    --cc=50077@debbugs.gnu.org \
    --cc=andrew@trop.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).