* Re: Missing native-search-path for texlive
2015-11-30 13:07 ` Ludovic Courtès
@ 2015-11-30 13:30 ` Alex Vong
2015-11-30 14:20 ` Andreas Enge
1 sibling, 0 replies; 6+ messages in thread
From: Alex Vong @ 2015-11-30 13:30 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel
On 30/11/2015, Ludovic Courtès <ludo@gnu.org> wrote:
> Alex Vong <alexvong1995@gmail.com> skribis:
>
>> Yesterday, I try to use compile some document with context, so I
>> install texlive in guix. However, when I run "context --version", I
>> get the following error:
>>
>> mtxrun | unknown script 'context.lua' or 'mtx-context.lua'
>>
>> After doing some searching, I find out that the following works:
>>
>> $ TEXMF=`guix build texlive-texmf` context --version
>>
>> What should I add to native-search-path to set the TEXMF variable to
>> the output path?
>
> It ‘TEXMF’ really a search path, or is it rather a variable that should
> point to a single directory?
>
I think it is a search path since both
`TEXMF=/gnu/store/gb4y83bvcpkvdmz0dvi9rp507kbdbr5x-texlive-texmf-2015
context --version` and
`TEXMF=/gnu/store/gb4y83bvcpkvdmz0dvi9rp507kbdbr5x-texlive-texmf-2015/share
context --version` works. But otherwise, I don't know how environment
variables in texlive works. I see there are other environmental
variables as well. For instance, TEXINPUTS, TEXMFLOCAL and TEXMFHOME.
But only TEXMF and TEXMFHOME works.
> If the issue is limited to the ‘context’ program, then we may be better
> off wrapping ‘context’ such that ‘TEXMF’ is always set appropriately.
>
> Thoughts? Andreas?
>
> Ludo’.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Missing native-search-path for texlive
2015-11-30 13:07 ` Ludovic Courtès
2015-11-30 13:30 ` Alex Vong
@ 2015-11-30 14:20 ` Andreas Enge
2015-11-30 16:37 ` Alex Vong
2015-12-30 10:32 ` Andreas Enge
1 sibling, 2 replies; 6+ messages in thread
From: Andreas Enge @ 2015-11-30 14:20 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel
On Mon, Nov 30, 2015 at 02:07:00PM +0100, Ludovic Courtès wrote:
> It ‘TEXMF’ really a search path, or is it rather a variable that should
> point to a single directory?
It is a variable that works like a search path, but with a special syntax:
/gnu/store/gb4y83bvcpkvdmz0dvi9rp507kbdbr5x-texlive-texmf-2015/share/texmf-dist/web2c/texmf.cnf
contains a line
TEXMF = {$TEXMFCONFIG,$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFLOCAL,!!$TEXMFDIST}
The context binary itself is the following shell script:
#!/gnu/store/ibpm6n6706yimzr3967krkxi2ibxq5yh-bash-4.3.39/bin/bash
export TEXMFCNF="/gnu/store/gb4y83bvcpkvdmz0dvi9rp507kbdbr5x-texlive-texmf-2015/share/texmf-dist/web2c"
exec -a "$0" "/gnu/store/i11ykp24wbgq2lfz7gcz2v0f5h3sg7dg-texlive-bin-2015/share/texmf-dist/scripts/context/stubs/unix/context" "$@"
The variable TEXMFCNF gives the directory where texmf.cnf is to be found;
this configuration file contains the definition of TEXMF (composed of the
other variables). So one would expect the wrapper to be already in place,
provided by texlive.
The call in the last line is to the following shell script:
#!/gnu/store/311nvir0pz1mhf0mgsmfrw00qfj7yq0j-bash-4.3.39/bin/sh
mtxrun --script context "$@"
"mtxrun" is the following shell script:
#!/gnu/store/ibpm6n6706yimzr3967krkxi2ibxq5yh-bash-4.3.39/bin/bash
export TEXMFCNF="/gnu/store/gb4y83bvcpkvdmz0dvi9rp507kbdbr5x-texlive-texmf-2015/share/texmf-dist/web2c"
exec -a "$0" "/gnu/store/i11ykp24wbgq2lfz7gcz2v0f5h3sg7dg-texlive-bin-2015/bin/mtxrun" "$@"
Again, this is a wrapper setting TEXMFCNF.
The mtxrun binary is a lua script.
The following lines in the script could be of interest:
resolvers.criticalvars=allocate { "SELFAUTOLOC","SELFAUTODIR","SELFAUTOPARENT","TEXMFCNF","TEXMF","TEXOS" }
resolvers.luacnfname="texmfcnf.lua"
I suppose that the normal behaviour will then be to look for the file
texmfcnf.lua in the directory given by TEXMFCNF, set by the wrapper scripts.
This file seems to be a lua script that is equivalent to texmf.cnf.
We modify texmf.cnf to point to the correct directories, using a single
substitute:
(substitute* texmfcnf
(("TEXMFROOT = \\$SELFAUTOPARENT")
(string-append "TEXMFROOT = " share)))
which results in the line
TEXMFROOT = /gnu/store/gb4y83bvcpkvdmz0dvi9rp507kbdbr5x-texlive-texmf-2015/share
All further variables depend on TEXMFROOT.
So we should probably also modify texmfcnf.lua in a similar way.
Unfortunately, it contains a lot of selfautoparent and selfautodir;
we should replace them all at the same time.
I can propose a patch later.
Andreas
^ permalink raw reply [flat|nested] 6+ messages in thread