* [bug#50833] [PATCH] gnu: Add bower.
2021-09-26 23:08 [bug#50833] Add bower (it's not what you're thinking) jgart via Guix-patches via
@ 2021-09-26 23:11 ` jgart via Guix-patches via
2021-09-27 1:01 ` Sarah Morgensen
2021-09-29 1:12 ` [bug#50833] [PATCH] gnu: Add bower jgart via Guix-patches via
` (4 subsequent siblings)
5 siblings, 1 reply; 26+ messages in thread
From: jgart via Guix-patches via @ 2021-09-26 23:11 UTC (permalink / raw)
To: 50833; +Cc: jgart
* 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"))))
+ (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")
--
2.33.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] gnu: Add bower.
2021-09-26 23:11 ` [bug#50833] [PATCH] gnu: Add bower jgart via Guix-patches via
@ 2021-09-27 1:01 ` Sarah Morgensen
2021-09-29 1:12 ` jgart via Guix-patches via
0 siblings, 1 reply; 26+ messages in thread
From: Sarah Morgensen @ 2021-09-27 1:01 UTC (permalink / raw)
To: jgart; +Cc: 50833
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] gnu: Add bower.
2021-09-27 1:01 ` Sarah Morgensen
@ 2021-09-29 1:12 ` jgart via Guix-patches via
2021-10-01 2:11 ` Sarah Morgensen
0 siblings, 1 reply; 26+ messages in thread
From: jgart via Guix-patches via @ 2021-09-29 1:12 UTC (permalink / raw)
To: Sarah Morgensen; +Cc: 50833
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] gnu: Add bower.
2021-09-29 1:12 ` jgart via Guix-patches via
@ 2021-10-01 2:11 ` Sarah Morgensen
2021-10-01 3:31 ` jgart via Guix-patches via
` (2 more replies)
0 siblings, 3 replies; 26+ messages in thread
From: Sarah Morgensen @ 2021-10-01 2:11 UTC (permalink / raw)
To: jgart; +Cc: 50833
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] gnu: Add bower.
2021-10-01 2:11 ` Sarah Morgensen
@ 2021-10-01 3:31 ` jgart via Guix-patches via
2021-10-02 7:58 ` jgart via Guix-patches via
2021-10-25 4:32 ` jgart via Guix-patches via
2 siblings, 0 replies; 26+ messages in thread
From: jgart via Guix-patches via @ 2021-10-01 3:31 UTC (permalink / raw)
To: Sarah Morgensen; +Cc: 50833
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] gnu: Add bower.
2021-10-01 2:11 ` Sarah Morgensen
2021-10-01 3:31 ` jgart via Guix-patches via
@ 2021-10-02 7:58 ` jgart via Guix-patches via
2021-10-25 4:32 ` jgart via Guix-patches via
2 siblings, 0 replies; 26+ messages in thread
From: jgart via Guix-patches via @ 2021-10-02 7:58 UTC (permalink / raw)
To: Sarah Morgensen; +Cc: 50833
> 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?
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] gnu: Add bower.
2021-10-01 2:11 ` Sarah Morgensen
2021-10-01 3:31 ` jgart via Guix-patches via
2021-10-02 7:58 ` jgart via Guix-patches via
@ 2021-10-25 4:32 ` jgart via Guix-patches via
2021-10-25 12:25 ` [bug#50833] Add bower (it's not what you're thinking) Ludovic Courtès
2 siblings, 1 reply; 26+ messages in thread
From: jgart via Guix-patches via @ 2021-10-25 4:32 UTC (permalink / raw)
To: Sarah Morgensen; +Cc: 50833
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?
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] Add bower (it's not what you're thinking)
2021-10-25 4:32 ` jgart via Guix-patches via
@ 2021-10-25 12:25 ` Ludovic Courtès
2022-04-20 21:07 ` [bug#50833] [PATCH] Add Bower (notmuch curses email client) Maxim Cournoyer
0 siblings, 1 reply; 26+ messages in thread
From: Ludovic Courtès @ 2021-10-25 12:25 UTC (permalink / raw)
To: jgart; +Cc: 50833, Sarah Morgensen
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’.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] Add Bower (notmuch curses email client)
2021-10-25 12:25 ` [bug#50833] Add bower (it's not what you're thinking) Ludovic Courtès
@ 2022-04-20 21:07 ` Maxim Cournoyer
2022-05-05 14:31 ` jgart via Guix-patches via
0 siblings, 1 reply; 26+ messages in thread
From: Maxim Cournoyer @ 2022-04-20 21:07 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 50833, Sarah Morgensen, jgart
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] Add Bower (notmuch curses email client)
2022-04-20 21:07 ` [bug#50833] [PATCH] Add Bower (notmuch curses email client) Maxim Cournoyer
@ 2022-05-05 14:31 ` jgart via Guix-patches via
2022-07-07 18:01 ` Maxim Cournoyer
0 siblings, 1 reply; 26+ messages in thread
From: jgart via Guix-patches via @ 2022-05-05 14:31 UTC (permalink / raw)
To: Maxim Cournoyer; +Cc: 50833, Ludovic Courtès, Sarah Morgensen
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] Add Bower (notmuch curses email client)
2022-05-05 14:31 ` jgart via Guix-patches via
@ 2022-07-07 18:01 ` Maxim Cournoyer
2022-07-08 0:23 ` jgart via Guix-patches via
0 siblings, 1 reply; 26+ messages in thread
From: Maxim Cournoyer @ 2022-07-07 18:01 UTC (permalink / raw)
To: jgart; +Cc: 50833, Ludovic Courtès, Sarah Morgensen
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] Add Bower (notmuch curses email client)
2022-07-07 18:01 ` Maxim Cournoyer
@ 2022-07-08 0:23 ` jgart via Guix-patches via
2022-07-08 10:33 ` Munyoki Kilyungi
2022-07-11 16:09 ` Maxim Cournoyer
0 siblings, 2 replies; 26+ messages in thread
From: jgart via Guix-patches via @ 2022-07-08 0:23 UTC (permalink / raw)
To: Maxim Cournoyer; +Cc: 50833, Ludovic Courtès, Sarah Morgensen
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] Add Bower (notmuch curses email client)
2022-07-08 0:23 ` jgart via Guix-patches via
@ 2022-07-08 10:33 ` Munyoki Kilyungi
2022-07-08 18:47 ` jgart via Guix-patches via
2022-07-11 16:09 ` Maxim Cournoyer
1 sibling, 1 reply; 26+ messages in thread
From: Munyoki Kilyungi @ 2022-07-08 10:33 UTC (permalink / raw)
To: 50833; +Cc: ludo, iskarian, jgart, maxim.cournoyer
[-- Attachment #1: Type: text/plain, Size: 906 bytes --]
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?
--
(Life is like a pencil that will surely run out,
but will leave the beautiful writing of life.)
(D4F09EB110177E03C28E2FE1F5BBAE1E0392253F
(hkp://keys.gnupg.net))
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 865 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] Add Bower (notmuch curses email client)
2022-07-08 10:33 ` Munyoki Kilyungi
@ 2022-07-08 18:47 ` jgart via Guix-patches via
2022-07-08 19:42 ` jgart via Guix-patches via
0 siblings, 1 reply; 26+ messages in thread
From: jgart via Guix-patches via @ 2022-07-08 18:47 UTC (permalink / raw)
To: Munyoki Kilyungi; +Cc: 50833, ludo, iskarian, maxim.cournoyer
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).
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] Add Bower (notmuch curses email client)
2022-07-08 18:47 ` jgart via Guix-patches via
@ 2022-07-08 19:42 ` jgart via Guix-patches via
2022-07-14 8:54 ` Munyoki Kilyungi
0 siblings, 1 reply; 26+ messages in thread
From: jgart via Guix-patches via @ 2022-07-08 19:42 UTC (permalink / raw)
To: Munyoki Kilyungi; +Cc: 50833, ludo, iskarian, maxim.cournoyer
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.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] Add Bower (notmuch curses email client)
2022-07-08 19:42 ` jgart via Guix-patches via
@ 2022-07-14 8:54 ` Munyoki Kilyungi
0 siblings, 0 replies; 26+ messages in thread
From: Munyoki Kilyungi @ 2022-07-14 8:54 UTC (permalink / raw)
To: jgart; +Cc: 50833, ludo, iskarian, maxim.cournoyer
[-- Attachment #1: Type: text/plain, Size: 669 bytes --]
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.
--
(Life is like a pencil that will surely run out,
but will leave the beautiful writing of life.)
(D4F09EB110177E03C28E2FE1F5BBAE1E0392253F
(hkp://keys.gnupg.net))
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 865 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] Add Bower (notmuch curses email client)
2022-07-08 0:23 ` jgart via Guix-patches via
2022-07-08 10:33 ` Munyoki Kilyungi
@ 2022-07-11 16:09 ` Maxim Cournoyer
2022-07-15 1:50 ` jgart via Guix-patches via
1 sibling, 1 reply; 26+ messages in thread
From: Maxim Cournoyer @ 2022-07-11 16:09 UTC (permalink / raw)
To: jgart; +Cc: 50833, Ludovic Courtès, Sarah Morgensen
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] gnu: Add bower.
2021-09-26 23:08 [bug#50833] Add bower (it's not what you're thinking) jgart via Guix-patches via
2021-09-26 23:11 ` [bug#50833] [PATCH] gnu: Add bower jgart via Guix-patches via
@ 2021-09-29 1:12 ` jgart via Guix-patches via
2021-10-01 3:31 ` jgart via Guix-patches via
` (3 subsequent siblings)
5 siblings, 0 replies; 26+ messages in thread
From: jgart via Guix-patches via @ 2021-09-29 1:12 UTC (permalink / raw)
To: 50833; +Cc: jgart
* gnu/packages/mail.scm (bower): New variable.
---
gnu/packages/mail.scm | 66 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index b3bdf13537..9c5a1a7e22 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,70 @@ 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?
+ (invoke "make" "-C" "tests"))))
+ (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"))
+ (conf (string-append (assoc-ref %outputs "out") "/share/bower")))
+ (install-file "bower" bin)
+ (install-file "bower.conf.sample" (string-append conf "/bower.conf"))
+ (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
+ `(("coreutils" ,coreutils) ; needed for base64
+ ("file" ,file)
+ ("gpgme" ,gpgme)
+ ("ncurses" ,ncurses)
+ ("xclip" ,xclip)
+ ("xdg-utils" ,xdg-utils))) ; needed for xdg-open
+ (synopsis "Terminal client for the notmuch email system")
+ (description
+"@command{bower} is a curses frontend for the notmuch email system.
+Bower has two main views: an index, and a combined message thread and pager.
+Bower can use the @command{notmuch address} command to look up email addresses
+where required, for example, when composing a new message.
+Bower is designed such that it can be run on the local machine but call
+out to @command{notmuch} via ssh on a remote machine storing your mail.
+ The advantage is that you can start helper programs on the local machine,
+for example, a web browser or image viewer, and add or save attachments on
+the local filesystem, even if your mail archive is stored on a different
+machine.")
+ (license license:gpl3+)))
+
(define-public notifymuch
(let
((commit "9d4aaf54599282ce80643b38195ff501120807f0")
--
2.33.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH] gnu: Add bower.
2021-09-26 23:08 [bug#50833] Add bower (it's not what you're thinking) jgart via Guix-patches via
2021-09-26 23:11 ` [bug#50833] [PATCH] gnu: Add bower jgart via Guix-patches via
2021-09-29 1:12 ` [bug#50833] [PATCH] gnu: Add bower jgart via Guix-patches via
@ 2021-10-01 3:31 ` jgart via Guix-patches via
2022-07-20 5:18 ` [bug#50833] [PATCH v2] " jgart via Guix-patches via
` (2 subsequent siblings)
5 siblings, 0 replies; 26+ messages in thread
From: jgart via Guix-patches via @ 2021-10-01 3:31 UTC (permalink / raw)
To: 50833; +Cc: jgart
* gnu/packages/mail.scm (bower): New variable.
---
gnu/packages/mail.scm | 66 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index e1e56c33d0..3bfb81085b 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,70 @@ 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")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url "https://github.com/wangp/bower")
+ (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?
+ (invoke "make" "-C" "tests"))))
+ (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"))
+ (conf (string-append (assoc-ref %outputs "out") "/share/bower")))
+ (install-file "bower" bin)
+ (install-file "bower.conf.sample" (string-append conf "/bower.conf"))
+ (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
+ `(("coreutils" ,coreutils) ; needed for base64
+ ("file" ,file)
+ ("gpgme" ,gpgme)
+ ("ncurses" ,ncurses)
+ ("xclip" ,xclip)
+ ("xdg-utils" ,xdg-utils))) ; needed for xdg-open
+ (home-page "https://github.com/wangp/bower")
+ (synopsis "Terminal client for the notmuch email system")
+ (description
+"@command{bower} is a curses frontend for the notmuch email system.
+Bower has two main views: an index, and a combined message thread and pager.
+Bower can use the @command{notmuch address} command to look up email addresses
+where required, for example, when composing a new message.
+Bower is designed such that it can be run on the local machine but call
+out to @command{notmuch} via ssh on a remote machine storing your mail.
+ The advantage is that you can start helper programs on the local machine,
+for example, a web browser or image viewer, and add or save attachments on
+the local filesystem, even if your mail archive is stored on a different
+machine.")
+ (license license:gpl3+)))
+
(define-public notifymuch
(let
((commit "9d4aaf54599282ce80643b38195ff501120807f0")
--
2.33.0
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH v2] gnu: Add bower.
2021-09-26 23:08 [bug#50833] Add bower (it's not what you're thinking) jgart via Guix-patches via
` (2 preceding siblings ...)
2021-10-01 3:31 ` jgart via Guix-patches via
@ 2022-07-20 5:18 ` jgart via Guix-patches via
2022-07-20 11:59 ` Maxime Devos
2022-08-21 6:53 ` [bug#50833] [PATCH v3] " jgart via Guix-patches via
2022-09-02 14:05 ` bug#50833: [PATCH] Add Bower (notmuch curses email client) Maxim Cournoyer
5 siblings, 1 reply; 26+ messages in thread
From: jgart via Guix-patches via @ 2022-07-20 5:18 UTC (permalink / raw)
To: 50833; +Cc: jgart, Maxim Cournoyer
* gnu/packages/mail.scm (bower): New variable.
Hi Maxim, Here's v2 patching the executables you requested. Sorry for the delay.
all best,
jgart
---
gnu/packages/mail.scm | 80 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 556c5b4305..afad1cc4bf 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -48,6 +48,7 @@
;;; Copyright © 2022 Justin Veilleux <terramorpha@cock.li>
;;; Copyright © 2022 Thiago Jung Bauermann <bauermann@kolabnow.com>
;;; Copyright © 2022 Guillaume Le Vaillant <glv@posteo.net>
+;;; Copyright © 2022 jgart <jgart@dismail.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -124,6 +125,7 @@ (define-module (gnu packages mail)
#: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)
@@ -1522,6 +1524,84 @@ (define-public python-notmuch2
(synopsis "Pythonic bindings for the notmuch mail database using CFFI")
(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 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)
+ (add-after 'unpack 'patch-executables
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((file (assoc-ref inputs "file"))
+ (base64 (assoc-ref inputs "coreutils"))
+ (lynx (assoc-ref inputs "lynx"))
+ (sendmail (assoc-ref inputs "sendmail"))
+ (notmuch (assoc-ref inputs "notmuch")))
+ (substitute* "src/detect_mime_type.m"
+ (("\"file")
+ (string-append "\"" file "/bin/file")))
+ (substitute* "src/compose.m"
+ (("\"base64")
+ (string-append "\"" base64 "/bin/base64"))
+ (("\"lynx")
+ (string-append "\"" lynx "/bin/lynx")))
+ (substitute* "src/prog_config.m"
+ (("\"notmuch\"")
+ (string-append "\"" notmuch "/bin/notmuch\""))
+ (("/usr/bin/sendmail")
+ (string-append sendmail "/sbin/sendmail"))
+ (("\"lynx")
+ (string-append "\"" lynx "/bin/lynx"))))))
+ (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
+ (list diffutils
+ gawk
+ mercury
+ pandoc
+ util-linux))
+ (inputs
+ (list gpgme
+ coreutils
+ lynx
+ notmuch
+ sendmail
+ ncurses))
+ (synopsis "Terminal client for the notmuch email system")
+ (description "@code{bower} is a curses frontend for the notmuch email
+system. It is written in @{mercury}.")
+ (license license:gpl3+)))
+
(define-public muchsync
(package
(name "muchsync")
--
2.37.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH v2] gnu: Add bower.
2022-07-20 5:18 ` [bug#50833] [PATCH v2] " jgart via Guix-patches via
@ 2022-07-20 11:59 ` Maxime Devos
2022-07-24 17:45 ` jgart via Guix-patches via
0 siblings, 1 reply; 26+ messages in thread
From: Maxime Devos @ 2022-07-20 11:59 UTC (permalink / raw)
To: jgart, 50833; +Cc: Maxim Cournoyer
[-- Attachment #1.1.1.1: Type: text/plain, Size: 5518 bytes --]
On 20-07-2022 07:18, jgart via Guix-patches via wrote:
> * gnu/packages/mail.scm (bower): New variable.
>
> Hi Maxim, Here's v2 patching the executables you requested. Sorry for the delay.
>
> all best,
>
> jgart
> ---
> gnu/packages/mail.scm | 80 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 80 insertions(+)
>
> diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
> index 556c5b4305..afad1cc4bf 100644
> --- a/gnu/packages/mail.scm
> +++ b/gnu/packages/mail.scm
> @@ -48,6 +48,7 @@
> ;;; Copyright © 2022 Justin Veilleux<terramorpha@cock.li>
> ;;; Copyright © 2022 Thiago Jung Bauermann<bauermann@kolabnow.com>
> ;;; Copyright © 2022 Guillaume Le Vaillant<glv@posteo.net>
> +;;; Copyright © 2022 jgart<jgart@dismail.de>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -124,6 +125,7 @@ (define-module (gnu packages mail)
> #: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)
> @@ -1522,6 +1524,84 @@ (define-public python-notmuch2
> (synopsis "Pythonic bindings for the notmuch mail database using CFFI")
> (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 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))
IIRC, %output is not documented -- you can use #$output instead:
(arguments
(list #:make-flags
#~(list "bower" "man" (string-append "CC=" #$(cc-for-target)) (string-append "prefix=" #$output))
[...]))
> + #:phases
> + (modify-phases %standard-phases
> + (delete 'configure)
> + (add-after 'unpack 'patch-executables
> + (lambda* (#:key inputs #:allow-other-keys)
> + (let ((file (assoc-ref inputs "file"))
> + (base64 (assoc-ref inputs "coreutils"))
> + (lynx (assoc-ref inputs "lynx"))
> + (sendmail (assoc-ref inputs "sendmail"))
> + (notmuch (assoc-ref inputs "notmuch")))
> + (substitute* "src/detect_mime_type.m"
> + (("\"file")
> + (string-append "\"" file "/bin/file")))
Not using input labels is preferred (such that package transformations
can easily be used to, say, replace "coreutils" with something
sufficiently compatible that isn't "coreutils"). You can use
search-input-file instead. E.g.,:
(substitute* "src/detect_mime_type.m"
("\"file") (string-append "\"" (search-input-file inputs "/bin/file")))
[...])
and likewise for the other substitutions.
> + (substitute* "src/compose.m"
> + (("\"base64")
> + (string-append "\"" base64 "/bin/base64"))
> + (("\"lynx")
> + (string-append "\"" lynx "/bin/lynx")))
> + (substitute* "src/prog_config.m"
> + (("\"notmuch\"")
> + (string-append "\"" notmuch "/bin/notmuch\""))
> + (("/usr/bin/sendmail")
> + (string-append sendmail "/sbin/sendmail"))
> + (("\"lynx")
> + (string-append "\"" lynx "/bin/lynx"))))))
> + (replace 'check
> + (lambda* (#:key inputs outputs tests? #:allow-other-keys)
You are not using inputs or outputs here, so they can be removed.
> + (when tests?
> + (chdir "tests")
> + (invoke "make"))))
Due to the issue noted below, I recommend keeping the 'chdir'
unconditional. I believe (with-directory-excursion ...) to be even
better, as it restores the change in directory automatically, less room
for trouble.
> + (replace 'install
> + (lambda* (#:key outpus #:allow-other-keys)
You are not using 'outpus' here (also, 'outpus' -> 'outputs'), so it can
be removed.
> + (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
> + (man (string-append (assoc-ref %outputs "out") "/share/man/man1")))
I'd replace (assoc-ref %outputs "out") by #$output (don't forget to add
#~ before the (modify-phases ...)) to avoid the assoc-ref construct and
%outputs in favour of the simpler #$output.
> + (chdir "..")
This is to undo the (chdir "tests") above, right? If so, remember that
the (chdir "tests") above is unconditional, so this will break when
tests are disabled (in case of --without-tests, or in case of
cross-compiling with --target=aarch64-linux-gnu or such). So it needs
to be made conditional on tests? as well, or the (chdir "tests") from
above would need to be made unconditional, or the with-directory-excursion.
Greetings,
Maxime
[-- Attachment #1.1.1.2: Type: text/html, Size: 7333 bytes --]
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH v2] gnu: Add bower.
2022-07-20 11:59 ` Maxime Devos
@ 2022-07-24 17:45 ` jgart via Guix-patches via
0 siblings, 0 replies; 26+ messages in thread
From: jgart via Guix-patches via @ 2022-07-24 17:45 UTC (permalink / raw)
To: Maxime Devos; +Cc: 50833, Maxim Cournoyer
On Wed, 20 Jul 2022 13:59:19 +0200 Maxime Devos <maximedevos@telenet.be> wrote:
>
> On 20-07-2022 07:18, jgart via Guix-patches via wrote:
Hi Maxime,
Thanks for the review!
Give me till next weekend to try again with your new suggestions.
all best,
jgart
^ permalink raw reply [flat|nested] 26+ messages in thread
* [bug#50833] [PATCH v3] gnu: Add bower.
2021-09-26 23:08 [bug#50833] Add bower (it's not what you're thinking) jgart via Guix-patches via
` (3 preceding siblings ...)
2022-07-20 5:18 ` [bug#50833] [PATCH v2] " jgart via Guix-patches via
@ 2022-08-21 6:53 ` jgart via Guix-patches via
2022-09-02 14:05 ` bug#50833: [PATCH] Add Bower (notmuch curses email client) Maxim Cournoyer
5 siblings, 0 replies; 26+ messages in thread
From: jgart via Guix-patches via @ 2022-08-21 6:53 UTC (permalink / raw)
To: 50833; +Cc: jgart, Maxim Cournoyer
* gnu/packages/mail.scm (bower): New variable.
Hi Maxim,
Here's a version 3 patch set.
I bumped bower to version 1.0 which was released a few days ago.
lynx is no longer configured by default in the bower sources.
all best,
jgart
---
gnu/packages/mail.scm | 72 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index b4b3162fff..dd307520df 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -49,6 +49,7 @@
;;; Copyright © 2022 Thiago Jung Bauermann <bauermann@kolabnow.com>
;;; Copyright © 2022 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2022 muradm <mail@muradm.net>
+;;; Copyright © 2022 jgart <jgart@dismail.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -125,6 +126,7 @@ (define-module (gnu packages mail)
#: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)
@@ -1506,6 +1508,76 @@ (define-public python-notmuch2
(synopsis "Pythonic bindings for the notmuch mail database using CFFI")
(license license:gpl3+)))
+(define-public bower
+ (package
+ (name "bower")
+ (version "1.0")
+ (home-page "https://github.com/wangp/bower")
+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (url home-page)
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0vcsbxlsvr2wv3c7sfr3yj21kbqy259skpxg00vf5bdkbc8qknq4"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:make-flags
+ #~(list
+ "bower"
+ "man"
+ (string-append "CC=" #+(cc-for-target))
+ (string-append "prefix=" #$output))
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'patch-executables
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "src/detect_mime_type.m"
+ (("\"file")
+ (string-append "\"" (search-input-file inputs "/bin/file"))))
+ (substitute* "src/compose.m"
+ (("\"base64")
+ (string-append "\"" (search-input-file inputs "/bin/base64"))))
+ (substitute* "src/prog_config.m"
+ (("\\(\"false")
+ (string-append "(\"" (search-input-file inputs "/bin/false")))
+ (("\\(\"notmuch\"")
+ (string-append "(\"" (search-input-file inputs "/bin/notmuch") "\""))
+ (("/usr/bin/sendmail")
+ (search-input-file inputs "/sbin/sendmail")))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "make")))))
+ (replace 'install
+ (lambda* _
+ (let ((bin (string-append #$output "/bin"))
+ (man (string-append #$output "/share/man/man1")))
+ (install-file "bower" bin)
+ (install-file "bower.1" man)))))))
+ (native-inputs
+ (list diffutils
+ gawk
+ mercury
+ pandoc
+ util-linux))
+ (inputs
+ (list gpgme
+ coreutils
+ notmuch
+ sendmail
+ ncurses))
+ (synopsis "Terminal client for the notmuch email system")
+ (description "@code{bower} is a curses frontend for the notmuch email
+system. It is written in @{mercury}.")
+ (license license:gpl3+)))
+
(define-public muchsync
(package
(name "muchsync")
--
2.37.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* bug#50833: [PATCH] Add Bower (notmuch curses email client)
2021-09-26 23:08 [bug#50833] Add bower (it's not what you're thinking) jgart via Guix-patches via
` (4 preceding siblings ...)
2022-08-21 6:53 ` [bug#50833] [PATCH v3] " jgart via Guix-patches via
@ 2022-09-02 14:05 ` Maxim Cournoyer
5 siblings, 0 replies; 26+ messages in thread
From: Maxim Cournoyer @ 2022-09-02 14:05 UTC (permalink / raw)
To: jgart; +Cc: 50833-done, Ludovic Courtès, Sarah Morgensen
Hi,
jgart <jgart@dismail.de> writes:
> * gnu/packages/mail.scm (bower): New variable.
>
> Hi Maxim,
>
> Here's a version 3 patch set.
>
> I bumped bower to version 1.0 which was released a few days ago.
Thanks.
I've made the following changes:
--8<---------------cut here---------------start------------->8---
modified gnu/packages/mail.scm
@@ -1517,51 +1517,50 @@ (define-public bower
(source
(origin
(method git-fetch)
- (uri
- (git-reference
- (url home-page)
- (commit version)))
+ (uri (git-reference
+ (url home-page)
+ (commit version)))
(file-name (git-file-name name version))
(sha256
(base32 "0vcsbxlsvr2wv3c7sfr3yj21kbqy259skpxg00vf5bdkbc8qknq4"))))
(build-system gnu-build-system)
(arguments
- (list
- #:make-flags
- #~(list
- "bower"
- "man"
- (string-append "CC=" #+(cc-for-target))
- (string-append "prefix=" #$output))
- #:phases
- #~(modify-phases %standard-phases
- (delete 'configure)
- (add-after 'unpack 'patch-executables
- (lambda* (#:key inputs #:allow-other-keys)
- (substitute* "src/detect_mime_type.m"
- (("\"file")
- (string-append "\"" (search-input-file inputs "/bin/file"))))
- (substitute* "src/compose.m"
- (("\"base64")
- (string-append "\"" (search-input-file inputs "/bin/base64"))))
- (substitute* "src/prog_config.m"
- (("\\(\"false")
- (string-append "(\"" (search-input-file inputs "/bin/false")))
- (("\\(\"notmuch\"")
- (string-append "(\"" (search-input-file inputs "/bin/notmuch") "\""))
- (("/usr/bin/sendmail")
- (search-input-file inputs "/sbin/sendmail")))))
- (replace 'check
- (lambda* (#:key tests? #:allow-other-keys)
- (when tests?
- (with-directory-excursion "tests"
- (invoke "make")))))
- (replace 'install
- (lambda* _
- (let ((bin (string-append #$output "/bin"))
- (man (string-append #$output "/share/man/man1")))
- (install-file "bower" bin)
- (install-file "bower.1" man)))))))
+ (list
+ #:make-flags #~(list "bower" "man"
+ (string-append "CC=" #+(cc-for-target))
+ (string-append "prefix=" #$output))
+ #:parallel-tests? #f ;parallelism breaks test suite
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'patch-executables
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "src/detect_mime_type.m"
+ (("\"file\"")
+ (format #f "~s" (search-input-file inputs "bin/file"))))
+ (substitute* "src/compose.m"
+ (("\"base64\"")
+ (format #f "~s" (search-input-file inputs "bin/base64"))))
+ (substitute* "src/prog_config.m"
+ (("shell_quoted\\(\"false\")")
+ (format #f "shell_quoted(~s)"
+ (search-input-file inputs "bin/false")))
+ (("shell_quoted\\(\"notmuch\")")
+ (format #f "shell_quoted(~s)"
+ (search-input-file inputs "bin/notmuch")))
+ (("/usr/bin/sendmail")
+ (search-input-file inputs "/sbin/sendmail")))))
+ (replace 'check
+ (lambda* (#:key parallel-tests? tests? #:allow-other-keys)
+ (when tests?
+ (invoke "make" "-C" "tests"
+ "-j" (if parallel-tests?
+ (number->string (parallel-job-count))
+ "1")))))
+ (replace 'install
+ (lambda* _
+ (install-file "bower" (string-append #$output "/bin"))
+ (install-file "bower.1" (string-append #$output
+ "/share/man/man1")))))))
(native-inputs
(list diffutils
gawk
@@ -1569,14 +1568,14 @@ (define-public bower
pandoc
util-linux))
(inputs
- (list gpgme
- coreutils
+ (list coreutils
+ gpgme
+ ncurses
notmuch
- sendmail
- ncurses))
- (synopsis "Terminal client for the notmuch email system")
- (description "@code{bower} is a curses frontend for the notmuch email
-system. It is written in @{mercury}.")
+ sendmail))
+ (synopsis "Terminal client for the Notmuch email system")
+ (description "@code{bower} is a curses front-end for the Notmuch email
+system, written in the Mercury language.")
(license license:gpl3+)))
--8<---------------cut here---------------end--------------->8---
I also added:
--8<---------------cut here---------------start------------->8---
(properties `((cpe-name . "bower-cpe-refers-to-a-different-bower")))
--8<---------------cut here---------------end--------------->8---
After realizing the CPE database referred to a different package with
the same name, reporting a false positive.
And pushed!
Thank you,
Closing.
Maxim
^ permalink raw reply [flat|nested] 26+ messages in thread