about summary refs log tree commit diff
path: root/pkgs/tools/typesetting
diff options
context:
space:
mode:
authorzimbatm <zimbatm@zimbatm.com>2016-05-09 14:37:33 +0100
committerzimbatm <zimbatm@zimbatm.com>2016-05-09 14:37:33 +0100
commit9cc724e570ebe6dcb6089e2fcd9c65f79ca85a01 (patch)
tree4d9d168bb3639035189c8bc8d1c58f05b26efcce /pkgs/tools/typesetting
parentde22402f85993e42e5e007c2ce378f474297d786 (diff)
parent954f381972cf11d1cede324d5eaf88804cdf9b6a (diff)
downloadnixlib-9cc724e570ebe6dcb6089e2fcd9c65f79ca85a01.tar
nixlib-9cc724e570ebe6dcb6089e2fcd9c65f79ca85a01.tar.gz
nixlib-9cc724e570ebe6dcb6089e2fcd9c65f79ca85a01.tar.bz2
nixlib-9cc724e570ebe6dcb6089e2fcd9c65f79ca85a01.tar.lz
nixlib-9cc724e570ebe6dcb6089e2fcd9c65f79ca85a01.tar.xz
nixlib-9cc724e570ebe6dcb6089e2fcd9c65f79ca85a01.tar.zst
nixlib-9cc724e570ebe6dcb6089e2fcd9c65f79ca85a01.zip
Merge pull request #14681 from jraygauthier/jrg/fix_context_by_patching_luascript_rebased
texlive.combine: also patch `texmfcnf.lua`
Diffstat (limited to 'pkgs/tools/typesetting')
-rw-r--r--pkgs/tools/typesetting/tex/texlive-new/combine.nix34
1 files changed, 23 insertions, 11 deletions
diff --git a/pkgs/tools/typesetting/tex/texlive-new/combine.nix b/pkgs/tools/typesetting/tex/texlive-new/combine.nix
index e69c6ec425c3..2818cbc03849 100644
--- a/pkgs/tools/typesetting/tex/texlive-new/combine.nix
+++ b/pkgs/tools/typesetting/tex/texlive-new/combine.nix
@@ -60,21 +60,37 @@ in buildEnv {
     +
   ''
     export PATH="$out/bin:$out/share/texmf/scripts/texlive:${perl}/bin:$PATH"
-    export TEXMFCNF="$out/share/texmf/web2c"
-    export TEXMFDIST="$out/share/texmf"
-    export TEXMFSYSCONFIG="$out/share/texmf-config"
-    export TEXMFSYSVAR="$out/share/texmf-var"
     export PERL5LIB="$out/share/texmf/scripts/texlive"
   '' +
-    # patch texmf-dist -> texmf to be sure
-    # TODO: cleanup the search paths incl. SELFAUTOLOC, and perhaps do lua actions?
+    # patch texmf-{dist,local} -> texmf to be sure
+    # TODO: perhaps do lua actions?
     # tried inspiration from install-tl, sub do_texmf_cnf
   ''
     (
       cd ./share/texmf/web2c/
       local cnfOrig="$(realpath ./texmf.cnf)"
       rm ./texmf.cnf
-      cat "$cnfOrig" | sed 's/texmf-dist/texmf/g' > ./texmf.cnf
+      sed \
+        -e 's,texmf-dist,texmf,g' \
+        -e 's,texmf-local,texmf,g' \
+        -e "s,\$SELFAUTOLOC,$out,g" \
+        -e "s,\$SELFAUTODIR,$out/share,g" \
+        -e "s,\$SELFAUTOPARENT,$out/share,g" \
+        -e "s,\$SELFAUTOGRANDPARENT,$out/share,g" \
+        "$cnfOrig" > ./texmf.cnf
+
+      local cnfLuaOrig="$(realpath ./texmfcnf.lua)"
+      rm ./texmfcnf.lua
+      sed \
+        -e 's,texmf-dist,texmf,g' \
+        -e 's,texmf-local,texmf,g' \
+        -e "s,\(TEXMFLOCAL[ ]*=[ ]*\)[^\,]*,\1\"$out/share/texmf\",g" \
+        -e "s,\$SELFAUTOLOC,$out,g" \
+        -e "s,selfautodir:/,$out/share/,g" \
+        -e "s,selfautodir:,$out/share/,g" \
+        -e "s,selfautoparent:/,$out/share/,g" \
+        -e "s,selfautoparent:,$out/share/,g" \
+        "$cnfLuaOrig" > ./texmfcnf.lua
 
       rm updmap.cfg
     )
@@ -112,10 +128,6 @@ in buildEnv {
       rm "$link"
       makeWrapper "$target" "$link" \
         --prefix PATH : "$out/bin:${perl}/bin" \
-        --set TEXMFCNF "$out/share/texmf/web2c" \
-        --set TEXMFDIST "$out/share/texmf" \
-        --set TEXMFSYSCONFIG "$out/share/texmf-config" \
-        --set TEXMFSYSVAR "$out/share/texmf-var" \
         --prefix PERL5LIB : "$out/share/texmf/scripts/texlive"
 
       # avoid using non-nix shebang in $target by calling interpreter