help-guix
[Top][All Lists]
Advanced

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

Re: help with use of %current-target-system parameter and gexps


From: Thiago Jung Bauermann
Subject: Re: help with use of %current-target-system parameter and gexps
Date: Mon, 16 Aug 2021 16:30:19 -0300

Hello Mathieu,

Em domingo, 15 de agosto de 2021, às 03:02:42 -03, Mathieu Othacehe
escreveu:
> > +                ;; LuaJIT is not ported to powerpc64le* yet.
> > +                (if (string-prefix? "powerpc64le"
> > +                                    (or (%current-target-system)
> > +                                        (%current-system)))
> > +                    (substitute* fmtutilcnf
> > +                      (((string-append
> > "^(luajittex|luajithbtex|mfluajit)") m) +                      
> > (string-append "#! " m))))
> > 
> >                  ;; Register SHARE as TEXMFROOT in texmf.cnf.
> >                  (substitute* texmfcnf
> >                  
> >                    (("TEXMFROOT = \\$SELFAUTOPARENT")
> 
> The issue here is that the %current-target-system and %current-system
> are not defined at build time. You need to force their evaluation by
> using "unquote", this way:

Ah! I wasn’t aware of that trick. It indeed solved the problem. Thank you
very much for your help!

> --8<---------------cut here---------------start------------->8---
> (arguments
>  `(#:phases

‘texlive-texmf’  already has this quasiquote, so I only needed the unquote
below to make it work.

>    ...
>    (if (string-prefix? "powerpc64le"
>                       ,(or (%current-target-system)
>                            (%current-system)))
>       ...)))
> --8<---------------cut here---------------end--------------->8---
> 
> > +                #~(let-system (system target)
> > +                    ;; LuaJIT is not ported to powerpc64le* yet.
> 
> Here also you need to unquote this part, using "ungexp":
> 
> --8<---------------cut here---------------start------------->8---
>    #$(let-system (system target)
>       ...
> --8<---------------cut here---------------end--------------->8---

Not that it matters anymore, but just for completeness: unfortunately
I couldn’t make this one work. When I used “ungexp”, I got this error:

--8<---------------cut here---------------start------------->8---
[ 79%] GUILEC   gnu/packages/tex.go
gnu/packages/tex.scm:6832:24: warning: possibly unbound variable `substitute*'
gnu/packages/tex.scm:6832:24: warning: possibly unbound variable `fmtutilcnf'
gnu/packages/tex.scm:6833:27: warning: possibly unbound variable `m'
Compiling Scheme modules...
Compiling Scheme modules...
make[2]: Saindo do diretório '/home/debian/src/guix'

make[1]: Saindo do diretório '/home/debian/src/guix'

gnu/packages/tex.scm:6832:24: error: substitute*: unbound variable
hint: Did you forget `(use-modules (guix build utils))'?
--8<---------------cut here---------------end--------------->8---

I tried using this at the beginning of the gexp:

--8<---------------cut here---------------start------------->8---
            (with-imported-modules '((guix build utils))
              #~(begin
                  (use-modules ((guix build utils)))
                      ⋮
--8<---------------cut here---------------end--------------->8---

But it still resulted in the same error. But no problem, your “unquote”
solution worked.

-- 
Thanks,
Thiago





reply via email to

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