4

If this were make, I'd write something like this

SHELL := /bin/sh
PATH := $(shell kpsewhich --var-value SELFAUTOLOC):/usr/local/bin:/usr/bin
export TEXMFHOME:=.
export TEXINPUTS:=.:~/tex-cfr/sasozivanovic/memoize/:

for SHELL, PATH, TEXMFHOME and TEXINPUTS to be exported.

However, I'm more familiar with both make and (ba)sh than lua. (This is something of an understatement not because I know that much about the first two, but because I know nothing about the third.) Moreover, the documentation for the first two is rather more useful than anything I've found for the third. (But I strongly suspect this is because I know what I'm looking for in the first two cases.)

As far as I can tell build.lua should be a list of variables and values. This could, I think, include definitions of functions, but that's not much help. I could redefine the executable to just export the variables I want when invoked, but that seems weirdly piecemeal and not very satisfactory.

checksearch = false
typesetsearch = false
unpacksearch = false

would, I think, basically set TEXINPUTS=. for each process. But I'm not trying to build the kernel and I don't want all of it in my local directory. I just want to restrict searching to TEXMFROOT, with the caveat that I don't want the additional trees specified in the two texmf.cnf --- $(kpsewhich -var-value TEXMFROOT)/texmf.cnf and $(kpsewhich -var-value TEXMFDIST)/web2c/texmf.cnf --- to be searched.

I could obviously drop a texmf.cnf in the local directory, but it seems there must be some neater way to do this. But I can't figure out how I'm supposed to insert the equivalent of

os_setenv .. " TEXMFHOME=. TEXMFLOCAL=. TEXMFARCH=."

into build.lua.

But David said I could. Or, at least, I think that's what David said, which is obviously rather different.

My current build.lua is, I guess, entirely unremarkable:

-- Build configuration for module
-- l3build.pdf listing 1 tudalen 9
module = "module"
unpackfiles = {"*.ins"}
typesetfiles = {"*.tex"}
auxfiles = {"*.aux"}
sourcefiles = {"*.sty","*.dtx","*.ins"}
checkengines = {"pdftex"}
checkformat = "latex"
-- vim: ts=2:sw=2:tw=80

The site's suggested duplicates for this question are 100% weird.

I suspect I'm going to regret asking this question...

2

1 Answer 1

5

build.lua is executed as Lua before the bulk of the l3build code runs, so you can use the LuaTeX builtin function

os.setenv("VARIABLENAME","value")

which does the equivalent of bash

export VARIABLENAME=value

and sets the variable in the environment of the Lua process running this invocation of l3build.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .