texlive: use standard mktexlsr instead of mktexlsr.pl

This commit is contained in:
Vincenzo Mantova 2023-08-07 13:44:02 +01:00
parent bbfcab42fd
commit 815e1e0e2d
2 changed files with 14 additions and 13 deletions

View file

@ -30,11 +30,12 @@ let
# remove fake derivations (without 'outPath') to avoid undesired build dependencies
paths = lib.catAttrs "outPath" pkgList.nonbin;
nativeBuildInputs = [ (lib.last tl.texlive-scripts.pkgs) ];
# mktexlsr
nativeBuildInputs = [ (lib.last tl."texlive.infra".pkgs) ];
postBuild = # generate ls-R database
''
mktexlsr --sort "$out"
mktexlsr "$out"
'';
}).overrideAttrs (_: { allowSubstitutes = true; });
@ -88,7 +89,8 @@ in (buildEnv {
nativeBuildInputs = [
makeWrapper
libfaketime
(lib.last tl.texlive-scripts.pkgs) # fmtutil, mktexlsr, updmap
(lib.last tl."texlive.infra".pkgs) # mktexlsr
(lib.last tl.texlive-scripts.pkgs) # fmtutil, updmap
(lib.last tl.texlive-scripts-extra.pkgs) # texlinks
perl
];
@ -222,8 +224,8 @@ in (buildEnv {
"$TEXMFDIST"/tex/generic/config/language.dat.lua > "$TEXMFSYSVAR"/tex/generic/config/language.dat.lua
[[ -e "$TEXMFDIST"/web2c/fmtutil.cnf ]] && sed -E -f '${fmtutilSed}' "$TEXMFDIST"/web2c/fmtutil.cnf > "$TEXMFCNF"/fmtutil.cnf
# make new files visible to kpathsea
mktexlsr --sort "$TEXMFSYSVAR"
# create $TEXMFSYSCONFIG database, make new $TEXMFSYSVAR files visible to kpathsea
mktexlsr "$TEXMFSYSCONFIG" "$TEXMFSYSVAR"
'') +
# generate format links (reads fmtutil.cnf to know which ones) *after* the wrappers have been generated
''
@ -260,7 +262,7 @@ in (buildEnv {
# sort entries to improve reproducibility
[[ -f "$TEXMFSYSCONFIG"/web2c/updmap.cfg ]] && sort -o "$TEXMFSYSCONFIG"/web2c/updmap.cfg "$TEXMFSYSCONFIG"/web2c/updmap.cfg
mktexlsr --sort "$TEXMFSYSCONFIG" "$TEXMFSYSVAR" # to make sure (of what?)
mktexlsr "$TEXMFSYSCONFIG" "$TEXMFSYSVAR" # to make sure (of what?)
'' +
# remove *-sys scripts since /nix/store is readonly
''

View file

@ -113,6 +113,7 @@ let
ps2eps.extraBuildInputs = [ ghostscript_headless ];
pst2pdf.extraBuildInputs = [ ghostscript_headless ];
tex4ht.extraBuildInputs = [ ruby ];
"texlive.infra".extraBuildInputs = [ coreutils gnused (lib.last tl.kpathsea.pkgs) ];
texlive-scripts.extraBuildInputs = [ gnused ];
texlive-scripts-extra.extraBuildInputs = [ coreutils findutils ghostscript_headless gnused ];
thumbpdf.extraBuildInputs = [ ghostscript_headless ];
@ -131,12 +132,8 @@ let
# so we add it back to binfiles to generate it from mkPkgBin
mptopdf.binfiles = (orig.mptopdf.binfiles or []) ++ [ "mptopdf" ];
# mktexlsr distributed by texlive.infra has implicit dependencies (e.g. kpsestat)
# the perl one hidden in texlive-scripts is better behaved
"texlive.infra".binfiles = lib.remove "mktexlsr" orig."texlive.infra".binfiles;
# remove man, add mktexlsr
texlive-scripts.binfiles = (lib.remove "man" orig.texlive-scripts.binfiles) ++ [ "mktexlsr" ];
# remove man
texlive-scripts.binfiles = lib.remove "man" orig.texlive-scripts.binfiles;
# upmendex is "TODO" in bin.nix
uptex.binfiles = lib.remove "upmendex" orig.uptex.binfiles;
@ -171,7 +168,7 @@ let
texlive-scripts.binlinks = {
mktexfmt = "fmtutil";
texhash = "mktexlsr";
texhash = (lib.last tl."texlive.infra".pkgs) + "/bin/mktexlsr";
};
texlive-scripts-extra.binlinks = {
@ -341,9 +338,11 @@ let
'';
# make tlmgr believe it can use kpsewhich to evaluate TEXMFROOT
# add runtime dependencies to PATH
"texlive.infra".postFixup = ''
substituteInPlace "$out"/bin/tlmgr \
--replace 'if (-r "$bindir/$kpsewhichname")' 'if (1)'
sed -i '2iPATH="${lib.makeBinPath overridden."texlive.infra".extraBuildInputs}''${PATH:+:$PATH}"' "$out"/bin/mktexlsr
'';
# Patch texlinks.sh back to 2015 version;