GNU bug report logs - #57963
[PATCH 0/1] Support user's fontconfig.

Previous Next

Package: guix-patches;

Reported by: Taiju HIGASHI <higashi <at> taiju.info>

Date: Wed, 21 Sep 2022 00:28:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Taiju HIGASHI <higashi <at> taiju.info>
To: "(" <paren <at> disroot.org>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 57963 <at> debbugs.gnu.org, Liliana Marie Prikler <liliana.prikler <at> gmail.com>, Andrew Tropin <andrew <at> trop.in>
Subject: [bug#57963] [PATCH v5 2/2] home: services: Support user's fontconfig configuration.
Date: Sun, 06 Nov 2022 22:24:47 +0900
"(" <paren <at> disroot.org> writes:

> Heya,
>
> On Fri Nov 4, 2022 at 8:46 AM GMT, Taiju HIGASHI wrote:
>> Sorry. I did not understand what you meant by making it a gexp-compiler
>> instead. Is there anything reference documents or codes?
>
> Guix's file-like objects are compiled into derivations using gexp-compilers,
> which may be defined using the ``define-gexp-compiler'' form. These two are
> equivalent:
>
>   ;;; with procedure
>
>   (define (foo->file-like foo)
>     "Turns FOO into a derivation."
>     (plain-file "foo"
>       (foo-text foo)))
>
>   ;; this way, you need to use foo->file-like whenever you want to use
>   ;; foo in place of a file-like object
>
>   (foo->file-like (foo (text "hello")))
>
>   ;;; with gexp compiler
>
>   (define-gexp-compiler (foo-compiler (foo <foo-record>) system target)
>     ;;
>     (lower-object
>      (plain-file "foo"
>        (foo-text foo))))
>
>   ;; now, a ``foo'' can be treated as a lowerable file-like object! you
>   ;; can put it anywhere you'd put a file-like.
>   (foo (text "hello"))
>
> So, basically, define-gexp-compiler lets you make new kinds of file-like
> object from records! This is actually how computed-file, file-append, et
> al are defined; see guix/gexp.scm. (Many of the gexp-compilers define both
> a compiler and an expander; the compiler is a derivation to build when
> the object is built, and the expander is the string to return when it's
> gexped. file-append [line 680 in my checkout] is a good, clear example of
> this.)
>
>     -- (

Thank you for your kindness.
I think I understand a little more now, and I will read the surrounding
source code to better understand it. Thanks to you, I may be able to
understand what was suggested earlier in this thread!

Thanks,
-- 
Taiju




This bug report was last modified 216 days ago.

Previous Next


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