Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texlive: TEXMFLOCAL should not point to TEXMFDIST #58026

Closed
clefru opened this issue Mar 21, 2019 · 5 comments
Closed

texlive: TEXMFLOCAL should not point to TEXMFDIST #58026

clefru opened this issue Mar 21, 2019 · 5 comments
Labels
6.topic: TeX Issues regarding texlive and TeX in general

Comments

@clefru
Copy link
Contributor

clefru commented Mar 21, 2019

TEXMF defines the order in which files are read in texmf.cnf

TEXMF = {
  $TEXMFAUXTREES$TEXMFCONFIG,
  $TEXMFVAR,
  $TEXMFHOME,
  !!$TEXMFLOCAL,
  !!$TEXMFSYSCONFIG,
  !!$TEXMFSYSVAR,
  !!$TEXMFDIST}

The idea is that TEXMFSYSVAR and TEXMFCONFIG files take precedence over files distributed with TEXMFDIST, so there is a way for the user to override configuration files. Our texmf.cnf lists:

% The main tree of distributed packages and programs:
TEXMFDIST = $TEXMFROOT/texmf
% TEXMFSYSVAR, where *-sys store cached runtime data.
TEXMFSYSVAR = $TEXMFROOT/texmf-var
% TEXMFSYSCONFIG, where *-sys store configuration data.
TEXMFSYSCONFIG = $TEXMFROOT/texmf-config

This seems all fine, except that our derivation also makes TEXMFLOCAL point to TEXMFDIST as well, and this destroys override-ability.

% Local additions to the distribution trees.
TEXMFLOCAL = /nix/store/hd53vrfqj7j3cb178x5zk5019kf7dc5g-texlive-combined-2018/share/texmf

My suggestion is to use a separate and empty $out/share/texmf-local for TEXMFLOCAL.

clefru added a commit to clefru/nixpkgs that referenced this issue Mar 21, 2019
@veprbl veprbl added the 6.topic: TeX Issues regarding texlive and TeX in general label Mar 21, 2019
@veprbl
Copy link
Member

veprbl commented Mar 21, 2019

Could you please provide an example of the override that doesn't work?

@clefru
Copy link
Contributor Author

clefru commented Mar 22, 2019

I dropped my customization here:
https://gist.github.com/clefru/9ed1186bf0b76d27e0ad20cbd9966b87

It boils down to adding a custom package (minionpro availble for my NUR overlay) and running:

perl `type -P updmap.pl` --sys --enable Map=MinionPro.map --enable Map=MyriadPro.map

in postBuild.

@veprbl
Copy link
Member

veprbl commented Mar 23, 2019

I investigated your override. I see that you sneak the original updmap.cnf, then add your font to it and regenerate the mappings which go to share/texmf-var. At the same time our texlive setup just reuses prebuilt maps provided by texlive.updmap-map (for pdftex), individual font packages and others and those are installed into share/texmf which happens to be also pointed by TEXMFLOCAL. I also now discover that the line

perl `type -P updmap.pl` --sys --syncwithtrees --force

does nothing for us.

Your change makes sense to me. Makes me wonder if we could do better. For example, not deleting share/texmf/web2c/updmap.cnf should not hurt anything. I could not find any way to automatically scan for new entries for updmap.cnf. The Gentoo documentation mentions [1] concatenating it from /etc/texmf/updmap.d.

[1] https://wiki.gentoo.org/wiki/Project:TeX/Tex_Live_Migration_Guide#updmap.cfg

@clefru
Copy link
Contributor Author

clefru commented Mar 24, 2019

@veprbl First of all thank you for taking such a careful look at my code snippet. I really appreciate it!

First, yes, I sneak out and later sneak updmap.cfg back in. I do think that there are no adverse side-effects from not deleting updmap.cfg in texlive.combine. I will submit a PR to remove it.

This will minimize my postBuild override to just:

updmap --sys --syncwithtrees --force #  I am not sure if this is necessary still.
updmap --sys --enable MinionPro.map --enable MyriadPro.map
updmap --sys

That looks much cleaner :)

As there is no real "hooks" functionality in our texlive package derivation, it seems to be a good idea to optimistically merge (by concatenation) separate updmap.cfg snippets. I will file a separate issue to discuss this.

clefru added a commit to clefru/nixpkgs that referenced this issue Mar 24, 2019
veprbl pushed a commit that referenced this issue Mar 24, 2019
@clefru clefru mentioned this issue Mar 24, 2019
10 tasks
clefru added a commit to clefru/nixpkgs that referenced this issue Mar 25, 2019
@veprbl veprbl closed this as completed May 11, 2019
@clefru
Copy link
Contributor Author

clefru commented May 11, 2019

@veprbl Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: TeX Issues regarding texlive and TeX in general
Projects
None yet
Development

No branches or pull requests

2 participants