gnu: texlive: Fix 'texmf-local' search path.
Commit Message
see https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00122.html
Fede
Comments
Hello Fede,
apologies for not coming back to you earlier, I have little occasion to
work on Guix right now.
On Sun, Jun 12, 2016 at 10:56:40AM +0200, Federico Beffa wrote:
> (substitute* texmfcnf
> (("TEXMFROOT = \\$SELFAUTOPARENT")
> - (string-append "TEXMFROOT = " share)))
> + (string-append "TEXMFROOT = " share))
> + (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
> + "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
> + (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
As said before, this change should be benign, but also without effect:
It still points to some place in the store, actually to the directory
/gnu/store/...-texlive-2015/share/texmf-local ,
which does not exist.
If we keep it, for clarity I would use
TEXMFLOCAL = $TEXMFROOT/texmf-local
(as for the other variables defined around it), and add a comment that this
declaration does not actually come into effect.
(Well, it _could_ be used by system administrators that define a local
variant of texlive with additional data in this subdirectory.)
I agree that this is a cleaner solution; maybe texmfcnf.lua needs to be
adapted as well?
We could also do something
> + (native-search-paths
> + (list (search-path-specification
> + (variable "TEXMFLOCAL")
> + (files '("share/texmf-local")))))
This seems to be the main goal of your patch: By redefining TEXMFLOCAL in the
profile, it will point to $HOME/.guix-profile/share/texmf-local. So if we add
packages to the distribution that put data there, it should be available to
texlive. Do you have an example package in mind? Does it work? Currently
I cannot test it on my machine.
There would be an alternative for people running Guix on top of another
distro: We could set TEXMFLOCAL to /usr/share/texmf; then system installed
texlive data could be used. This would work as long as the search path is
not overwritten by a Guix installed package (which we do not have so far).
Looking forward to some more discussion on the topic,
Andreas
On Mon, Jun 20, 2016 at 10:58 AM, Andreas Enge <andreas@enge.fr> wrote:
> Hello Fede,
>
> apologies for not coming back to you earlier, I have little occasion to
> work on Guix right now.
>
> On Sun, Jun 12, 2016 at 10:56:40AM +0200, Federico Beffa wrote:
>> (substitute* texmfcnf
>> (("TEXMFROOT = \\$SELFAUTOPARENT")
>> - (string-append "TEXMFROOT = " share)))
>> + (string-append "TEXMFROOT = " share))
>> + (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
>> + "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
>> + (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
>
> As said before, this change should be benign, but also without effect:
> It still points to some place in the store, actually to the directory
> /gnu/store/...-texlive-2015/share/texmf-local ,
> which does not exist.
Hi Andreas,
you are right, TEXMFLOCAL does still point to a nonexistent store
directory, but it is the "right" directory inside of the texlive
package tree. Without this it points to a location outside of every
package/profile tree. Consider it an aesthetics improvement ;-)
> If we keep it, for clarity I would use
> TEXMFLOCAL = $TEXMFROOT/texmf-local
> (as for the other variables defined around it), and add a comment that this
> declaration does not actually come into effect.
I think $SELFAUTODIR is the recommended way (in the TeXLive doc and in
comments inside of texmfcnf), but if you prefer we can use TEXMFROOT.
Note that the last entry in 'substitute*' is not just cosmetic: It
instructs TeX & friends not to look for ls-r databases, but to scan
the directory tree. If we would keep the '!!' prefixes to TEXMFLOCAL,
it would not work without adding a profile hook to generate the ls-r
database. As long as we do not have a large set of packages installing
into share/texmf-local, the speed penalty should be essentially
unnoticeable.
> I agree that this is a cleaner solution; maybe texmfcnf.lua needs to be
> adapted as well?
I have no idea about the purpose of this file. I don't find it
mentioned in the documentation
https://www.tug.org/texlive/doc/texlive-en/texlive-en.pdf. What is it
for?
>> + (native-search-paths
>> + (list (search-path-specification
>> + (variable "TEXMFLOCAL")
>> + (files '("share/texmf-local")))))
>
> This seems to be the main goal of your patch: By redefining TEXMFLOCAL in the
> profile, it will point to $HOME/.guix-profile/share/texmf-local. So if we add
> packages to the distribution that put data there, it should be available to
> texlive. Do you have an example package in mind? Does it work? Currently
> I cannot test it on my machine.
Yes, correct. However, as explained before, it only works in
conjunction with the removal of the '!!' prefix in texmfcnf.
The attached file includes a package called 'chez-web' which installs
a TeX macro. The package 'chez-sockets' makes use of the former and
does work as expected.
>
> There would be an alternative for people running Guix on top of another
> distro: We could set TEXMFLOCAL to /usr/share/texmf; then system installed
> texlive data could be used. This would work as long as the search path is
> not overwritten by a Guix installed package (which we do not have so far).
Personally I would prefer to avoid explicit cross-referencing between
Guix packages and non-Guix ones.
Regards,
Fede
P.S.: I have the package definitions in a local module. If you want to
try the packages I can share it with you. In the future I may send
patches to include them in Guix proper.
From 0e1a6b04d0180c427aa3c4298084ff0c495c9ff9 Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Sun, 12 Jun 2016 09:49:06 +0200
Subject: [PATCH] gnu: texlive: Fix 'texmf-local' search path.
* gnu/packages/texlive.scm (texlive, texlive-minimal): Add
'native-search-paths'.
(texlive-texmf): Correct 'TEXMFLOCAL' definition in 'texmf.cnf' in
'texmf-config' phase.
---
gnu/packages/texlive.scm | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
@@ -2,6 +2,7 @@
;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -203,7 +204,10 @@ This package contains the binaries.")
;; Register SHARE as TEXMFROOT in texmf.cnf.
(substitute* texmfcnf
(("TEXMFROOT = \\$SELFAUTOPARENT")
- (string-append "TEXMFROOT = " share)))
+ (string-append "TEXMFROOT = " share))
+ (("TEXMFLOCAL = \\$SELFAUTOGRANDPARENT/texmf-local")
+ "TEXMFLOCAL = $SELFAUTODIR/share/texmf-local")
+ (("!!\\$TEXMFLOCAL") "$TEXMFLOCAL"))
;; Register paths in texmfcnf.lua, needed for context.
(substitute* (string-append texmfroot "/texmfcnf.lua")
(("selfautodir:") out)
@@ -238,6 +242,10 @@ This package contains the complete tree of texmf-dist data.")
(inputs `(("bash" ,bash) ; for wrap-program
("texlive-bin" ,texlive-bin)
("texlive-texmf" ,texlive-texmf)))
+ (native-search-paths
+ (list (search-path-specification
+ (variable "TEXMFLOCAL")
+ (files '("share/texmf-local")))))
(arguments
`(#:modules ((guix build utils))
#:builder
@@ -349,6 +357,10 @@ This package contains a small subset of the texmf-dist data.")))
(inputs
`(("texlive-texmf" ,texlive-texmf-minimal)
,@(alist-delete "texlive-texmf" (package-inputs texlive))))
+ (native-search-paths
+ (list (search-path-specification
+ (variable "TEXMFLOCAL")
+ (files '("share/texmf-local")))))
(description
"TeX Live provides a comprehensive TeX document production system.
It includes all the major TeX-related programs, macro packages, and fonts
--
2.7.4