-
Notifications
You must be signed in to change notification settings - Fork 0
/
fnt-manifest.lua
208 lines (203 loc) · 7.21 KB
/
fnt-manifest.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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
-- $Id: fnt-manifest.lua 10356 2024-09-17 05:46:19Z cfrees $
---------------------------------------------------------------------
-- local derivedfiles = derivedfiles or {"*.cls","*.enc","*.fd","*.map","*.sty","*.tfm","*.vf"}
-- local origfntfiles = origfntfiles or {"*.afm","*.otf","*.pfb",".pfm","*.ttf","NOTICE.txt","COPYING"}
-- local fnttestfiles = fnttestfiles or {"fnt-tests.tex", "fnt-test.lvt"}
-- local buildscripts = buildscripts or {"*.lua", "Makefile", "../vendor/*.lua", "../../fontinst.lua"}
-- local fnttestdir = fnttestdir or maindir .. "/fnt-tests"
-- local testfiles = testfiles or {"*.lvt","*.pvt","*.tlg","*.lve","*.tpf"}
local fnttestfiles = fnttestfiles or "* fnt-tables.tex\n* fnt-tests.tex\n* fnt-test.lvt"
local derfntexcfiles = derfntexcfiles or '".",".."'
-- local fnttablestemplate = fnttablestemplate or "* fnt-tables.tex"
function populatescripts()
-- local vendordir = vendordir or maindir .. "/public"
local sourcefiledir = sourcefiledir or "."
if buildscripts == nil then
-- local bldscripts = {}
local bldscripts = ""
local possscripts = {sourcefiledir .. "/build.lua", maindir .. "/fontinst.lua", maindir .. "/fnt-manifest.lua", maindir .. "/tag.lua"}
for i,j in ipairs(possscripts) do
if fileexists(j) then
bldscripts = bldscripts .. "\n* " .. basename(j)
-- table.insert(bldscripts, basename(j))
end
end
return bldscripts
else
return buildscripts
end
end
function populatefontsupp(fontglob)
-- local sourcefiledir = sourcefiledir or "."
fontglob = fontglob or "*.*"
-- if fontsupp == nil then
-- local fontsupport = {}
local fontsupport = ""
local fontsupporttemp = filelist(keepdir, fontglob)
for i,j in ipairs(fontsupporttemp) do
-- if not ( j == "." or j == ".." ) then
fontsupport = fontsupport .. "\n* " .. j
-- table.insert(derfntexcfiles,j)
derfntexcfiles = derfntexcfiles .. "," .. j
-- end
end
return fontsupport
-- else
-- return fontsupp
-- end
end
function populatedoc()
local docs = docs or {typesetfiles,typesetdemofiles}
local tmpdocs = ""
for i,j in ipairs(docs) do
for k,l in ipairs(j) do
tmpdocs = tmpdocs .. "\n* " .. l
end
end
return string.gsub(tmpdocs, "%.$w+$", ".pdf")
end
function populatetxt()
local txts = textfiles or {}
local tmptxts = ""
for i,j in ipairs(txts) do
local tmptexts = filelist(sourcefiledir,j)
for k,l in ipairs(tmptexts) do
if not ( l == "." or l == ".." or string.match(l, "NOTICE") or string.match(l, "COPYING") ) then
tmptxts = tmptxts .. "\n* " .. l
end
end
end
if not string.match(tmptxts, ctanreadme) then
if fileexists(sourcefiledir, ctanreadme) then
local tmptexts = filelist(sourcefiledir, ctanreadme)
for i,j in ipairs(tmptexts) do
tmptxts = tmptxts .. "\n* " .. j
end
end
end
if not string.match(tmptxts, manifestfile) then
if fileexists(sourcefiledir, manifestfile) then
local tmptexts = filelist(sourcefiledir, manifestfile)
for i,j in ipairs(tmptexts) do
tmptxts = tmptxts .. "\n* " .. j
end
end
end
return tmptxts
end
----------------------------------------------------------------------
function manifest_write_opening(filehandle)
local date = date or os.date()
filehandle:write( "# Manifest for " .. ctanpkg .. "\n\nCopyright (C) " .. date .. " Clea F. Rees\n\n" )
filehandle:write(
[[This work may be distributed and/or modified under the conditions of the LaTeX
Project Public License, either version 1.3c of this license or (at your option)
any later version. The latest version of this license is in
https://www.latex-project.org/lppl.txt
and version 1.3c or later is part of all distributions of LaTeX version
2008-05-04 or later.
This work has the LPPL maintenance status `maintained'.
The Current Maintainer of this work is Clea F. Rees.
This work consists of all files listed in manifest.txt.
This file lists all files released under the LPPL. It does *not* list all files
included in the package. See README.md for further details.
This file was automatically generated by `l3build manifest`.]]
)
end
---------------------------------------------------------------------
function manifest_setup ()
if not ( fileexists(unpackdir .. "/" .. module .. ".sty") or fileexists(unpackdir .. "/" .. ctanpkg .. ".sty") ) then
unpack()
end
local buildscripts = populatescripts()
local derfntfiles = populatefontsupp()
local derencfiles = populatefontsupp("*.enc")
local derfdfiles = populatefontsupp("*.fd")
local dermapfiles = populatefontsupp("*.map")
local dertfmfiles = populatefontsupp("*.tfm")
local dervffiles = populatefontsupp("*.vf")
local docfiles = populatedoc()
local txtfiles = populatetxt()
local groups = {
{
subheading = "Source files",
},
{
name = "Package files",
-- description = fnttablestemplate,
dir = sourcefiledir,
-- files = {sourcefiles,typesetfiles,typesetsourcefiles,typesetdemofiles,fnttablestemplate},
files = {sourcefiles,typesetfiles,typesetsourcefiles,typesetdemofiles},
exclude = {derivedfiles,origfntfiles},
description = txtfiles,
},
{
name = "Development files",
dir = testfiledir,
files = {"*" .. lvtext, "*" .. lveext, "*" .. tlgext, "*" .. pvtext, "*" .. tpfext},
description = fnttestfiles .. buildscripts,
exclude = {ctanpkg .. "-test.lvt", module .. "-test.lvt"},
},
{
subheading = "Derived files",
},
{
name = "Class/Package files",
files = {"*.cls","*.sty"},
dir = unpackdir,
exclude = {"*.afm","*.otf","*.pfb",".pfm","*.ttf","NOTICE.txt","COPYING",".",".."},
-- description = derfntfiles,
},
{
name = "Font Encodings",
files = {"*.enc"},
dir = keepdir,
exclude = {"*.afm","*.otf","*.pfb",".pfm","*.ttf","NOTICE.txt","COPYING",".",".."},
-- description = derfntfiles,
},
{
name = "Font Definitions",
files = {"*.fd"},
dir = keepdir,
exclude = {"*.afm","*.otf","*.pfb",".pfm","*.ttf","NOTICE.txt","COPYING",".",".."},
-- description = derfntfiles,
},
{
name = "Map Files",
files = {"*.map"},
dir = keepdir,
exclude = {"*.afm","*.otf","*.pfb",".pfm","*.ttf","NOTICE.txt","COPYING",".",".."},
-- description = derfntfiles,
},
{
name = "TeX Font Metrics",
files = {"*.tfm"},
dir = keepdir,
exclude = {"*.afm","*.otf","*.pfb",".pfm","*.ttf","NOTICE.txt","COPYING",".",".."},
-- description = derfntfiles,
},
{
name = "Virtual Fonts",
files = {"*.vf"},
dir = keepdir,
exclude = {"*.afm","*.otf","*.pfb",".pfm","*.ttf","NOTICE.txt","COPYING",".",".."},
-- description = derfntfiles,
},
{
name = "Miscellaneous Font Support Files",
files = {derfntfiles},
dir = keepdir,
exclude = {derfntexcfiles},
},
{
name = "Typeset documentation",
files = {typesetfiles,typesetdemofiles},
excludefiles = {".",".."},
dir = sourcefiledir,
rename = {"%.%w+$",".pdf"},
},
}
return groups
end
---------------------------------------------------------------------
-- vim: ts=2:sw=2:tw=80:nospell: