diff mbox series

[bug#50833] gnu: Add bower.

Message ID 20210926231145.18651-1-jgart@dismail.de
State Accepted
Headers show
Series [bug#50833] gnu: Add bower. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

jgart Sept. 26, 2021, 11:11 p.m. UTC
* gnu/packages/mail.scm (bower): New variable.
---
 gnu/packages/mail.scm | 54 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

Comments

Sarah Morgensen Sept. 27, 2021, 1:01 a.m. UTC | #1
Hi,

Thanks for the patch.  I don't use notmuch (yet) but I test-built this
and I have a few suggestions :)

jgart <jgart@dismail.de> writes:

> * gnu/packages/mail.scm (bower): New variable.
> ---
>  gnu/packages/mail.scm | 54 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 54 insertions(+)
>
> diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
> index b3bdf13537..f0624c12c4 100644
> --- a/gnu/packages/mail.scm
> +++ b/gnu/packages/mail.scm
> @@ -87,6 +87,7 @@
>    #:use-module (gnu packages file)
>    #:use-module (gnu packages fontutils)
>    #:use-module (gnu packages freedesktop)
> +  #:use-module (gnu packages gawk)
>    #:use-module (gnu packages gdb)
>    #:use-module (gnu packages gettext)
>    #:use-module (gnu packages ghostscript)
> @@ -114,6 +115,7 @@
>    #:use-module (gnu packages lua)
>    #:use-module (gnu packages m4)
>    #:use-module (gnu packages man)
> +  #:use-module (gnu packages mercury)
>    #:use-module (gnu packages ncurses)
>    #:use-module (gnu packages nettle)
>    #:use-module (gnu packages networking)
> @@ -1302,6 +1304,58 @@ agent (@dfn{MUA}) experience as an alternative to the Emacs mode shipped with
>  Notmuch.")
>      (license license:gpl3+)))
>  
> +(define-public bower
> +  (package
> +    (name "bower")
> +    (version "0.13")
> +    (home-page "https://github.com/wangp/bower")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri
> +        (git-reference
> +         (url home-page)
> +         (commit (string-append version))))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32 "0r5s16pc3ym5nd33lv9ljv1p1gpb7yysrdni4g7w7yvjrnwk35l6"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:make-flags
> +       (list
> +        "bower" "man"
> +        (string-append "CC=" ,(cc-for-target))
> +        (string-append "prefix=" %output))
> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure)
> +         (replace 'check
> +           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
> +             (when tests?
> +               (chdir "tests")
> +               (invoke "make"))))

Rather than chdir, you can just

  (invoke "make" "-C" "tests")

or maybe even avoid the custom phase with test-target:

  #:test-target "--directory=tests"

(Yes, it's a bit of a cheat, but test-target is just passed as the first
argument to make, and we want the default target anyway, so it works.)

> +         (replace 'install
> +           (lambda* (#:key outpus #:allow-other-keys)
> +             (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
> +                   (man (string-append (assoc-ref %outputs "out") "/share/man/man1")))
> +               (chdir "..")
> +               (install-file "bower" bin)
> +               (install-file "bower.1" man)))))))

It might be helpful to also install bower.conf.sample to "/share/bower",
so we have an example config file.

> +    (native-inputs
> +     `(("diffutils" ,diffutils) ; needed for diff command
> +       ("gawk" ,gawk)
> +       ("mercury" ,mercury)
> +       ("pandoc" ,pandoc)
> +       ("util-linux" ,util-linux))) ; needed by rev command for test_process.m
> +    (inputs
> +     `(("gpgme" ,gpgme)
> +       ("ncurses" ,ncurses)))

The README says that it also uses "base64" from coreutils, "file", and
optionally "lynx"; a grep through the source shows the following
commands used (some of them are just defaults):

base64
file

vi (used if EDITOR is not set)
lynx (used for formatting HTML messages)
xdg-open (used for opening links and MIME parts)
xclip
pandoc (used for composing multipart/alternative messages)
/usr/bin/sendmail

