l3build 'unpack' target is a dep for everything else when unpacking
[latex2e.git] / base / build.lua
blob35bd125b63fb65f2df5ebad6ac5889e371fc6d82
1 #!/usr/bin/env texlua
3 -- Build script for LaTeX2e "base" files
5 -- Identify the bundle and module
6 module = "latex2e-base"
7 bundle = ""
9 -- Location of main directory: use Unix-style path separators
10 maindir = ".."
12 -- Set up the file types needed here
13 installfiles =
15 "*.cfg", "*.clo", "*.cls", "*.def", "*.dfu", "*.err", "*.fd", "*.ist",
16 "*.ltx", "*.sty", "*.tex"
18 sourcefiles = {"*.cls", "*.dtx", "*.fdd", "ltpatch.ltx", "*.ins", "*.tex"}
19 typesetfiles =
21 "alltt.dtx",
22 "classes.dtx",
23 "cmfonts.dtx",
24 "doc.dtx",
25 "docstrip.dtx",
26 "exscale.dtx",
27 "fixltx2e.dtx",
28 "graphpap.dtx",
29 "ifthen.dtx",
30 "inputenc.dtx",
31 "lppl.tex",
32 "utf8ienc.dtx",
33 "latexsym.dtx",
34 "letter.dtx",
35 "ltxdoc.dtx",
36 "makeindx.dtx",
37 "nfssfont.dtx",
38 "proc.dtx",
39 "slides.dtx",
40 "slifonts.dtx",
41 "source2e.tex",
42 "syntonly.dtx",
45 -- A few special file for unpacking
46 unpackfiles = {"unpack.ins"}
47 unpacksuppfiles = {"hyphen.cfg", "texsys.cfg", "UShyphen.tex"}
49 -- Custom settings for the check system
50 checksuppfiles = {"latex.fmt"}
51 testsuppdir = "testfiles/helpers"
53 -- No dependencies at all (other than l3build of course)
54 checkdeps = { }
55 unpackdeps = { }
57 -- A function is needed to build the format
58 -- As this is a one-off, things are hard-coded
59 function format ()
60 unpack ()
61 -- Much the same as the standard unpack approach: run from 'here' so
62 -- the relationships are all correct
63 os.execute (
64 os_setenv .. " TEXINPUTS=" .. unpackdir .. os_pathsep .. localdir
65 .. os_concat ..
66 "etex -etex -ini " .. " -output-directory=" .. unpackdir ..
67 " " .. unpackdir .. "/latex.ltx"
69 end
71 -- base does all of the targets itself
72 function main (target, file, engine)
73 local errorlevel
74 if target == "check" then
75 check (file, engine)
76 elseif target == "clean" then
77 clean ()
78 elseif target == "ctan" then
79 ctan (true)
80 elseif target == "doc" then
81 doc ()
82 elseif target == "install" then
83 install ()
84 elseif target == "save" then
85 if file then
86 save (file, engine)
87 else
88 help ()
89 end
90 elseif target == "unpack" then
91 -- A simple way to have the unpack target also build the format
92 format ()
93 elseif target == "version" then
94 version ()
95 else
96 help ()
97 end
98 end
100 -- Load the common settings for the LaTeX2e repo
101 dofile (maindir .. "/build-config.lua")
103 -- Find and run the build system
104 kpse.set_program_name ("kpsewhich")
105 dofile (kpse.lookup ("l3build.lua"))