guix: Add guard to texlive-configuration profile hook.

It is possible to generate a profile where this hook will crash, as the
texmf.cnf file does not exist to be patched by substitute*. A simple example
is the profile just containing texlive-fonts-txfonts.

* guix/profiles.scm (texlive-configuration): Check that the texmf.cnf file
exists before trying to change it.
master
Christopher Baines 2019-01-17 21:00:19 +00:00
parent 6654f8c144
commit cf22e99f02
No known key found for this signature in database
GPG Key ID: 5E28A33B0B84F577
1 changed files with 9 additions and 6 deletions

View File

@ -1363,12 +1363,15 @@ MANIFEST."
(manifest-entries manifest)) (manifest-entries manifest))
#:create-all-directories? #t #:create-all-directories? #t
#:log-port (%make-void-port "w")) #:log-port (%make-void-port "w"))
(substitute* (string-append #$output (let ((texmf.cnf (string-append
"/share/texmf-dist/web2c/texmf.cnf") #$output
(("^TEXMFROOT = .*") "/share/texmf-dist/web2c/texmf.cnf")))
(string-append "TEXMFROOT = " #$output "/share\n")) (when (file-exists? texmf.cnf)
(("^TEXMF = .*") (substitute* texmf.cnf
"TEXMF = $TEXMFROOT/share/texmf-dist\n")) (("^TEXMFROOT = .*")
(string-append "TEXMFROOT = " #$output "/share\n"))
(("^TEXMF = .*")
"TEXMF = $TEXMFROOT/share/texmf-dist\n"))))
#t))) #t)))
(with-monad %store-monad (with-monad %store-monad