all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: jgart <jgart@dismail.de>, 50833@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#50833] [PATCH v2] gnu: Add bower.
Date: Wed, 20 Jul 2022 13:59:19 +0200	[thread overview]
Message-ID: <daf58596-3bd1-9798-14f7-84621197e6f8@telenet.be> (raw)
In-Reply-To: <20220720051833.23801-1-jgart@dismail.de>


[-- 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 --]

  reply	other threads:[~2022-07-20 12:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-27  1:01   ` Sarah Morgensen
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
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
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
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-08 19:42                         ` jgart via Guix-patches via
2022-07-14  8:54                           ` Munyoki Kilyungi
2022-07-11 16:09                     ` Maxim Cournoyer
2022-07-15  1:50                       ` 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
2022-07-20 11:59   ` Maxime Devos [this message]
2022-07-24 17:45     ` jgart via Guix-patches via
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

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

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

  git send-email \
    --in-reply-to=daf58596-3bd1-9798-14f7-84621197e6f8@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=50833@debbugs.gnu.org \
    --cc=jgart@dismail.de \
    --cc=maxim.cournoyer@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.