Other than "base64" and "file" I'm not sure which (if any) of these
should be directly linked.  "/usr/bin/sendmail" should be "sendmail" if
it's not linked, though.  "xdg-open" and "xclip" aren't available from
my PATH, but they are configurable in bower.conf, so... yeah, I'm not
sure.  Just know that without changing the bower.conf value or
installing "xdg-open", links won't open automatically.  Same for the
clipboard and reading/composing HTML messages.

If it's not possible to 'substitute*' those values, 'wrap-program' could
be used to add the correct directories to PATH, but that can introduce
other issues.

> +    (synopsis "Terminal client for the notmuch email system")
> +    (description
> +"@command{bower} is a curses frontend for the notmuch email system.
> +@command{bower} is written in mercury.")

Could you expand the description a bit, perhaps with some of the
features you quoted in your first email?  It also seems that
configurability (seen above) is another of its draws, so maybe mention
that as well :)

(Also, in my opinion "written in X" isn't relevant for end-user
packages, but I know others who would disagree, so...)

> +    (license license:gpl3+)))
> +
>  (define-public notifymuch
>    (let
>        ((commit "9d4aaf54599282ce80643b38195ff501120807f0")

Thanks again for your work! 

--
Sarah
jgart Sept. 29, 2021, 1:12 a.m. UTC | #2
On Sun, 26 Sep 2021 18:01:20 -0700 Sarah Morgensen <iskarian@mgsn.dev> wrote:

Hi Sarah, thanks for all the feedback! It is much appreciated that you took
the time to do that.

>   (invoke "make" "-C" "tests")

I added this.

> or maybe even avoid the custom phase with test-target:
> 
>   #:test-target "--directory=tests"

This one didn't work out for me.

> It might be helpful to also install bower.conf.sample to "/share/bower",
> so we have an example config file.

Added this request.

> If it's not possible to 'substitute*' those values, 'wrap-program' could
> be used to add the correct directories to PATH, but that can introduce
> other issues.

I'll have to wrap my head around this one a bit more to understand what is needed.

It looks like the mercury code does not call the binaries directly.
I might be wrong. I have to take a closer look. Do you happen to have
some places in the code where you see the binaries being called in a way that
requires wrapping the path?

I updated the description :)

Below is the updated patch.

all best
Sarah Morgensen Oct. 1, 2021, 2:11 a.m. UTC | #3
Hello,

Apologies for the delayed reply.

jgart <jgart@dismail.de> writes:

>> If it's not possible to 'substitute*' those values, 'wrap-program' could
>> be used to add the correct directories to PATH, but that can introduce
>> other issues.
>
> I'll have to wrap my head around this one a bit more to understand what is needed.
>
> It looks like the mercury code does not call the binaries directly.
> I might be wrong. I have to take a closer look. Do you happen to have
> some places in the code where you see the binaries being called in a way that
> requires wrapping the path?

These are the locations I found.

src/compose.m
1488:base64_command = command_prefix(shell_quoted("base64"), quote_once).

src/detect_mime_type.m
55:file_command = command_prefix(shell_quoted("file"), quote_once).

src/prog_config.m
--8<---------------cut here---------------start------------->8---
:- func default_notmuch_command = command_prefix.

default_notmuch_command =
    command_prefix(shell_quoted("notmuch"), quote_once).

:- func default_editor_command = command_prefix.

default_editor_command =
    command_prefix(shell_quoted("vi"), quote_once).

:- func default_html_dump_command = command_prefix.

default_html_dump_command = command_prefix(shell_quoted(Lynx), quote_once) :-
    Lynx = "lynx -dump -force-html -stdin -display-charset=utf-8".

:- func default_open_part_command = string.

default_open_part_command = "xdg-open&".

:- func default_open_url_command = string.

default_open_url_command = "xdg-open&".

:- func default_pipe_id_command = string.

default_pipe_id_command = "xclip".

:- func default_alt_html_filter_command = command_prefix.

default_alt_html_filter_command =
    command_prefix(shell_quoted("pandoc -f markdown -t html"), quote_once).

:- func default_poll_period_secs = maybe(int).

default_poll_period_secs = yes(60).

:- func default_auto_refresh_inactive_secs = maybe(int).

default_auto_refresh_inactive_secs = no.

:- func default_sendmail_command = command_prefix.

default_sendmail_command =
    command_prefix(shell_quoted("/usr/bin/sendmail -oi -oem"), quote_once).
--8<---------------cut here---------------end--------------->8---

Also, I just caught one more thing--usually we write out the full URL in
the origin, rather than re-use the 'home-page' field.

Hope that helps,
--
Sarah
jgart Oct. 1, 2021, 3:31 a.m. UTC | #4
On Thu, 30 Sep 2021 19:11:24 -0700 Sarah Morgensen <iskarian@mgsn.dev> wrote:
> These are the locations I found.

Thanks! Not sure how I missed that :) I must have done the wrong thing with ripgrep

> default_sendmail_command =
>     command_prefix(shell_quoted("/usr/bin/sendmail -oi -oem"), quote_once).

Should sendmail really be wrapped? I feel like sendmail won't work "out of the" box
without some configuration first. I may be wrong. Not sure what to do there.

Maybe someone in the community can advise us further on that point?

The other ones seem sensible to wrap and as they mostly work without configuration.

I'm using msmtp instead of sendmail in my bower config. Seemed much simpler 
at the time to set up. I think the founding/main author of bower also uses msmtp 
instead of sendmail.

https://github.com/wangp/bower/blob/512b8be936db268d8ea94608cab486725cc2ec60/bower.conf.sample#L125

> Also, I just caught one more thing--usually we write out the full URL in
> the origin, rather than re-use the 'home-page' field.

Good catch! I stopped doing that also. That must have been from the package 
template I started from ;) 

