GNU bug report logs - #78424
[PATCH] gnu: texlive-libkpathsea: Add definitions for XDG paths.

Previous Next

Package: guix-patches;

Reported by: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Date: Wed, 14 May 2025 11:51:05 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 78424 AT debbugs.gnu.org.

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

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


Report forwarded to andreas <at> enge.fr, guix <at> nicolasgoaziou.fr, guix-patches <at> gnu.org:
bug#78424; Package guix-patches. (Wed, 14 May 2025 11:51:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Liliana Marie Prikler <liliana.prikler <at> gmail.com>:
New bug report received and forwarded. Copy sent to andreas <at> enge.fr, guix <at> nicolasgoaziou.fr, guix-patches <at> gnu.org. (Wed, 14 May 2025 11:51:06 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: texlive-libkpathsea: Add definitions for XDG paths.
Date: Wed, 14 May 2025 13:46:01 +0200
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.
---
 gnu/packages/tex.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 99a65641a4a..e2fe5554a0c 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -296,6 +296,9 @@ (define-public texlive-source
 (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,21 @@ (define-public texlive-libkpathsea
 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
+            (add-after 'customize-texmf.cnf 'fix-texmf.cnf
+              (lambda _
+                (substitute* "texk/kpathsea/texmf.cnf"
+                  (("^TEXMFVAR = .*" all)
+                   (string-append "XDG_CACHE_HOME = ~/.cache\n" all))
+                  (("^TEXMFCONFIG = .*" all)
+                   (string-append "XDG_CONFIG_HOME = ~/.config\n" all)))))))))))
+
 (define-public texlive-libptexenc
   (package
     (name "texlive-libptexenc")

base-commit: 5f5d84beccc180f1b51474c0e47eb6e0d0c9175f
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78424; Package guix-patches. (Fri, 16 May 2025 06:59:04 GMT) Full text and rfc822 format available.

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

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 78424 <at> debbugs.gnu.org, guix <at> nicolasgoaziou.fr, andreas <at> enge.fr
Subject: Re: [bug#78424] [PATCH] gnu: texlive-libkpathsea: Add definitions
 for XDG paths.
Date: Fri, 16 May 2025 08:58:35 +0200
Hello,

Liliana Marie Prikler <liliana.prikler <at> gmail.com> writes:

> 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.
> ---
>  gnu/packages/tex.scm | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
> index 99a65641a4a..e2fe5554a0c 100644
> --- a/gnu/packages/tex.scm
> +++ b/gnu/packages/tex.scm
> @@ -296,6 +296,9 @@ (define-public texlive-source
>  (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,21 @@ (define-public texlive-libkpathsea
>  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
> +            (add-after 'customize-texmf.cnf 'fix-texmf.cnf
> +              (lambda _
> +                (substitute* "texk/kpathsea/texmf.cnf"
> +                  (("^TEXMFVAR = .*" all)
> +                   (string-append "XDG_CACHE_HOME = ~/.cache\n" all))
> +                  (("^TEXMFCONFIG = .*" all)
> +                   (string-append "XDG_CONFIG_HOME = ~/.config\n" all)))))))))))

It looks good.

Perhaps we could also fix in an additional step a little mistake
I introduced in the recent TeX Live update: cache and config files are
created in, e.g., "$XDG_CACHE_HOME/.texliveYYYY/texmf-var", but it would
make sense to put them in "$XDG_CACHE_HOME/texliveYYYY/texmf-var"
instead.

WDYT?

Regards,
-- 
Nicolas Goaziou






