Debian Codegraph @

texmf-dist/doc/latex/physics3/build.lua

raw
1 --[==========================================[--
2 L3BUILD FILE FOR PHYSICS3
3 Once Pushed With This File Modified
4 A New Release Will Be Published
5 --]==========================================]--
6
7 --[==========================================[--
8 Basic Information
9 Do Check Before Push
10 --]==========================================]--
11
12 module = "physics3"
13 version = "v0.2A"
14 date = "2026-02-07"
15 maintainer = "Mingyu Xia"
16 uploader = "Mingyu Xia"
17 maintainid = "myhsia"
18 email = "[email protected]"
19 repository = "https://github.com/" .. maintainid .. "/" .. module
20 summary = "Tools for typesetting math for physics."
21 description = "The physics3 package defines commands for typesetting maths formulae faster and more simply."
22
23 --[==========================================[--
24 Build, Pack, Tag, and Upload
25 Do not Modify Unless Necessary
26 --]==========================================]--
27
28 ctanzip = module
29 cleanfiles = {"*.log", "*.pdf", "*.zip", "*.curlopt"}
30 excludefiles = {"*~"}
31 textfiles = {"*.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/" .. 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 \\phx@date %{[^}]+%}",
58 "\\def \\phx@date {" .. tagdate .. "}")
59 content = string.gsub(content,
60 "\\def \\phx@version %{[^}]+%}",
61 "\\def \\phx@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 return 0
74 end
75 function tex(file,dir,cmd)
76 dir = dir or "."
77 cmd = cmd or typesetexe
78 if os.getenv("WINDIR") ~= nil or os.getenv("COMSPEC") ~= nil then
79 upretex_aux = "-usepretex=\"" .. typesetcmds .. "\""
80 makeidx_aux = "-e \"$makeindex=q/makeindex -s " .. indexstyle .. " %O %S/\""
81 sandbox_aux = "set \"TEXINPUTS=../unpacked;%TEXINPUTS%;\" &&"
82 else
83 upretex_aux = "-usepretex=\'" .. typesetcmds .. "\'"
84 makeidx_aux = "-e \'$makeindex=q/makeindex -s " .. indexstyle .. " %O %S/\'"
85 sandbox_aux = "TEXINPUTS=\"../unpacked:$(kpsewhich -var-value=TEXINPUTS):\""
86 end
87 return run(dir, sandbox_aux .. " " .. cmd .. " " ..
88 upretex_aux .. " " .. makeidx_aux .. " " .. file)
89 end