Subject: [bug#58730] [PATCH] Split emacs-piem and emacs-git-email

From: Kyle Meyer <[email-masked]>
Date: Sat, 05 Nov 2022 01:22:01 -0400

zimoun writes:

> Kyle, are all the sub-packages of piem working independently?

-elfeed, -eww, -gnus, -notmuch, and -rmail are integration libraries
that, when their corresponding minor modes are enabled, wire themselves
up to piem.el hooks.  None of these libraries depend on each other, and
piem.el doesn't depend on any of them being present.

-lei is an integration library as well, though it's a bit more involved
because it provides an interface to public-inbox's lei (mostly just `lei
q' at the moment).  piem.el does bind a piem-lei command in
piem-dispatch, so that of course won't be found if piem-lei.el isn't
present, but otherwise things should be functional.

-b4 is a little different.  It implements b4 support of course, but it's
not an "integration library" like the ones referred to above.  b4 is the
main workhorse for applying patch series, regardless of whether that's
from Gnus or Notmuch or whatnot.  I know some people use piem.el without
b4, and I'm glad if that works for their needs, but in my view b4
support is a core part of piem.

> On dim., 23 oct. 2022 at 13:49, Declan Tsien <[email-masked]> wrote:
[...]
>> Subject: [PATCH 2/4] gnu: emacs-piem: Add build-info-manual phase.
>>
>> * gnu/packages/emacs-xyz.scm (emacs-piem): Add build-info-manual phase.
>> [native-inputs]: Add texinfo.
>> ---
>>  gnu/packages/emacs-xyz.scm | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
>> index be6d4c6ba3..bc56067a7c 100644
>> --- a/gnu/packages/emacs-xyz.scm
>> +++ b/gnu/packages/emacs-xyz.scm
>> @@ -7151,9 +7151,15 @@ (define-public emacs-piem
>>                   (lambda* (#:key inputs #:allow-other-keys)
>>                     (emacs-substitute-variables "piem-b4.el"
>>                       ("piem-b4-b4-executable"
>> -                      (search-input-file inputs "/bin/b4"))))))))
>> +                      (search-input-file inputs "/bin/b4")))))
>> +               (add-after 'unpack 'build-info-manual
>> +                 (lambda _
>> +                   (invoke "make" "Documentation/piem.info")
>> +                   (rename-file "Documentation/piem.info" "piem.info"))))))
>
> Here, I would build the manual before the install phase instead after
> the unpack phase.

Declan, thanks, I appreciate you adding the manual.

>> Subject: [PATCH 3/4] gnu: emacs-piem: Split into multiple separated packages.
>>
>> emacs-piem currently bundles multiple lisp files with identical functionality
>> but for different tastes. Split into separated packages would avoid pulling
>> unnecessary dependencies into user profile.
>>
>> * gnu/packages/emacs-xyz.scm (emacs-piem): Split into multiple separated
>> packages.
>> * gnu/packages/emacs-xyz.scm (emacs-piem-b4): New variable.
>> * gnu/packages/emacs-xyz.scm (emacs-piem-elfeed): New variable.
>> * gnu/packages/emacs-xyz.scm (emacs-piem-eww): New variable.
>> * gnu/packages/emacs-xyz.scm (emacs-piem-gnus): New variable.
>> * gnu/packages/emacs-xyz.scm (emacs-piem-notmuch): New variable.
>> * gnu/packages/emacs-xyz.scm (emacs-piem-rmail): New variable.
>> * gnu/packages/emacs-xyz.scm (emacs-piem-lei): New variable.
>
> Personally, I am fine with several packages.  But we could also ask if
> several output would not fit the bill.  WDYT?

Yes, I also wondered about using multiple outputs instead.

Two comments on "avoid[ing] pulling in unnecessary dependencies":

 * -eww, -gnus, and -rmail use libraries that ship with Emacs, so
    splitting them out doesn't remove any dependencies.

 * -lei doesn't bring in any dependencies because public-inbox isn't
    listed as an input.