unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Rostislav Svoboda <rostislav.svoboda@gmail.com>
To: Maxime Devos <maximedevos@telenet.be>
Cc: Julien Lepiller <julien@lepiller.eu>, 54852@debbugs.gnu.org
Subject: [bug#54852] [PATCH] gnu: Add openjdk18.
Date: Sat, 23 Apr 2022 17:11:18 +0200	[thread overview]
Message-ID: <CAEtmmezkOJddukPYmFRiWi1p9D5FaYotRchJoGhCD+gPjYcELg@mail.gmail.com> (raw)
In-Reply-To: <77993552c1ea4641522845b97adc8bd5d8a2691a.camel@telenet.be>

> > Here, (if such a pattern repeats) we could define a new syntax
> > `substitue` in the guix/packages.scm analogical to `delete`,
> > `prepend`, `append` and `replace`.
>
> Isn't this just (modify-inputs ... (replace "..." ...))?
>
> What's the difference between 'replace' and 'substitute'?  They
> conceptually seem to be about the same to me.  And in case of
> substitute, I'm more thinking of 'substitute*' than package inputs.

The lists `inputs`, `native-inputs` and `propagated-inputs` are lists
of association lists that map input labels to file names. E.g.:

(native-inputs
     `(("autoconf" ,autoconf)
       ("openjdk16:jdk" ,openjdk16 "jdk")
       ("pkg-config" ,pkg-config)
       ("unzip" ,unzip)
       ("which" ,which)
       ("zip" ,zip)))

The `replace` just replaces the file name for a given input label (see
guix/packages.scm, line 1099):

(define (replace-input name replacement inputs)
  "Replace input NAME by REPLACEMENT within INPUTS."
  (map (lambda (input)
         (match input
           (((? string? label) _ . outputs)
            (if (string=? label name)
                (match replacement        ;does REPLACEMENT specify an output?
                  ((_ _) (cons label replacement))
                  (_     (cons* label replacement outputs)))
                input))))
       inputs))

(define-syntax replace
  (lambda (s)
    (syntax-violation 'replace
                      "'replace' may only be used within 'modify-inputs'"
                      s)))

See also https://guix.gnu.org/en/blog/2021/the-big-change/

> I'm more thinking of 'substitute*' than package inputs.

That thing which I named `substitute` doesn't exist. I was just
contemplating that we could write it, if we want to change the whole
association list, i.e. the pair input label & file name, not just the
file name. (And when I think about it again, such a name will lead to
confusion. So nah, forget about it.)

Cheers
Bost




  reply	other threads:[~2022-04-23 15:14 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 12:53 [bug#54852] [PATCH] gnu: Add openjdk18 Rostislav Svoboda
2022-04-11 13:43 ` Maxime Devos
2022-04-12 13:03   ` Rostislav Svoboda
2022-04-11 13:44 ` Maxime Devos
2022-04-12 13:24   ` Rostislav Svoboda
2022-04-21 10:27     ` Rostislav Svoboda
2022-04-21 16:38       ` Maxime Devos
2022-04-22 10:59         ` Rostislav Svoboda
2022-04-23 14:38           ` Maxime Devos
2022-04-23 15:11             ` Rostislav Svoboda [this message]
2022-04-23 16:10               ` Maxime Devos
2022-04-11 14:15 ` Julien Lepiller
2022-04-13  7:51   ` Björn Höfling
2022-05-08 16:41 ` Maxime Devos
2022-05-09 19:11 ` Maxime Devos
2022-05-09 22:20   ` Rostislav Svoboda
2022-05-10  6:59     ` Maxime Devos
2022-05-11 15:37       ` Rostislav Svoboda
2022-05-11 18:13         ` Maxime Devos
2022-05-11 18:22         ` Maxime Devos
2022-05-11 18:30         ` Maxime Devos
2022-09-27 14:17         ` bug#54852: " 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

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

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

  git send-email \
    --in-reply-to=CAEtmmezkOJddukPYmFRiWi1p9D5FaYotRchJoGhCD+gPjYcELg@mail.gmail.com \
    --to=rostislav.svoboda@gmail.com \
    --cc=54852@debbugs.gnu.org \
    --cc=julien@lepiller.eu \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).