I added a new patch with the home-page swapped below.

> Hope that helps,

Thank you! Yes, it does. Much appreciated :)

I hope to get back to this in a few days when I have more free time. 

Feel free to add patches if you'd like. We can commit together as co-authors.

all best,

jgart
jgart Oct. 2, 2021, 7:58 a.m. UTC | #5
> default_editor_command =
>     command_prefix(shell_quoted("vi"), quote_once).

Should we really patch/wrap vi? 

I imagine we would also have to propagate it?

I have a feeling vi shouldn't be part of the bower package.

WDYT?
jgart Oct. 25, 2021, 4:32 a.m. UTC | #6
On Thu, 30 Sep 2021 19:11:24 -0700 Sarah Morgensen <iskarian@mgsn.dev> wrote:
> default_html_dump_command = command_prefix(shell_quoted(Lynx), quote_once) :-
>     Lynx = "lynx -dump -force-html -stdin -display-charset=utf-8".

Hi again,

If lynx is being detected without needing to be wrapped should I still wrap it?

bower is currently finding lynx without me wrapping the binary in the store.

I installed both packages (lynx and bower) with guix and tested an html email
that would trigger lynx to render it. It works :)

This might reduce the code needed for the package definition if it is not necessary.

WDYT?
Ludovic Courtès Oct. 25, 2021, 12:25 p.m. UTC | #7
Hi!

jgart <jgart@dismail.de> skribis:

> On Thu, 30 Sep 2021 19:11:24 -0700 Sarah Morgensen <iskarian@mgsn.dev> wrote:
>> default_html_dump_command = command_prefix(shell_quoted(Lynx), quote_once) :-
>>     Lynx = "lynx -dump -force-html -stdin -display-charset=utf-8".
>
> Hi again,
>
> If lynx is being detected without needing to be wrapped should I still wrap it?

It’s detected if it happens to be in $PATH, otherwise it won’t be found.

