aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2024-06-12 21:15:44 +0200
committerLudovic Courtès <ludo@gnu.org>2024-08-31 10:45:20 +0200
commitb385b88638e411c69bf48057611dd82dc203aa64 (patch)
treeee3c6a4363448cd7eba82752a9c283b49bae250c /gnu
parenta1daaaf30bfe05fb4cae698f148546ae1ffd463b (diff)
downloadguix-b385b88638e411c69bf48057611dd82dc203aa64.tar
guix-b385b88638e411c69bf48057611dd82dc203aa64.tar.gz
gnu: texlive-updmap.cfg: Fix font file creation in $HOME.
* gnu/packages/tex.scm (texlive-updmap.cfg): Clarify usage. Prevent mktex scripts from creating files in TEXMFVAR by including a "mktex.cnf" that overrides the one from TEXLIVE-KPATHSEA. Change-Id: I8025582e8ecdd4f57fb8f266d987e6bc1e755e93
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/tex.scm23
1 files changed, 18 insertions, 5 deletions
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 6ce6ae6e8e..ae2aeb0c70 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -1211,8 +1211,12 @@ teTeX distribution that was maintained by Thomas Esser.")
;; inputs.
(define-public texlive-updmap.cfg
(lambda* (#:optional (packages '()))
- "Return a 'texlive-updmap.cfg' package which contains the fonts map
-configuration of a base set of packages plus PACKAGES."
+ "Return a 'texlive-updmap.cfg' package which contains the fonts map and
+mktex scripts configuration, along with a base set of packages plus additional
+PACKAGES.
+
+This function is meant to be used in packages as a native input, to build
+documentation in the TeX format."
(let ((default-packages (list texlive-scheme-basic)))
(package
(version (number->string %texlive-revision))
@@ -1227,9 +1231,18 @@ configuration of a base set of packages plus PACKAGES."
(ice-9 textual-ports))
#:install-plan
#~'(("texmf-dist/web2c/updmap.cfg" "share/texmf-config/web2c/")
- ("texmf-dist/web2c/map" "share/texmf-dist/fonts/map"))
+ ("texmf-dist/web2c/mktex.cnf" "share/texmf-config/web2c/")
+ ("texmf-dist/web2c/map" "share/texmf-dist/fonts/map"))
#:phases
#~(modify-phases %standard-phases
+ (add-after 'unpack 'generate-mktex.cnf
+ ;; When building a package, mktex programs try to create files
+ ;; in TEXMFVAR, which is unavailable. Force creating those
+ ;; files in the working directory instead.
+ (lambda _
+ (with-directory-excursion "texmf-dist/web2c"
+ (with-output-to-file "mktex.cnf"
+ (lambda _ (display ": ${MT_DESTROOT=''}"))))))
(add-before 'install 'regenerate-updmap.cfg
(lambda _
(with-directory-excursion "texmf-dist/web2c"
@@ -1244,8 +1257,8 @@ configuration of a base set of packages plus PACKAGES."
(when (not (zero? (status:exit-val (close-pipe port))))
(error "failed to filter updmap.cfg")))
- ;; Set TEXMFSYSVAR to a sane and writable value; updmap fails
- ;; if it cannot create its log file there.
+ ;; Set TEXMFSYSVAR to a sane and writable value; updmap
+ ;; fails if it cannot create its log file.
(setenv "TEXMFSYSVAR" (getcwd))
;; Generate maps.