[latex3-commits] [git/LaTeX3-latex3-l3build] master: Enable use of a local texmf.cnf file (db43b79)
Joseph Wright
joseph.wright at morningstar2.co.uk
Sat Sep 22 17:29:28 CEST 2018
Repository : https://github.com/latex3/l3build
On branch : master
Link : https://github.com/latex3/l3build/commit/db43b799d6b7cbb6b5df92e631409b4e823382ec
>---------------------------------------------------------------
commit db43b799d6b7cbb6b5df92e631409b4e823382ec
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sat Sep 22 16:29:28 2018 +0100
Enable use of a local texmf.cnf file
For luaotfload, but may be useful for others.
>---------------------------------------------------------------
db43b799d6b7cbb6b5df92e631409b4e823382ec
CHANGELOG.md | 1 +
l3build-check.lua | 8 ++++++++
l3build-typesetting.lua | 7 +++++++
l3build.dtx | 12 ++++++++++++
4 files changed, 28 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b3ee91a..b275c2b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ this project uses date-based 'snapshot' version identifiers.
- Entries in `scriptfiles` are excluded from `installfiles`
- Use a per-config directory for running tests
+- Enable use of local `texmf.cnf` file in tests and documentation
## [2018-09-21]
diff --git a/l3build-check.lua b/l3build-check.lua
index e59f6ca..73b3dad 100644
--- a/l3build-check.lua
+++ b/l3build-check.lua
@@ -30,6 +30,9 @@ local output = io.output
local rnd = math.random
+local var_value = kpse.var_value
+local set_program_name = kpse.set_program_name
+
local luatex_version = status.luatex_version
local len = string.len
@@ -726,6 +729,8 @@ function runtest(name, engine, hide, ext, pdfmode, breakout)
break
end
end
+ -- Deal with TEXMFCNF
+ set_program_name("kpsewhich")
-- Clean out any dynamic files
for _,filetype in pairs(dynamicfiles) do
rm(testdir,filetype)
@@ -741,6 +746,9 @@ function runtest(name, engine, hide, ext, pdfmode, breakout)
-- Avoid spurious output from (u)pTeX
os_setenv .. " GUESS_INPUT_KANJI_ENCODING=0"
.. os_concat ..
+ -- Allow for local texmf files
+ os_setenv .. " TEXMFCNF=.;" .. var_value("TEXMFCNF")
+ .. os_concat ..
(forcecheckepoch and setepoch() or "") ..
-- Ensure lines are of a known length
os_setenv .. " max_print_line=" .. maxprintline
diff --git a/l3build-typesetting.lua b/l3build-typesetting.lua
index 71fe0ea..fd1e8fd 100644
--- a/l3build-typesetting.lua
+++ b/l3build-typesetting.lua
@@ -29,6 +29,9 @@ for those people who are interested.
local gsub = string.gsub
local match = string.match
+local var_value = kpse.var_value
+local set_program_name = kpse.set_program_name
+
function dvitopdf(name, dir, engine, hide)
if match(engine, "^u?ptex$") then
run(
@@ -52,11 +55,15 @@ end
-- An auxiliary used to set up the environmental variables
function runtool(subdir, dir, envvar, command)
+ set_program_name("kpsewhich")
dir = dir or "."
return(
run(
typesetdir .. "/" .. subdir,
(forcedocepoch and setepoch() or "") ..
+ -- Allow for local texmf files
+ os_setenv .. " TEXMFCNF=.;" .. var_value("TEXMFCNF")
+ .. os_concat ..
os_setenv .. " " .. envvar .. "=." .. os_pathsep
.. abspath(localdir) .. os_pathsep
.. abspath(dir .. "/" .. subdir)
diff --git a/l3build.dtx b/l3build.dtx
index f6c691d..ed36c79 100644
--- a/l3build.dtx
+++ b/l3build.dtx
@@ -1054,6 +1054,18 @@
% takes either a date or raw epoch. When given, this will automatically
% activate forcing of the epoch in both testing and typesetting.
%
+% \subsection{Settings in \texttt{texmf.cnf}}
+%
+% To allow application of non-standard \TeX} trees or similar non-standard
+% settings, \pkg{l3build} enables searching for a \texttt{texmf.cnf} file
+% by setting the envirnmental variable \texttt{TEXMFCNF}. This might
+% for example be used with a file containing
+% \begin{verbatim}
+% TEXMFAUXTREES = ../../texmf,
+% \end{verbatim}
+% for adding a local tree within the development repository (assuming the
+% typical \pkg{l3build} layout).
+%
% \section{Alternative test formats}
%
% \subsection{Generating test files with \pkg{DocStrip}}
More information about the latex3-commits
mailing list