Debian Codegraph @

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

raw
1 --[==========================================[--
2 L3BUILD FILE FOR CHAR2PATH
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 = "char2path"
13 version = "v1.0.0"
14 date = "2025-07-28"
15 maintainer = "zongpingding, Mingyu Xia"
16 uploader = "Mingyu Xia"
17 maintainid = "zongpingding"
18 email = "[email protected]"
19 repository = "https://github.com/" .. maintainid .. "/" .. module
20 announcement = [[The new `char2path` package released.]]
21 summary = "A LaTeX package that converts characters into TikZ paths"
22 description = "The char2path package provides an easy way to converts characters into TikZ paths quickly, developed by expl3 based on TikZ."
23 note = "To CTAN team: Remember to add the co-author: zongpingding, for your convenience, his CTAN user page is ctan.org/home/zongpingding/"
24
25 --[==========================================[--
26 Build, Pack, Tag, and Upload
27 Do not Modify Unless Necessary
28 --]==========================================]--
29
30 ctanzip = module
31 cleanfiles = {"*log", "*.pdf", "*.zip", "*.curlopt"}
32 excludefiles = {"*~"}
33 installfiles = {"*.sty", "*.data.tex"}
34 localdir = "./testfiles/unpacked"
35 textfiles = {"*.md", "LICENSE", "*.lua"}
36 typesetcmds = "\\AtBeginDocument{\\ifdefined\\DisableImplementation" ..
37 "\\DisableImplementation\\fi}"
38 typesetfiles = {module .. ".dtx"}
39 typesetexe = "latexmk -pdf"
40 typesetruns = 1
41 uploadconfig = {
42 pkg = module,
43 version = version .. " " .. date,
44 author = maintainer,
45 uploader = uploader,
46 email = email,
47 summary = summary,
48 description = description,
49 license = "lppl1.3c",
50 ctanPath = "/macros/latex/contrib/" .. module,
51 announcement = announcement,
52 home = repository,
53 bugtracker = repository .. "/issues",
54 support = repository .. "/issues",
55 repository = repository,
56 development = "https://github.com/" .. maintainid,
57 update = false --!!Remember to set this to true when upload next time!!
58 }
59 function update_tag(file, content, tagname, tagdate)
60 tagname = version
61 tagdate = date
62 if string.match(file, "%.dtx$") or string.match(file, "%.tex$") or string.match(file, "%.sty$") then
63 content = string.gsub(content,
64 "\\ProvidesExplPackage {" .. module .. "} %{[^}]+%} %{[^}]+%}[\r\n%s]*%{[^}]+%}",
65 "\\ProvidesExplPackage {" .. module .. "} {" .. tagdate .. "} {" .. tagname .. "}\n {" .. summary .. "}")
66 content = string.gsub(content,
67 "\\date{Released %d+%-%d+%-%d+\\quad \\texttt{v([%d%.A-Z]+)}}",
68 "\\date{Released " .. tagdate .. "\\quad \\texttt{" .. tagname .. "}}")
69 end
70 return content
71 end
72
73 --[== "Hacks" to `l3build` | Do not Modify ==]--
74
75 function docinit_hook()
76 cp(ctanreadme, unpackdir, currentdir)
77 return 0
78 end
79 function tex(file,dir,cmd)
80 dir = dir or "."
81 cmd = cmd or typesetexe
82 if os.getenv("WINDIR") ~= nil or os.getenv("COMSPEC") ~= nil then
83 upretex_aux = "-usepretex=\"" .. typesetcmds .. "\""
84 makeidx_aux = "-e \"$makeindex=q/makeindex -s " .. indexstyle .. " %O %S/\""
85 sandbox_aux = "set \"TEXINPUTS=../unpacked;%TEXINPUTS%;\" &&"
86 else
87 upretex_aux = "-usepretex=\'" .. typesetcmds .. "\'"
88 makeidx_aux = "-e \'$makeindex=q/makeindex -s " .. indexstyle .. " %O %S/\'"
89 sandbox_aux = "TEXINPUTS=\"../unpacked:$(kpsewhich -var-value=TEXINPUTS):\""
90 end
91 return run(dir, sandbox_aux .. " " .. cmd .. " " ..
92 upretex_aux .. " " .. makeidx_aux .. " " .. file)
93 end