GNU bug report logs - #52268
[PATCH core-updates-frozen] gnu: Add texlive-latex-luatex.

Previous Next

Package: guix-patches;

Reported by: Thiago Jung Bauermann <bauermann <at> kolabnow.com>

Date: Sat, 4 Dec 2021 02:17:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52268 in the body.
You can then email your comments to 52268 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#52268; Package guix-patches. (Sat, 04 Dec 2021 02:17:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thiago Jung Bauermann <bauermann <at> kolabnow.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 04 Dec 2021 02:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thiago Jung Bauermann <bauermann <at> kolabnow.com>
To: guix-patches <at> gnu.org
Cc: Ricardo Wurmus <rekado <at> elephly.net>,
 John Kehayias <john.kehayias <at> protonmail.com>, 51252 <at> debbugs.gnu.org,
 Robin Templeton <robin <at> terpri.org>,
 Thiago Jung Bauermann <bauermann <at> kolabnow.com>
Subject: [PATCH core-updates-frozen] gnu: Add texlive-latex-luatex.
Date: Fri,  3 Dec 2021 23:16:11 -0300
When TeX Live was updated to version 2021 the ‘lualatex’ format started
being generated with the LuaHBTeX engine, but the ‘lualatex’ command still
uses the LuaTeX engine. This causes the command to fail:

  user <at> popigai:~$ lualatex hello.tex
  This is LuaTeX, Version 1.13.0 (TeX Live 2021/GNU Guix)
  restricted system commands enabled.

  ---! lualatex.fmt was written by luahbtex
  (Fatal format file error; I'm stymied)user <at> popigai:~$

The correct way to fix this problem would be either to change texlive-bin
to make ‘lualatex’ use the LuaHBTeX engine, or to change texlive-latex-base
to generate ‘lualatex.fmt’ with LuaTeX. Both options would rebuild large
parts of the world.

Ricardo Wurmus suggested creating a new package to provide ‘lualatex.fmt’
for LuaTeX as a workaround. This is what this package does.

Fixes https://issues.guix.gnu.org/51252.

* gnu/packages/tex.scm (texlive-latex-luatex): New variable.
---

Hello,

Strictly speaking, this patch solves the problem reported in issue 51252, but
I still cannot use ‘lualatex’ because of a problem with fonts:

--8<---------------cut here---------------start------------->8---
user <at> popigai:~$ lualatex hello.tex
This is LuaTeX, Version 1.13.0 (TeX Live 2021/GNU Guix)
 restricted system commands enabled.
(./hello.tex
LaTeX2e <2020-10-01> patch level 4
 L3 programming layer <2021-02-18> (/home/user/.guix-profile/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(/home/user/.guix-profile/share/texmf-dist/tex/latex/base/size10.clo
luaotfload | db : Font names database not found, generating new one.
luaotfload | db : This can take several minutes; please be patient.
luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: File not found: "lmroman10-regular".
! Font \TU/lmr/m/n/10=[lmroman10-regular]:+tlig; at 10pt not loadable: metric data not found or bad.
<to be read again>
relax
l.54 \normalsize

?
! Emergency stop.
<to be read again>
relax
l.54 \normalsize

 307 words of node memory still in use:
   1 hlist, 1 dir, 3 kern, 1 glyph, 1 attribute, 39 glue_spec, 1 attribute_list, 3 if_stack nodes
   avail lists: 2:7,3:3,4:1,5:1
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on hello.log.
--8<---------------cut here---------------end--------------->8---

This happens even though I have the packages texlive-base, texlive-lm and
texlive-fonts-latex installed in the profile. I suspect this is a problem with
luaotfload. I’ll poke at it a bit to see if I can find something out.

The reporter of 51252 doesn’t seem to hit this font issue, so perhaps this patch
will be enough for them.

In the (hopefuly) near future, I’ll submit a patch for core-updates changing
‘lualatex’ to use the LuaHBTeX engine and deprecating this package.

Thanks,
Thiago


 gnu/packages/tex.scm | 65 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 910be212ac17..256fe7da90bc 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -3746,6 +3746,71 @@ (define-public texlive-luaotfload
 
 (define-deprecated-package texlive-luatex-luaotfload texlive-luaotfload)
 
+;; FIXME: This package is a temporary workaround to provide ‘lualatex.fmt’ for
+;; the LuaTeX engine. It is needed because it was discovered too late in the
+;; core-updates-frozen cycle that texlive-latex-base only provides it for
+;; LuaHBTeX. See https://issues.guix.gnu.org/51252.
+(define-public texlive-latex-luatex
+  (package
+    (name "texlive-latex-luatex")
+    (version (number->string %texlive-revision))
+    (source #f)
+    (build-system gnu-build-system)
+    (arguments
+     `(#:modules ((guix build gnu-build-system)
+                  (guix build utils)
+                  (ice-9 rdelim)
+                  (ice-9 string-fun))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'unpack)
+         (delete 'bootstrap)
+         (delete 'configure)
+         (delete 'check)
+         (replace 'build
+           (lambda* (#:key inputs #:allow-other-keys)
+             (mkdir "web2c")
+             (let ((fmtutil.cnf-in (open-file
+                                    (string-append
+                                     (assoc-ref inputs "texlive-kpathsea")
+                                     "/share/texmf-dist/web2c/fmtutil.cnf")
+                                    "r"))
+                   (fmtutil.cnf-out (open-file "web2c/fmtutil.cnf" "w")))
+
+               ;; Copy ‘lualatex’ format lines to the new fmtutil.cnf, changing
+               ;; the engine from ‘luahbtex’ to ‘luatex’.
+               (do ((line "" (read-line fmtutil.cnf-in 'concat)))
+                   ((eof-object? line))
+                 (when (string-prefix? "lualatex" line)
+                   (display (string-replace-substring line "luahbtex" "luatex")
+                            fmtutil.cnf-out)))
+               (close-port fmtutil.cnf-out)
+               (close-port fmtutil.cnf-in)
+
+               (invoke "fmtutil" "--sys" "--all" "--fmtdir=web2c"
+                       "--cnffile=web2c/fmtutil.cnf")
+
+               ;; Don't risk this file interfering with anything else.
+               (delete-file "web2c/fmtutil.cnf"))))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((web2c (string-append %output "/share/texmf-dist/web2c")))
+               (mkdir-p web2c)
+               (copy-recursively "web2c" web2c)))))))
+    (native-inputs
+     `(("texlive-bin" ,texlive-bin)
+       ("texlive-babel" ,texlive-babel)
+       ("texlive-cm" ,texlive-cm)
+       ("texlive-fonts-latex" ,texlive-fonts-latex)
+       ("texlive-kpathsea" ,texlive-kpathsea)
+       ("texlive-latex-base" ,texlive-latex-base)
+       ("texlive-lm" ,texlive-lm)
+       ("texlive-tex-ini-files" ,texlive-tex-ini-files)))
+    (home-page (package-home-page texlive-latex-base))
+    (synopsis "LuaLaTeX format files for LuaTeX")
+    (description "This package is necessary to use LaTeX with the LuaTeX engine.")
+    (license (package-license texlive-latex-base))))
+
 (define-public texlive-latex-amsmath
   (package
     (name "texlive-latex-amsmath")

base-commit: 6d4f260166eb499564fa31ce487ecf301f445e4e




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 05 Dec 2021 18:08:02 GMT) Full text and rfc822 format available.

Notification sent to Thiago Jung Bauermann <bauermann <at> kolabnow.com>:
bug acknowledged by developer. (Sun, 05 Dec 2021 18:08:02 GMT) Full text and rfc822 format available.

Message #10 received at 52268-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Thiago Jung Bauermann <bauermann <at> kolabnow.com>
Cc: Ricardo Wurmus <rekado <at> elephly.net>,
 John Kehayias <john.kehayias <at> protonmail.com>, 51252-done <at> debbugs.gnu.org,
 Robin Templeton <robin <at> terpri.org>, 52268-done <at> debbugs.gnu.org
Subject: Re: bug#52268: [PATCH core-updates-frozen] gnu: Add
 texlive-latex-luatex.
Date: Sun, 05 Dec 2021 16:40:33 +0100
Hello,

Thiago Jung Bauermann <bauermann <at> kolabnow.com> skribis:

> When TeX Live was updated to version 2021 the ‘lualatex’ format started
> being generated with the LuaHBTeX engine, but the ‘lualatex’ command still
> uses the LuaTeX engine. This causes the command to fail:
>
>   user <at> popigai:~$ lualatex hello.tex
>   This is LuaTeX, Version 1.13.0 (TeX Live 2021/GNU Guix)
>   restricted system commands enabled.
>
>   ---! lualatex.fmt was written by luahbtex
>   (Fatal format file error; I'm stymied)user <at> popigai:~$
>
> The correct way to fix this problem would be either to change texlive-bin
> to make ‘lualatex’ use the LuaHBTeX engine, or to change texlive-latex-base
> to generate ‘lualatex.fmt’ with LuaTeX. Both options would rebuild large
> parts of the world.
>
> Ricardo Wurmus suggested creating a new package to provide ‘lualatex.fmt’
> for LuaTeX as a workaround. This is what this package does.
>
> Fixes https://issues.guix.gnu.org/51252.
>
> * gnu/packages/tex.scm (texlive-latex-luatex): New variable.

Applied, thanks!

I don’t fully understand the issue but it looks like a reasonable and
non-intrusive fix.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#52268; Package guix-patches. (Mon, 06 Dec 2021 22:55:02 GMT) Full text and rfc822 format available.

Message #13 received at 52268-done <at> debbugs.gnu.org (full text, mbox):

From: Thiago Jung Bauermann <bauermann <at> kolabnow.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>,
 John Kehayias <john.kehayias <at> protonmail.com>, 51252-done <at> debbugs.gnu.org,
 Robin Templeton <robin <at> terpri.org>, 52268-done <at> debbugs.gnu.org
Subject: Re: bug#52268: [PATCH core-updates-frozen] gnu: Add
 texlive-latex-luatex.
Date: Mon, 06 Dec 2021 19:53:51 -0300
Hello Ludo,

Em domingo, 5 de dezembro de 2021, às 12:40:33 -03, Ludovic Courtès 
escreveu:
> Thiago Jung Bauermann <bauermann <at> kolabnow.com> skribis:
> > Ricardo Wurmus suggested creating a new package to provide
> > ‘lualatex.fmt’ for LuaTeX as a workaround. This is what this package
> > does.
> > 
> > Fixes https://issues.guix.gnu.org/51252.
> > 
> > * gnu/packages/tex.scm (texlive-latex-luatex): New variable.
> 
> Applied, thanks!
> 
> I don’t fully understand the issue but it looks like a reasonable and
> non-intrusive fix.

Thank you!

-- 
Thanks,
Thiago






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Jan 2022 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 74 days ago.

Previous Next


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