NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.36k stars 13.59k forks source link

lm-math font packaged 4 times #76923

Closed Mathnerd314 closed 4 years ago

Mathnerd314 commented 4 years ago

A grep of lm-math:

pkgs/data/fonts/lm-math/default.nix:  url = "http://www.gust.org.pl/projects/e-foundry/lm-math/download/latinmodern-math-1959.zip";
pkgs/data/fonts/lmodern/lmmath.nix:  url = "http://www.gust.org.pl/projects/e-foundry/lm-math/download/lmmath0903otf";
pkgs/tools/typesetting/satysfi/default.nix:  lm-math = fetchzip {
pkgs/tools/typesetting/satysfi/default.nix:    url = "http://www.gust.org.pl/projects/e-foundry/lm-math/download/latinmodern-math-1959.zip";
pkgs/tools/typesetting/satysfi/default.nix:      cp -r ${lm-math}/otf/latinmodern-math.otf lib-satysfi/dist/fonts/
pkgs/tools/typesetting/tex/texlive/fixedHashes.nix:"lm-math-1.959"="j995x0y357lac8mn1kzn9v8p3v995bz7";

The latest version is 1.959 per http://www.gust.org.pl/projects/e-foundry/lm-math/download.

I'd say that the texlive and fonts/lm-math versions can stay as they have different paths (fonts/opentype/public/lm-math/latinmodern-math.otf vs share/fonts/opentype/latinmodern-math.otf), although ideally just the texlive version would stay, but the others are not helping anything at all.

Mathnerd314 commented 4 years ago

cc @langston-barrett @7c6f434c @mt-caret @vbgl @veprbl for comments

veprbl commented 4 years ago

So, perhaps, we should keep the implementation of latinmodern-math under the name lmmath and make latinmodern-math an alias. The satysfi needs to be fixed to use existing packages (also implements a duplicate of lmodern).

Mathnerd314 commented 4 years ago

Well, for texmf one would presumably use the TexLive package, as it has separated run and doc outputs unlike the other packages. And it auto-updates along with the rest of TexLive.

The only issue with using it as the sole package is that it's not a multiple output derivation so using it in the fonts list looks like

builtins.elemAt texlive.lm-math.pkgs 0

rather than just texlive.lm-math.

It shouldn't be that hard to set up TexLive to have attributes usable directly, by setting outPath and so forth. Nix doesn't support multiple outputs for fixed-output derivations, so it'd be a bit of a hack.

veprbl commented 4 years ago

The "packages" in texlive are set up to be used with texlive.combine. They were not intended to be used in any other way.