From 0435ac88948e53b90b6dad583364a8d040473dd6 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Tue, 2 Feb 2016 16:56:05 +0300 Subject: [PATCH 1/2] texlive.combine: patch paths into texmf.cnf ...instead of environment variables. Close #12768. (cherry picked from commit acf664814e37c54a7c12b1d065354cab15382793) --- .../typesetting/tex/texlive-new/combine.nix | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pkgs/tools/typesetting/tex/texlive-new/combine.nix b/pkgs/tools/typesetting/tex/texlive-new/combine.nix index e69c6ec425c..0619a3cc26c 100644 --- a/pkgs/tools/typesetting/tex/texlive-new/combine.nix +++ b/pkgs/tools/typesetting/tex/texlive-new/combine.nix @@ -60,21 +60,24 @@ 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 rm updmap.cfg ) @@ -112,10 +115,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 From 954f381972cf11d1cede324d5eaf88804cdf9b6a Mon Sep 17 00:00:00 2001 From: Raymond Gauthier Date: Wed, 13 Apr 2016 23:34:30 -0400 Subject: [PATCH 2/2] texlive.combine: also patch `texmfcnf.lua` Fixes #14463. --- pkgs/tools/typesetting/tex/texlive-new/combine.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/tools/typesetting/tex/texlive-new/combine.nix b/pkgs/tools/typesetting/tex/texlive-new/combine.nix index 0619a3cc26c..2818cbc0384 100644 --- a/pkgs/tools/typesetting/tex/texlive-new/combine.nix +++ b/pkgs/tools/typesetting/tex/texlive-new/combine.nix @@ -79,6 +79,19 @@ in buildEnv { -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 ) '' +