Like Sarah suggested, I’d recommend using ‘substitute*’ to replace, say,
/usr/bin/sendmail by /gnu/store/…/bin/sendmail.  You can grep the code
for examples on how to do that; see also:

  https://guix.gnu.org/manual/en/html_node/Build-Utilities.html#index-substitute_002a

As for Lynx specifically, whether you’d leave it as is (in which case
it’s found if and only if it’s in $PATH), or whether you’d use
‘substitute*’ depends on whether it’s an optional dependency or not.  If
Bower can gracefully handle lack of Lynx and, for instance, fall back to
another rendering method, then perhaps you can leave it as is.

HTH!

Ludo’.
Maxim Cournoyer April 20, 2022, 9:07 p.m. UTC | #8
Hello,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi!
>
> jgart <jgart@dismail.de> skribis:
>
>> On Thu, 30 Sep 2021 19:11:24 -0700 Sarah Morgensen <iskarian@mgsn.dev> wrote:
>>> default_html_dump_command = command_prefix(shell_quoted(Lynx), quote_once) :-
>>>     Lynx = "lynx -dump -force-html -stdin -display-charset=utf-8".
>>
>> Hi again,
>>
>> If lynx is being detected without needing to be wrapped should I still wrap it?
>
> It’s detected if it happens to be in $PATH, otherwise it won’t be found.
>
> Like Sarah suggested, I’d recommend using ‘substitute*’ to replace, say,
> /usr/bin/sendmail by /gnu/store/…/bin/sendmail.  You can grep the code
> for examples on how to do that; see also:
>
>   https://guix.gnu.org/manual/en/html_node/Build-Utilities.html#index-substitute_002a
>
> As for Lynx specifically, whether you’d leave it as is (in which case
> it’s found if and only if it’s in $PATH), or whether you’d use
> ‘substitute*’ depends on whether it’s an optional dependency or not.  If
> Bower can gracefully handle lack of Lynx and, for instance, fall back to
> another rendering method, then perhaps you can leave it as is.

jgart, could you look into that?  Then we can bring this review to
completion :-)

Thanks,

Maxim
jgart May 5, 2022, 2:31 p.m. UTC | #9
On Wed, 20 Apr 2022 17:07:46 -0400 Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
> Hello,
> 
> Ludovic Courtès <ludo@gnu.org> writes:
> 
> > Hi!
> >
> > jgart <jgart@dismail.de> skribis:
> >
> >> On Thu, 30 Sep 2021 19:11:24 -0700 Sarah Morgensen <iskarian@mgsn.dev> wrote:
> >>> default_html_dump_command = command_prefix(shell_quoted(Lynx), quote_once) :-
> >>>     Lynx = "lynx -dump -force-html -stdin -display-charset=utf-8".
> >>
> >> Hi again,
> >>
> >> If lynx is being detected without needing to be wrapped should I still wrap it?
> >
> > It’s detected if it happens to be in $PATH, otherwise it won’t be found.
> >
> > Like Sarah suggested, I’d recommend using ‘substitute*’ to replace, say,
> > /usr/bin/sendmail by /gnu/store/…/bin/sendmail.  You can grep the code
> > for examples on how to do that; see also:
> >
> >   https://guix.gnu.org/manual/en/html_node/Build-Utilities.html#index-substitute_002a
> >
> > As for Lynx specifically, whether you’d leave it as is (in which case
> > it’s found if and only if it’s in $PATH), or whether you’d use
> > ‘substitute*’ depends on whether it’s an optional dependency or not.  If
> > Bower can gracefully handle lack of Lynx and, for instance, fall back to
> > another rendering method, then perhaps you can leave it as is.
> 
> jgart, could you look into that?  Then we can bring this review to
> completion :-)

Hi Ludo, Maxim,


Thanks for the review and encouragement. Sorry for the delay. I've been
in the process of relocating/starting a new job and haven't been able
to catch up on Guix stuff I have pending.

I spoke with wangp regading Lynx as an optional dependency:

