guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#50614] [PATCH core-updates v2] build: utils: Add ‘list-when’ macro.


From: Maxime Devos
Subject: [bug#50614] [PATCH core-updates v2] build: utils: Add ‘list-when’ macro.
Date: Sun, 19 Sep 2021 16:35:33 +0200
User-agent: Evolution 3.34.2

Xinglu Chen schreef op zo 19-09-2021 om 15:50 [+0200]:
> * guix/build/utils.scm (list-when): New syntax
> * tests/build-utils.scm ("list-when: expr1 is non-#f", list-when: expr1 is 
> #f"):
>   Test it.
> * guix.texi (Build Utilities): Document it.
> * .dir-locals.el: Set ‘scheme-indent-function’ to 1 for ‘list-when’.
> ---

If you will be doing this in (guix build utils), leading to a world-rebuild,
you light want to define list-unless as well.  E.g., 'boost' has

    (native-inputs
     `(("perl" ,perl)
       ,@(if (%current-target-system)
             '()
             `(("python" ,python-wrapper)))
       ("tcsh" ,tcsh)))

with 'list-when', this could be rewritten to

    (native-inputs
     `(("perl" ,perl)
       ,@(list-when (not (%current-target-system))
           `("python" ,python-wrapper))
       ("tcsh" ,tcsh)))

but '(when (not ...) EXP ...)' is simply '(unless EXP ...)',
so it would be nice to be able to do

    (native-inputs
     `(("perl" ,perl)
       ,@(list-unless (%current-target-system)
           `("python" ,python-wrapper))
       ("tcsh" ,tcsh)))

Greetings,
Maxime.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]