GNU bug report logs - #50614
[PATCH core-updates] build: utils: Add ‘optional’ macro.

Previous Next

Package: guix-patches;

Reported by: Xinglu Chen <public <at> yoctocell.xyz>

Date: Thu, 16 Sep 2021 07:12:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Maxime Devos <maximedevos <at> telenet.be>
To: Xinglu Chen <public <at> yoctocell.xyz>, 50614 <at> debbugs.gnu.org
Cc: Sarah Morgensen <iskarian <at> mgsn.dev>, Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: [bug#50614] [PATCH core-updates v2] build: utils: Add ‘list-when’ macro.
Date: Sun, 19 Sep 2021 16:35:33 +0200
[Message part 1 (text/plain, inline)]
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.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 267 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.