https://github.com/wangp/bower/issues/103

> Like Sarah suggested, I’d recommend using ‘substitute*’ to
replace, say, /usr/bin/sendmail by /gnu/store/…/bin/sendmail.

I can patch sendmail and the others mentioned by Sarah. What should we
do about lynx given wangp's insight on lynx as default in bower?

all best,

jgart
Maxim Cournoyer July 7, 2022, 6:01 p.m. UTC | #10
Hi jgart,

[...]

>> jgart, could you look into that?  Then we can bring this review to
>> completion :-)
>
> Hi Ludo, Maxim,
>
>
> Thanks for the review and encouragement. Sorry for the delay. I've been
> in the process of relocating/starting a new job and haven't been able
> to catch up on Guix stuff I have pending.
>
> I spoke with wangp regading Lynx as an optional dependency:
>
> https://github.com/wangp/bower/issues/103
>
>> Like Sarah suggested, I’d recommend using ‘substitute*’ to
> replace, say, /usr/bin/sendmail by /gnu/store/…/bin/sendmail.
>
> I can patch sendmail and the others mentioned by Sarah. What should we
> do about lynx given wangp's insight on lynx as default in bower?

I think we should patch it, given that according to wangp "it doesn't
behave that nicely when lynx is missing but it won't crash." and taking
into account that lynx is very small (guix size lynx says it has a
closure of 185.4 MiB).

I'm looking forward to the v2 :-)

Thanks,

Maxim
jgart July 8, 2022, 12:23 a.m. UTC | #11
On Thu, 07 Jul 2022 14:01:21 -0400 Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
> Hi jgart,
> 
> [...]
> 
> >> jgart, could you look into that?  Then we can bring this review to
> >> completion :-)
> >
> > Hi Ludo, Maxim,
> >
> >
> > Thanks for the review and encouragement. Sorry for the delay. I've been
> > in the process of relocating/starting a new job and haven't been able
> > to catch up on Guix stuff I have pending.
> >
> > I spoke with wangp regading Lynx as an optional dependency:
> >
> > https://github.com/wangp/bower/issues/103
> >
> >> Like Sarah suggested, I’d recommend using ‘substitute*’ to
> > replace, say, /usr/bin/sendmail by /gnu/store/…/bin/sendmail.
> >
> > I can patch sendmail and the others mentioned by Sarah. What should we
> > do about lynx given wangp's insight on lynx as default in bower?
> 
> I think we should patch it, given that according to wangp "it doesn't
> behave that nicely when lynx is missing but it won't crash." and taking
> into account that lynx is very small (guix size lynx says it has a
> closure of 185.4 MiB).
> 
> I'm looking forward to the v2 :-)

So, I should just patch lynx then, or also other things on that list?

btw, bower is currently available from guixrus:

https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/misc.scm#L143

I also maintain the nix package for bower:

https://github.com/NixOS/nixpkgs/blob/nixos-22.05/pkgs/applications/networking/mailreaders/notmuch-bower/default.nix#L34

I might stop maintaining the nix package since it's not as exciting work as maintaining the Guix package and I think I don't have time for that anymore ;()

all best,

jgart
Munyoki Kilyungi July 8, 2022, 10:33 a.m. UTC | #12
jgart via Guix-patches via <guix-patches@gnu.org>
anaandika:

[...]

>
> So, I should just patch lynx then, or also other things on that list?
>
> btw, bower is currently available from guixrus:
>
> https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/misc.scm#L143
>
> I also maintain the nix package for bower:
>
> https://github.com/NixOS/nixpkgs/blob/nixos-22.05/pkgs/applications/networking/mailreaders/notmuch-bower/default.nix#L34
>

