summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-02-11 07:33:08 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-02-11 07:33:08 +0100
commitbe8583e2762df3f132f07d61c574688f2c1fdbf0 (patch)
tree9da011ee5d3cc834e59bb64f841bd024a4d786fa
parent9f7c9b2caba2bd85a03d8a95e3892dacef3cafca (diff)
parent67932f829fbf7aaa269725e646d1c35f74d97be5 (diff)
downloadluaotfload-be8583e2762df3f132f07d61c574688f2c1fdbf0.tar.gz
Merge pull request #196 from phi-gamma/texlive2014
move peripheral scripts to ./scripts, generated files to ./build
-rw-r--r--Makefile44
-rwxr-xr-xscripts/mkcharacters (renamed from mkcharacters)6
-rwxr-xr-xscripts/mkglyphlist (renamed from mkglyphlist)11
-rwxr-xr-xscripts/mkstatus (renamed from mkstatus)44
-rwxr-xr-xscripts/mktests (renamed from mktests)0
5 files changed, 73 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index 3ed893c..689d9da 100644
--- a/Makefile
+++ b/Makefile
@@ -3,17 +3,21 @@
NAME = luaotfload
LUAOTFLOAD = $(wildcard luaotfload-*.lua) luaotfload-blacklist.cnf
-GLYPHSCRIPT = mkglyphlist
-GLYPHSOURCE = glyphlist.txt
-CHARSCRIPT = mkcharacters
-STATUSSCRIPT = mkstatus
+DOCSRCDIR = ./doc
+SCRIPTSRCDIR = ./scripts
+BUILDDIR = ./build
+
+GLYPHSCRIPT = $(SCRIPTSRCDIR)/mkglyphlist
+CHARSCRIPT = $(SCRIPTSRCDIR)/mkcharacters
+STATUSSCRIPT = $(SCRIPTSRCDIR)/mkstatus
+
+GLYPHSOURCE = $(BUILDDIR)/glyphlist.txt
RESOURCESCRIPTS = $(GLYPHSCRIPT) $(CHARSCRIPT) $(STATUSSCRIPT)
SCRIPTNAME = luaotfload-tool
SCRIPT = $(SCRIPTNAME).lua
-DOCSRCDIR = ./doc
GRAPH = filegraph
DOCSRC = $(DOCSRCDIR)/$(NAME).dtx
GRAPHSRC = $(DOCSRCDIR)/$(GRAPH).dot
@@ -26,15 +30,15 @@ MANPAGE = $(DOCSRCDIR)/$(SCRIPTNAME).1
DOCS = $(DOCPDF) $(DOTPDF) $(MANPAGE)
# Files grouped by generation mode
-GLYPHS = luaotfload-glyphlist.lua
-CHARS = luaotfload-characters.lua
-STATUS = luaotfload-status.lua
+GLYPHS = $(BUILDDIR)/$(NAME)-glyphlist.lua
+CHARS = $(BUILDDIR)/$(NAME)-characters.lua
+STATUS = $(BUILDDIR)/$(NAME)-status.lua
RESOURCES = $(GLYPHS) $(CHARS) $(STATUS)
SOURCE = $(DOCSRC) $(MANSRC) $(LUAOTFLOAD) README Makefile NEWS $(RESOURCESCRIPTS)
# Files grouped by installation location
SCRIPTSTATUS = $(SCRIPT) $(OLDSCRIPT) $(RESOURCESCRIPTS)
-RUNSTATUS = $(UNPACKED) $(filter-out $(SCRIPTSTATUS),$(LUAOTFLOAD))
+RUNSTATUS = $(filter-out $(SCRIPTSTATUS),$(LUAOTFLOAD))
DOCSTATUS = $(DOCPDF) $(DOTPDF) README NEWS
MANSTATUS = $(MANPAGE)
SRCSTATUS = $(DOCSRC) $(MANSRC) $(GRAPHSRC) Makefile
@@ -61,15 +65,18 @@ ZIPS = $(CTAN_ZIP) $(TDS_ZIP)
LUA = texlua
+## For now the $(BUILDDIR) is hardcoded in the scripts
+## but we might just as well pass it to them by as environment
+## variables.
DO_GLYPHS = $(LUA) $(GLYPHSCRIPT) > /dev/null
DO_CHARS = $(LUA) $(CHARSCRIPT) > /dev/null
DO_STATUS = $(LUA) $(STATUSSCRIPT) > /dev/null
all: $(GENERATED)
-unpack: $(UNPACKED)
-resources: $(RESOURCES)
-chars: $(CHARS)
-status: $(STATUS)
+builddir: $(BUILDDIR)
+resources: builddir $(RESOURCES)
+chars: builddir $(CHARS)
+status: builddir $(STATUS)
ctan: $(CTAN_ZIP)
tds: $(TDS_ZIP)
world: all ctan
@@ -97,6 +104,9 @@ $(CHARS): /dev/null
$(STATUS): /dev/null
$(DO_STATUS)
+$(BUILDDIR): /dev/null
+ mkdir -p $(BUILDDIR)
+
define make-ctandir
@$(RM) -rf $(DISTDIR)
@mkdir -p $(DISTDIR) && cp $(SOURCE) $(COMPILED) $(DISTDIR)
@@ -142,13 +152,17 @@ manifest:
@echo "Derived files:"
@for f in $(GENERATED); do echo $$f; done
+CLEANEXTS = log aux toc idx ind ilg out
+CLEANME = $(foreach ext,$(CLEANEXTS),$(wildcard *.$(ext)))
+CLEANME += $(foreach ext,$(CLEANEXTS),$(wildcard $(BUILDDIR)/*$(ext)))
+
clean:
$(MAKE) -C $(DOCSRCDIR) $@
- @$(RM) -- *.log *.aux *.toc *.idx *.ind *.ilg *.out
+ @$(RM) -- $(CLEANME)
mrproper: clean
$(MAKE) -C $(DOCSRCDIR) $@
@$(RM) -- $(GENERATED) $(ZIPS) $(GLYPHSOURCE)
- @$(RM) -r -- $(DISTDIR)
+ @$(RM) -r -- $(DISTDIR) $(BUILDDIR)
# vim:set noexpandtab:tabstop=8:shiftwidth=2
diff --git a/mkcharacters b/scripts/mkcharacters
index 5d4a2f4..abed2c9 100755
--- a/mkcharacters
+++ b/scripts/mkcharacters
@@ -5,8 +5,8 @@
-- DESCRIPTION: import parts of char-def.lua
-- REQUIREMENTS: lua, ConTeXt, the lualibs package
-- AUTHOR: Philipp Gesang (Phg), <phg42.2a@gmail.com>
--- VERSION: 2.4
--- CREATED: 2013-05-17 12:41:39+0200
+-- VERSION: 2.5
+-- MODIFIED: 2014-02-11 07:24:25+0100
-----------------------------------------------------------------------
-- we create a stripped-down version of char-def.lua
-----------------------------------------------------------------------
@@ -14,7 +14,7 @@
-----------------------------------------------------------------------
-- config
-----------------------------------------------------------------------
-local charfile = "./luaotfload-characters.lua"
+local charfile = "./build/luaotfload-characters.lua"
local chardef = "/home/phg/base/char-def.lua"
--- for every code point char-def.lua provides a set of fields. they
diff --git a/mkglyphlist b/scripts/mkglyphlist
index f7a1cb9..e660a57 100755
--- a/mkglyphlist
+++ b/scripts/mkglyphlist
@@ -5,19 +5,21 @@
-- DESCRIPTION: part of the luaotfload package
-- REQUIREMENTS: lua, lpeg, luasocket, the lualibs package
-- AUTHOR: Philipp Gesang (Phg), <phg42.2a@gmail.com>
--- VERSION: 2.4
--- CREATED: 04/23/2013 12:42:17 PM CEST
+-- VERSION: 2.5
+-- MODIFIED: 2014-02-11 06:44:50+0100
-----------------------------------------------------------------------
-- interesting thread on the Context list:
-- http://www.ntg.nl/pipermail/ntg-context/2008/029057.html
+--
+-- N.B. this script assumes network connectivity!
-----------------------------------------------------------------------
-----------------------------------------------------------------------
-- config
-----------------------------------------------------------------------
-local glyphfile = "./glyphlist.txt"
-local font_age = "./luaotfload-glyphlist.lua"
+local glyphfile = "./build/glyphlist.txt"
+local font_age = "./build/luaotfload-glyphlist.lua"
local glyph_source = "http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt"
-----------------------------------------------------------------------
@@ -133,6 +135,7 @@ end
local get_raw get_raw = function (retry)
local fh = io.open(glyphfile, "rb")
if fh then
+ print ("info: reading glyph list from", glyphfile)
local data = fh:read"*all"
fh:close()
if data then return data end
diff --git a/mkstatus b/scripts/mkstatus
index 6e6e375..fcf8b24 100755
--- a/mkstatus
+++ b/scripts/mkstatus
@@ -24,19 +24,22 @@ local md5sumhexa = md5.sumhexa
local ioloaddata = io.loaddata
local iosavedata = io.savedata
local iopopen = io.popen
+local iowrite = io.write
+local lfsisdir = lfs.isdir
-----------------------------------------------------------------------
-- settings
-----------------------------------------------------------------------
-local filelist = "luaotfload-status.lua" --- result
+local verbose = false
+local filelist = "./build/luaotfload-status.lua" --- result
local names = {
--- only the runtime files and scripts
"luaotfload-auxiliary.lua",
"luaotfload-basics-gen.lua",
"luaotfload-basics-nod.lua",
- "luaotfload-characters.lua",
+ { "build", "luaotfload-characters.lua", },
"luaotfload-colors.lua",
"luaotfload-database.lua",
"luaotfload-diagnostics.lua",
@@ -47,7 +50,7 @@ local names = {
"luaotfload-fonts-ext.lua",
"luaotfload-fonts-lua.lua",
"luaotfload-fonts-tfm.lua",
- "luaotfload-glyphlist.lua",
+ { "build", "luaotfload-glyphlist.lua", },
"luaotfload-letterspace.lua",
"luaotfload-loaders.lua",
"luaotfload-log.lua",
@@ -56,9 +59,9 @@ local names = {
"luaotfload-override.lua",
"luaotfload-parsers.lua",
"luaotfload-tool.lua",
- "mkcharacters",
- "mkglyphlist",
- "mkstatus",
+ { "scripts", "mkcharacters", },
+ { "scripts", "mkglyphlist", },
+ { "scripts", "mkstatus", },
}
-----------------------------------------------------------------------
@@ -122,17 +125,38 @@ hash_all = function (list, acc)
return hash_all (table.fastcopy (names), { })
end
- local fname = list[#list]
+ local finfo = list[#list]
list[#list] = nil
- if fname then
- local sum = hash_file (fname)
- acc[#acc+1] = { fname, sum }
+ if finfo then
+ local fpath
+ if type (finfo) == "table" then
+ local d, f = finfo [1], finfo [2]
+ if lfs.isdir (d) then
+ fpath = file.join (d, f)
+ else
+ fpath = f
+ end
+ else
+ fpath = finfo
+ end
+ if verbose then
+ iowrite "ยท md5("
+ iowrite (fpath)
+ end
+ local sum = hash_file (fpath)
+ if verbose then
+ iowrite ") = \""
+ iowrite (sum)
+ iowrite "\"\n"
+ end
+ acc[#acc+1] = { fpath, sum }
return hash_all (list, acc)
end
return acc
end
local main = function ()
+ if arg [1] == "-v" then verbose = true end
local hashes = hash_all ()
local notes = git_info ()
local serialized = table.serialize ({ notes = notes,
diff --git a/mktests b/scripts/mktests
index 0bf3f64..0bf3f64 100755
--- a/mktests
+++ b/scripts/mktests