Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #14681 from jraygauthier/jrg/fix_context_by_patching_luascript_rebased

texlive.combine: also patch `texmfcnf.lua`

+23 -11
+23 -11
pkgs/tools/typesetting/tex/texlive-new/combine.nix
··· 60 60 + 61 61 '' 62 62 export PATH="$out/bin:$out/share/texmf/scripts/texlive:${perl}/bin:$PATH" 63 - export TEXMFCNF="$out/share/texmf/web2c" 64 - export TEXMFDIST="$out/share/texmf" 65 - export TEXMFSYSCONFIG="$out/share/texmf-config" 66 - export TEXMFSYSVAR="$out/share/texmf-var" 67 63 export PERL5LIB="$out/share/texmf/scripts/texlive" 68 64 '' + 69 - # patch texmf-dist -> texmf to be sure 70 - # TODO: cleanup the search paths incl. SELFAUTOLOC, and perhaps do lua actions? 65 + # patch texmf-{dist,local} -> texmf to be sure 66 + # TODO: perhaps do lua actions? 71 67 # tried inspiration from install-tl, sub do_texmf_cnf 72 68 '' 73 69 ( 74 70 cd ./share/texmf/web2c/ 75 71 local cnfOrig="$(realpath ./texmf.cnf)" 76 72 rm ./texmf.cnf 77 - cat "$cnfOrig" | sed 's/texmf-dist/texmf/g' > ./texmf.cnf 73 + sed \ 74 + -e 's,texmf-dist,texmf,g' \ 75 + -e 's,texmf-local,texmf,g' \ 76 + -e "s,\$SELFAUTOLOC,$out,g" \ 77 + -e "s,\$SELFAUTODIR,$out/share,g" \ 78 + -e "s,\$SELFAUTOPARENT,$out/share,g" \ 79 + -e "s,\$SELFAUTOGRANDPARENT,$out/share,g" \ 80 + "$cnfOrig" > ./texmf.cnf 81 + 82 + local cnfLuaOrig="$(realpath ./texmfcnf.lua)" 83 + rm ./texmfcnf.lua 84 + sed \ 85 + -e 's,texmf-dist,texmf,g' \ 86 + -e 's,texmf-local,texmf,g' \ 87 + -e "s,\(TEXMFLOCAL[ ]*=[ ]*\)[^\,]*,\1\"$out/share/texmf\",g" \ 88 + -e "s,\$SELFAUTOLOC,$out,g" \ 89 + -e "s,selfautodir:/,$out/share/,g" \ 90 + -e "s,selfautodir:,$out/share/,g" \ 91 + -e "s,selfautoparent:/,$out/share/,g" \ 92 + -e "s,selfautoparent:,$out/share/,g" \ 93 + "$cnfLuaOrig" > ./texmfcnf.lua 78 94 79 95 rm updmap.cfg 80 96 ) ··· 112 128 rm "$link" 113 129 makeWrapper "$target" "$link" \ 114 130 --prefix PATH : "$out/bin:${perl}/bin" \ 115 - --set TEXMFCNF "$out/share/texmf/web2c" \ 116 - --set TEXMFDIST "$out/share/texmf" \ 117 - --set TEXMFSYSCONFIG "$out/share/texmf-config" \ 118 - --set TEXMFSYSVAR "$out/share/texmf-var" \ 119 131 --prefix PERL5LIB : "$out/share/texmf/scripts/texlive" 120 132 121 133 # avoid using non-nix shebang in $target by calling interpreter