> I might stop maintaining the nix package since it's not as exciting work as maintaining the Guix package and I think I don't have time for that anymore ;()
>
A bit of yak-shaving here, but why would you want
nix+guix on the same system?
jgart July 8, 2022, 6:47 p.m. UTC | #13
On Fri, 08 Jul 2022 13:33:46 +0300 Munyoki Kilyungi <me@bonfacemunyoki.com> wrote:
> jgart via Guix-patches via <guix-patches@gnu.org>
> anaandika:
> 
> [...]
> 
> >
> > So, I should just patch lynx then, or also other things on that list?
> >
> > btw, bower is currently available from guixrus:
> >
> > https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/misc.scm#L143
> >
> > I also maintain the nix package for bower:
> >
> > https://github.com/NixOS/nixpkgs/blob/nixos-22.05/pkgs/applications/networking/mailreaders/notmuch-bower/default.nix#L34
> >
> 
> > I might stop maintaining the nix package since it's not as exciting work as maintaining the Guix package and I think I don't have time for that anymore ;()
> >
> A bit of yak-shaving here, but why would you want
> nix+guix on the same system?

Sometimes nix has a package that guix doesn't have and it might take a long time to package it for Guix properly so I just install it immediately with nix (think escape hatch).
jgart July 8, 2022, 7:42 p.m. UTC | #14
On Fri, 08 Jul 2022 13:47:01 -0500 jgart <jgart@dismail.de> wrote:
> On Fri, 08 Jul 2022 13:33:46 +0300 Munyoki Kilyungi <me@bonfacemunyoki.com> wrote:
> > jgart via Guix-patches via <guix-patches@gnu.org>
> > anaandika:
> > 
> > [...]
> > 
> > >
> > > So, I should just patch lynx then, or also other things on that list?
> > >
> > > btw, bower is currently available from guixrus:
> > >
> > > https://git.sr.ht/~whereiseveryone/guixrus/tree/master/item/guixrus/packages/misc.scm#L143
> > >
> > > I also maintain the nix package for bower:
> > >
> > > https://github.com/NixOS/nixpkgs/blob/nixos-22.05/pkgs/applications/networking/mailreaders/notmuch-bower/default.nix#L34
> > >
> > 
> > > I might stop maintaining the nix package since it's not as exciting work as maintaining the Guix package and I think I don't have time for that anymore ;()
> > >
> > A bit of yak-shaving here, but why would you want
> > nix+guix on the same system?
> 
> Sometimes nix has a package that guix doesn't have and it might take a long time to package it for Guix properly so I just install it immediately with nix (think escape hatch).

The same goes for any other package manager (e.g. pip, xbps, apt, npm, etc...). This is not an exclusive technique I use only with nix. I'm a consumer of packages. Guix keeps me honest, though.
Maxim Cournoyer July 11, 2022, 4:09 p.m. UTC | #15
Hi,

jgart <jgart@dismail.de> writes:

[...]

>> > I can patch sendmail and the others mentioned by Sarah. What should we
>> > do about lynx given wangp's insight on lynx as default in bower?
>> 
>> I think we should patch it, given that according to wangp "it doesn't
>> behave that nicely when lynx is missing but it won't crash." and taking
>> into account that lynx is very small (guix size lynx says it has a
>> closure of 185.4 MiB).
>> 
>> I'm looking forward to the v2 :-)
>
> So, I should just patch lynx then, or also other things on that list?

Sarah had sent a useful list of commands they could find referenced in
the source:

>--8<---------------cut here---------------start------------->8---
src/compose.m
1488:base64_command = command_prefix(shell_quoted("base64"), quote_once).

src/detect_mime_type.m
55:file_command = command_prefix(shell_quoted("file"), quote_once).

src/prog_config.m

:- func default_notmuch_command = command_prefix.

default_notmuch_command =
    command_prefix(shell_quoted("notmuch"), quote_once).

:- func default_editor_command = command_prefix.

default_editor_command =
    command_prefix(shell_quoted("vi"), quote_once).

:- func default_html_dump_command = command_prefix.

default_html_dump_command = command_prefix(shell_quoted(Lynx), quote_once) :-
    Lynx = "lynx -dump -force-html -stdin -display-charset=utf-8".

