diff options
author | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2025-05-14 13:46:01 +0200 |
---|---|---|
committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2025-05-18 17:00:06 +0200 |
commit | 91a81927345394c9f52bca6ecf743f48cd24d250 (patch) | |
tree | 830f26f31fd82c7f86216a11883b7b46d810fa86 | |
parent | f408a00fe2f3ed4148283319438cb96f170249ba (diff) | |
download | guix-91a81927345394c9f52bca6ecf743f48cd24d250.tar.gz guix-91a81927345394c9f52bca6ecf743f48cd24d250.zip |
gnu: texlive-libkpathsea: Add definitions for XDG paths.
Without these paths set, if they are unset in the environment, jobs that need
to read from/write to TEXMFVAR or TEXMFCONFIG will fail. If set, environment
variables take precedence.
* gnu/packages/tex.scm (texlive-libkpathsea): Add replacement, pointing to…
(texlive-libkpathsea/fixed): … this. Add definitions for XDG_CACHE_HOME and
XDG_CONFIG_HOME.
Reviewed-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
-rw-r--r-- | gnu/packages/tex.scm | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 31b7d9ff56..b47baec349 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -296,6 +296,9 @@ should not be installed in a profile.") (define-public texlive-libkpathsea (package (name "texlive-libkpathsea") + ;; TODO: ungraft on tex-team or a dedicated branch, + ;; integrating the missing definitions. + (replacement texlive-libkpathsea/fixed) (version (package-version texlive-source)) (source (origin @@ -395,6 +398,47 @@ should not be installed in a profile.") of user-specified directories similar to how shells look up executables.") (license license:lgpl2.1))) +(define texlive-libkpathsea/fixed + (package + (inherit texlive-libkpathsea) + (arguments + (substitute-keyword-arguments (package-arguments texlive-libkpathsea) + ((#:phases phases) + #~(modify-phases #$phases + (replace 'customize-texmf.cnf + (lambda _ + (substitute* "texk/kpathsea/texmf.cnf" + (("^TEXMFROOT = .*") "TEXMFROOT = {$GUIX_TEXMF}/..\n") + (("^TEXMFDIST = .*") "TEXMFDIST = {$GUIX_TEXMF}\n") + ;; Use XDG recommendations for local variables. Also ignore + ;; system-wide cache, which is not writable; use local one + ;; instead, i.e., "$XDG_CACHE_HOME/texliveYYYY/texmf-var/". + (("^TEXMFVAR = ~/\\.") + (string-append "XDG_CACHE_HOME = ~/.cache\n" + "TEXMFVAR = $XDG_CACHE_HOME/")) + (("^TEXMFCONFIG = ~/\\.") + (string-append "XDG_CONFIG_HOME = ~/.config\n" + "TEXMFCONFIG = $XDG_CONFIG_HOME/")) + (("^TEXMFCACHE = .*") "TEXMFCACHE = $TEXMFVAR\n") + ;; "ls-R" files are to be expected only in the TEXMFDIST + ;; directories. TEXMFLOCAL is not necessary for Guix, but + ;; could be required anyway by external TeX installations. + (("^TEXMF = .*") + "TEXMF = {$TEXMFCONFIG,$TEXMFVAR,$TEXMFHOME,!!TEXMFLOCAL,TEXMFSYSVAR,TEXMFSYSCONFIG,!!$TEXMFDIST}\n") + (("^TEXMFDBS = .*") "TEXMFDBS = {!!$TEXMFLOCAL,!!$TEXMFDIST}\n") + ;; Set TEXMFCNF. Since earlier values of variables have + ;; precedence over later ones, insert the desired value first. + (("^TEXMFCNF =") + (string-append + "TEXMFCNF = " #$output "/share/texmf-dist/web2c\n" + "TEXMFCNF =")) + ;; Help TeX finding fonts installed on the system. + (("^OSFONTDIR = .*") "OSFONTDIR = {$XDG_DATA_DIRS}\n") + ;; Don't truncate lines. + (("^error_line = .*$") "error_line = 254\n") + (("^half_error_line = .*$") "half_error_line = 238\n") + (("^max_print_line = .*$") "max_print_line = 1000\n")))))))))) + (define-public texlive-libptexenc (package (name "texlive-libptexenc") |