forked from lualatex/lualibs
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.lua
154 lines (133 loc) · 5.19 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
-- Build script for lualibs
packageversion= "2.76"
packagedate= "2023-07-13"
fontloaderdate= "2023-07-13" -- only as record.
module = "lualibs"
ctanpkg = "lualibs"
-- get personal data
local ok, mydata = pcall(require, "ulrikefischerdata.lua")
if not ok then
mydata= {email="XXX",github="XXX",name="XXX"}
end
print(mydata.email)
uploadconfig = {
pkg = ctanpkg,
version = "v"..packageversion.." "..packagedate,
author = "Philipp Gesang; Élie Roux",
license = "gpl2",
summary = "Additional Lua functions for LuaTeX macro programmers",
ctanPath = "/macros/luatex/generic/lualibs",
repository = "https://github.com/latex3/lualibs",
bugtracker = "https://github.com/latex3/lualibs/issues",
support = "https://github.com/latex3/lualibs/issues",
uploader = mydata.name,
email = mydata.email,
update = true ,
topic = {"luatex","lua-supp"},
note = [[Uploaded automatically by l3build... Description and authors unchanged]],
description=[[Lualibs is a collection of Lua modules useful for general programming.
The bundle is based on lua modules shipped with ConTeXt, and made available in this bundle for use independent of ConTeXt.]],
announcement="This version syncs the files with the ConTeXt files from "..fontloaderdate.."."
}
-- check (currently no tests)
stdengine = "luatex"
checkengines = {"luatex"}
checkruns = 3
---------------------------------------------
-- l3build settings for CTAN/install target
---------------------------------------------
packtdszip =true
-- sourcefiledir (default .)
-- docfiledir (default .)
-- set texmfhome for local installation.
-- the files go to the side-by-side folder of luaotfload
-- to make it easier to run the tests there and to have a complete
-- set there for users
options["texmfhome"] = "../luaotfload/supporttexmf"
ctanreadme= "CTANREADME.md"
-------------------
-- documentation
-------------------
typesetexe = "lualatex"
unpackfiles = {"*.dtx"}
textfiles =
{
"LICENSE",
"NEWS",
"CTANREADME.md",
}
---------------------
-- installation
---------------------
tdsroot = "luatex"
installfiles = {
"**/lualibs-*.lua",
"lualibs.lua",
}
sourcefiles = {
"*.dtx",
"lualibs-*.lua",
}
-----------------------------
-- l3build settings for tags:
-----------------------------
tagfiles = {
"CTANREADME.md",
"README.md",
"lualibs.dtx",
}
function update_tag (file,content,tagname,tagdate)
tagdate = string.gsub (packagedate,"-", "/")
if string.match (file, "%.dtx$" ) then
content = string.gsub (content,
"%d%d%d%d/%d%d/%d%d [a-z]+%d%.%d+",
tagdate.." v"..packageversion)
content = string.gsub (content,
"%d%d%d%d%-%d%d%-%d%d [a-z]+%d%.%d+",
packagedate.." v"..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")
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 )
content = string.gsub (content,
"context %d%d%d%d%-%d%d%-%d%d",
"context ".. fontloaderdate )
local imgpackagedate = string.gsub (packagedate,"%-","--")
content = string.gsub (content,
"%d%d%d%d%-%-%d%d%-%-%d%d",
imgpackagedate)
return content
elseif string.match (file, "CTANREADME.md$") then
content = string.gsub (content,
"VERSION: %d%.%d+",
"VERSION: " .. packageversion )
content = string.gsub (content,
"DATE: %d%d%d%d%-%d%d%-%d%d",
"DATE: " .. packagedate )
content = string.gsub (content,
"FONTLOADERDATE: %d%d%d%d%-%d%d%-%d%d",
"FONTLOADERDATE: " .. fontloaderdate )
return content
end
return content
end
kpse.set_program_name ("kpsewhich")
if not release_date then
dofile ( kpse.lookup ("l3build.lua"))
end