:- func default_open_part_command = string.

default_open_part_command = "xdg-open&".

:- func default_open_url_command = string.

default_open_url_command = "xdg-open&".

:- func default_pipe_id_command = string.

default_pipe_id_command = "xclip".

:- func default_alt_html_filter_command = command_prefix.

default_alt_html_filter_command =
    command_prefix(shell_quoted("pandoc -f markdown -t html"), quote_once).

:- func default_poll_period_secs = maybe(int).

default_poll_period_secs = yes(60).

:- func default_auto_refresh_inactive_secs = maybe(int).

default_auto_refresh_inactive_secs = no.

:- func default_sendmail_command = command_prefix.

default_sendmail_command =
    command_prefix(shell_quoted("/usr/bin/sendmail -oi -oem"), quote_once).
--8<---------------cut here---------------end--------------->8---

Out of these, I'd patch 'base64', 'file', 'notmuch', 'lynx' and
'sendmail', and leave the rest to be picked from PATH if available.

Could you send an updated version patching the above commands?  With
this, it should be good to go.

Thank you,

Maxim
Munyoki Kilyungi July 14, 2022, 8:54 a.m. UTC | #16
jgart <jgart@dismail.de> anaandika:

[...]
>> Sometimes nix has a package that guix doesn't have and it might take a long time to package it for Guix properly so I just install it immediately with nix (think escape hatch).
>
> The same goes for any other package manager (e.g. pip, xbps, apt, npm, etc...). This is not an exclusive technique I use only with nix. I'm a consumer of packages. Guix keeps me honest, though. 

Ah I see.  For me that's been the upstream Arch or
AUR.
jgart July 15, 2022, 1:50 a.m. UTC | #17
On Mon, 11 Jul 2022 12:09:06 -0400 Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

Maxim, give me till this weekend to attempt to finish this.

all best,

jgart
diff mbox series

Patch

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index b3bdf13537..f0624c12c4 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -87,6 +87,7 @@ 
   #:use-module (gnu packages file)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gawk)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
@@ -114,6 +115,7 @@ 
   #:use-module (gnu packages lua)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages mercury)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages nettle)
   #:use-module (gnu packages networking)
@@ -1302,6 +1304,58 @@  agent (@dfn{MUA}) experience as an alternative to the Emacs mode shipped with
 Notmuch.")
     (license license:gpl3+)))
 
+(define-public bower
+  (package
+    (name "bower")
+    (version "0.13")
+    (home-page "https://github.com/wangp/bower")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url home-page)
+         (commit (string-append version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0r5s16pc3ym5nd33lv9ljv1p1gpb7yysrdni4g7w7yvjrnwk35l6"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (list
+        "bower" "man"
+        (string-append "CC=" ,(cc-for-target))
+        (string-append "prefix=" %output))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (chdir "tests")
+               (invoke "make"))))
+         (replace 'install
+           (lambda* (#:key outpus #:allow-other-keys)
+             (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
+                   (man (string-append (assoc-ref %outputs "out") "/share/man/man1")))
+               (chdir "..")
+               (install-file "bower" bin)
+               (install-file "bower.1" man)))))))
+    (native-inputs
+     `(("diffutils" ,diffutils) ; needed for diff command
+       ("gawk" ,gawk)
+       ("mercury" ,mercury)
+       ("pandoc" ,pandoc)
+       ("util-linux" ,util-linux))) ; needed by rev command for test_process.m
+    (inputs
+     `(("gpgme" ,gpgme)
+       ("ncurses" ,ncurses)))
+    (synopsis "Terminal client for the notmuch email system")
+    (description
+"@command{bower} is a curses frontend for the notmuch email system.
+@command{bower} is written in mercury.")
+    (license license:gpl3+)))
+
 (define-public notifymuch
   (let
       ((commit "9d4aaf54599282ce80643b38195ff501120807f0")