forked from latex3/tagpdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.lua
187 lines (169 loc) · 6.58 KB
/
build.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
-- Build script for tagpdf
packageversion="0.91"
packagedate="2021-07-03"
module = "tagpdf"
ctanpkg = "tagpdf"
local ok, mydata = pcall(require, "ulrikefischerdata.lua")
if not ok then
mydata= {email="XXX",github="XXX",name="XXX"}
end
uploadconfig = {
pkg = ctanpkg,
version = "v"..packageversion.." "..packagedate,
author = mydata.name,
license = "lppl1.3c",
summary = "Tools for experimenting with tagging using pdfLaTeX and LuaLaTeX",
ctanPath = "/macros/latex/contrib/tagpdf",
repository = mydata.github .. "tagpdf",
bugtracker = mydata.github .. "tagpdf/issues",
support = mydata.github .. "tagpdf/issues",
uploader = mydata.name,
email = mydata.email,
update = true ,
topic= "tagged-pdf",
note = [[Uploaded automatically by l3build...]],
description=[[The package offers tools to experiment with tagging and accessibility using pdfLATEX and LuaTEX. It isn't meant for production but allows the user to try out how difficult it is to tag some structures; to try out how much tagging is really needed; to test what else is needed so that a pdf works e.g. with a screen reader. Its goal is to get a feeling for what has to be done, which kernel changes are needed, how packages should be adapted.]],
announcement_file="ctan.ann"
}
-- tests are done with dev-format always
specialformats = specialformats or {}
specialformats["latex"] = specialformats["latex"] or
{
luatex = {binary="luahbtex",format = "lualatex-dev"},
pdftex = {format = "pdflatex-dev"},
xetex = {format = "xelatex-dev"},
latexdvips = {binary="latex",format = "latex-dev"}
}
checkengines = {"pdftex","luatex"}
checkconfigs = {"build",
"config-pdftex",
"config-nosyntax", -- tests with invalid pdf as result
"config-luatex",
-- "config-luatex-dev",
-- "config-pdftex-dev",
-- "config-dev"
}
checkruns = 4
checksuppfiles = {"pdfaPilotSyntaxChecks.kfpx","checksyntax.bat","checksyntax-all.bat","tagpdf-regressiontest.sty"}
excludetests = {"test-saveboxes-structure-dev"}
sourcefiles = {"*.dtx","*.ins","*.sty"}
if os.getenv('TRAVIS') then
checkconfigs = {"build","config-pdftex","config-luatex"}
excludetests = {"test-pdfresources-exist","test-saveboxes-structure-dev"}
end
-- currently probably not needed. files in texmfhome are found.
-- local extratexmf=os.getenv('TEXDEVDIR')
--local file = io.open ("support/texmf.cnf","w")
--io.output(file)
--if extratexmf then
--io.write("TEXMFAUXTREES= "..extratexmf..",")
--else
--io.write("")
--end
--io.close(file)
sourcefiledir = "./source"
tagfiles = {"source/*.md",
"source/**/tag*.sty",
"source/**/tag*.def",
"source/**/*.lua",
"source/*.tex",
"source/dtx/*dtx",
"Readme.md"}
function update_tag (file,content,tagname,tagdate)
tagdate = string.gsub (packagedate,"-", "/")
if string.match (file, "%.dtx$" ) then
content = string.gsub (content,
"\\ProvidesExplPackage {(.-)} {.-} {.-}",
"\\ProvidesExplPackage {%1} {" .. packagedate.."} {"..packageversion .. "}")
content = string.gsub (content,
"\\ProvidesExplFile {(.-)} {.-} {.-}",
"\\ProvidesExplFile {%1} {" .. packagedate.."} {"..packageversion .. "}")
content = string.gsub (content,
'(version%s*=%s*")%d%.%d+(",%s*--TAGVERSION)',
"%1"..packageversion.."%2")
content = string.gsub (content,
'(date%s*=%s*")%d%d%d%d%-%d%d%-%d%d(",%s*--TAGDATE)',
"%1"..packagedate.."%2")
content = string.gsub (content,
"date{Version %d%.%d+, released %d%d%d%d%-%d%d%-%d%d",
"date{Version "..packageversion..", released ".. packagedate)
return content
elseif string.match (file, "%.sty$" ) then
content = string.gsub (content,
"\\ProvidesExplPackage {(.-)} {.-} {.-}",
"\\ProvidesExplPackage {%1} {" .. packagedate .."} {"..packageversion .. "}")
return content
elseif string.match (file, "^Readme.md$") then
content = string.gsub (content,
"Version: %d%.%d+",
"Version: " .. packageversion )
content = string.gsub (content,
"version%-%d%.%d+",
"version-" .. packageversion )
content = string.gsub (content,
"for %d%.%d+",
"for " .. packageversion )
content = string.gsub (content,
"%d%d%d%d%-%d%d%-%d%d",
packagedate )
local imgpackagedate = string.gsub (packagedate,"%-","--")
content = string.gsub (content,
"%d%d%d%d%-%-%d%d%-%-%d%d",
imgpackagedate)
return content
elseif string.match (file, "%.md$") then
content = string.gsub (content,
"Packageversion: %d%.%d+",
"Packageversion: " .. packageversion )
content = string.gsub (content,
"Packagedate: %d%d%d%d/%d%d/%d%d",
"Packagedate: " .. tagdate )
return content
elseif string.match (file, "%.tex$" ) then
content = string.gsub (content,
"package@version{%d%.%d+}",
"package@version{" .. packageversion .."}" )
content = string.gsub (content,
"package@date{%d%d%d%d%-%d%d%-%d%d}",
"package@date{" .. packagedate .."}" )
return content
end
return content
end
-- ctan setup
docfiles = {"source/tagpdf.tex",
"source/tagpdf-code.tex",
"source/tagpdf.bib",
"source/link-figure-input.tex",
"source/pac3.PNG",
"source/global-ex.png",
"source/examples/**/*.tex",
"source/examples/**/*.pdf"}
textfiles= {"source/CTANREADME.md"}
ctanreadme= "CTANREADME.md"
typesetexe = "lualatex-dev"
packtdszip = false
installfiles = {
"**/*.sty",
"**/*.def",
"**/*.lua",
}
sourcefiles = {"**/*.dtx",
"**/*.ins",
"**/*.sty",
--"**/*.def",
--"**/*.lua"
}
typesetfiles =
{
"tagpdf.tex","tagpdf-code.tex"
-- "tagpdf-tree.dtx",
-- "tagpdf-checks.dtx",
-- "tagpdf-space.dtx",
-- "tagpdf-roles.dtx",
-- "tagpdf-mc.dtx",
-- "tagpdf-struct.dtx",
-- "tagpdf-user.dtx",
-- "tagpdf.dtx"
}
typesetruns = 4