Information forwarded to guix-patches <at> gnu.org:
bug#78424; Package guix-patches. (Fri, 16 May 2025 19:48:02 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 78424 <at> debbugs.gnu.org, guix <at> nicolasgoaziou.fr, andreas <at> enge.fr
Subject: Re: [bug#78424] [PATCH] gnu: texlive-libkpathsea: Add definitions
 for XDG paths.
Date: Fri, 16 May 2025 21:47:03 +0200
Am Freitag, dem 16.05.2025 um 08:58 +0200 schrieb Nicolas Goaziou:
> Hello,
> 
> Liliana Marie Prikler <liliana.prikler <at> gmail.com> writes:
> 
> > 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.
> > ---
> >  gnu/packages/tex.scm | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> > 
> > diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
> > index 99a65641a4a..e2fe5554a0c 100644
> > --- a/gnu/packages/tex.scm
> > +++ b/gnu/packages/tex.scm
> > @@ -296,6 +296,9 @@ (define-public texlive-source
> >  (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,21 @@ (define-public texlive-libkpathsea
> >  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
> > +            (add-after 'customize-texmf.cnf 'fix-texmf.cnf
> > +              (lambda _
> > +                (substitute* "texk/kpathsea/texmf.cnf"
> > +                  (("^TEXMFVAR = .*" all)
> > +                   (string-append "XDG_CACHE_HOME = ~/.cache\n"
> > all))
> > +                  (("^TEXMFCONFIG = .*" all)
> > +                   (string-append "XDG_CONFIG_HOME = ~/.config\n"
> > all)))))))))))
> 
> It looks good.
> 
> Perhaps we could also fix in an additional step a little mistake
> I introduced in the recent TeX Live update: cache and config files
> are created in, e.g., "$XDG_CACHE_HOME/.texliveYYYY/texmf-var", but
> it would make sense to put them in
> "$XDG_CACHE_HOME/texliveYYYY/texmf-var" instead.
Sure, I don't see a problem with that.  Do you want to push this or
should I go?

Cheers




Information forwarded to guix-patches <at> gnu.org:
bug#78424; Package guix-patches. (Sat, 17 May 2025 09:45:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 78424 <at> debbugs.gnu.org, guix <at> nicolasgoaziou.fr, andreas <at> enge.fr
Subject: Re: [bug#78424] [PATCH] gnu: texlive-libkpathsea: Add definitions
 for XDG paths.
Date: Sat, 17 May 2025 11:44:36 +0200
Hello,

Liliana Marie Prikler <liliana.prikler <at> gmail.com> writes:

> Am Freitag, dem 16.05.2025 um 08:58 +0200 schrieb Nicolas Goaziou:
>> Perhaps we could also fix in an additional step a little mistake
>> I introduced in the recent TeX Live update: cache and config files
>> are created in, e.g., "$XDG_CACHE_HOME/.texliveYYYY/texmf-var", but
>> it would make sense to put them in
>> "$XDG_CACHE_HOME/texliveYYYY/texmf-var" instead.
> Sure, I don't see a problem with that.  Do you want to push this or
> should I go?

Please be my guest ;)

Thank you!

Regards,
-- 
Nicolas Goaziou






Information forwarded to guix-patches <at> gnu.org:
bug#78424; Package guix-patches. (Sat, 17 May 2025 11:51:02 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: 78424 <at> debbugs.gnu.org
Cc: andreas <at> enge.fr, guix <at> nicolasgoaziou.fr
Subject: [PATCH v2] gnu: texlive-libkpathsea: Add definitions for XDG paths.
Date: Wed, 14 May 2025 13:46:01 +0200
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.
---
For v2, I'm replacing the entire phase, because this makes it easier to strip
the leading dot and should also make it easier to ungraft.

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

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 31b7d9ff566..b47baec3497 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -296,6 +296,9 @@ (define-public texlive-source
 (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 @@ (define-public texlive-libkpathsea
 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")

base-commit: 9f3d8dbda60bb1dd15d2956c334354947df8b3f5
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78424; Package guix-patches. (Sun, 18 May 2025 09:08:02 GMT) Full text and rfc822 format available.

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

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 78424 <at> debbugs.gnu.org, guix <at> nicolasgoaziou.fr, andreas <at> enge.fr
Subject: Re: [bug#78424] [PATCH v2] gnu: texlive-libkpathsea: Add
 definitions for XDG paths.
Date: Sun, 18 May 2025 11:07:48 +0200
Hello,

Liliana Marie Prikler <liliana.prikler <at> gmail.com> writes:

> 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.
> ---
> For v2, I'm replacing the entire phase, because this makes it easier to strip
> the leading dot and should also make it easier to ungraft.

LGTM. Thank you!

Regards,
-- 
Nicolas Goaziou






Information forwarded to guix-patches <at> gnu.org:
bug#78424; Package guix-patches. (Mon, 02 Jun 2025 13:41:02 GMT) Full text and rfc822 format available.

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

From: Andreas Enge <andreas <at> enge.fr>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 78424 <at> debbugs.gnu.org, guix <at> nicolasgoaziou.fr,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#78424] [PATCH v2] gnu: texlive-libkpathsea: Add definitions
 for XDG paths.
Date: Mon, 2 Jun 2025 15:40:23 +0200
Hello,

if I see correctly, this adds a graft for a not security related issue.
Then I think that instead, we should create a tex-team branch and build
out the branch with all needed changes.

Andreas





This bug report was last modified 11 days ago.

Previous Next


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