Debian Codegraph @

texmf-dist/doc/latex/beamertheme-westlake/build.lua

raw symbols SCIP
1 --[==========================================[--
2 L3BUILD FILE FOR BEAMER-WESTLAKE
3 --]==========================================]--
4
5 --[==========================================[--
6 Basic Information
7 Do Check Before Push
8 --]==========================================]--
9
10 module = "beamertheme-westlake"
11 version = "v0.2A"
12 date = "2026-03-06"
13 maintainer = "Mingyu Xia"
14 uploader = "Mingyu Xia"
15 maintainid = "myhsia"
16 email = "[email protected]"
17 repository = "https://github.com/" .. maintainid .. "/" .. module
18 summary = "A beamer theme inspired by West Lake and Westlake University."
19 description = "The `westlake` Beamer Theme is inspired by West Lake, a famous freshwater lake in Hangzhou, China, and also inspired by Westlake University"
20
21 --[==========================================[--
22 Build, Pack, Tag, and Upload
23 Do not Modify Unless Necessary
24 --]==========================================]--
25
26 ctanzip = module
27 cleanfiles = {"*.log", "*.pdf", "*.zip", "*.curlopt"}
28 docsuppdirs = {"media"}
29 excludefiles = {"*~"}
30 typesetdemofiles = {module .. "-demo.tex"}
31 textfiles = {"README.md", "LICENSE", "*.lua"}
32 typesetexe = "latexmk -pdflatex"
33 typesetruns = 1
34 uploadconfig = {
35 announcement_file = "announcement.md",
36 pkg = module,
37 version = version .. " " .. date,
38 author = maintainer,
39 uploader = uploader,
40 email = email,
41 summary = summary,
42 description = description,
43 license = "lppl1.3c",
44 ctanPath = "/macros/latex/contrib/beamer-contrib/themes/" .. module,
45 home = "https://github.com/" .. maintainid,
46 bugtracker = repository .. "/issues",
47 support = repository .. "/issues",
48 repository = repository,
49 development = "https://github.com/" .. maintainid,
50 update = true
51 }
52 function update_tag(file, content, tagname, tagdate)
53 tagname = version
54 tagdate = date
55 if string.match(file, "%.dtx$") then
56 content = string.gsub(content,
57 "\\def \\westlake@date %{[^}]+%}",
58 "\\def \\westlake@date {" .. tagdate .. "}")
59 content = string.gsub(content,
60 "\\def \\westlake@version %{[^}]+%}",
61 "\\def \\westlake@version {" .. tagname .. "}")
62 content = string.gsub(content,
63 "\\date{Released %d+%-%d+%-%d+\\quad \\texttt{v([%d%.A-Z]+)}}",
64 "\\date{Released " .. tagdate .. "\\quad \\texttt{" .. tagname .. "}}")
65 end
66 return content
67 end
68
69 --[== "Hacks" to `l3build` | Do not Modify ==]--
70
71 function docinit_hook()
72 cp(ctanreadme, unpackdir, currentdir)
73 for _,glob in pairs(docsuppdirs) do
74 run(currentdir, "cp -r " .. glob .. " " .. typesetdir)
75 end
76 return 0
77 end
78 function tex(file,dir,cmd)
79 dir = dir or "."
80 cmd = cmd or typesetexe
81 if os.getenv("WINDIR") ~= nil or os.getenv("COMSPEC") ~= nil then
82 upretex_aux = "-usepretex=\"" .. typesetcmds .. "\""
83 makeidx_aux = "-e \"$makeindex=q/makeindex -s " .. indexstyle .. " %O %S/\""
84 sandbox_aux = "set \"TEXINPUTS=../unpacked;%TEXINPUTS%;\" &&"
85 else
86 upretex_aux = "-usepretex=\'" .. typesetcmds .. "\'"
87 makeidx_aux = "-e \'$makeindex=q/makeindex -s " .. indexstyle .. " %O %S/\'"
88 sandbox_aux = "TEXINPUTS=\"../unpacked:$(kpsewhich -var-value=TEXINPUTS):\""
89 end
90 return run(dir, sandbox_aux .. " " .. cmd .. " " ..
91 upretex_aux .. " " .. makeidx_aux .. " " .. file)
92 end