Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
153 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ globals = { | |
"luautf8", | ||
"pl", | ||
"fluent", | ||
"extendSilePath", | ||
"SYSTEM_SILE_PATH", | ||
"SHARED_LIB_EXT" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
"luautf8", | ||
"pl", | ||
"fluent", | ||
"extendSilePath", | ||
"SYSTEM_SILE_PATH", | ||
"SHARED_LIB_EXT" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
local executable = debug.getinfo(3, "S").source | ||
local luaversion = _VERSION:match("%d+%.%d+") | ||
|
||
-- Normalize possibly dirty Lua path formatting shortcut: /./ → / | ||
-- Even leafo/gh-actions-luarocks takes this shortcut which inhibits duplicate cleanup | ||
package.path = package.path:gsub("/%./", "/") | ||
package.cpath = package.cpath:gsub("/%./", "/") | ||
|
||
local function prepend_and_dedup (segment, path) | ||
local escaped = segment:gsub('[%-%.%+%[%]%(%)%$%^%%%?%*]','%%%1') -- copied from pl.utils.escape() which we can't load yet | ||
local striped = path:gsub(("^%s"):format(escaped), ""):gsub((";%s"):format(escaped), "") | ||
return ("%s;%s"):format(segment, striped) | ||
end | ||
|
||
local function prependPath (path) | ||
package.path = prepend_and_dedup(path .. "/?/init.lua", package.path) | ||
package.path = prepend_and_dedup(path .. "/?.lua", package.path) | ||
end | ||
|
||
local function prependCPath (path) | ||
package.cpath = prepend_and_dedup(path .. "/?.@SHARED_LIB_EXT@", package.cpath) | ||
end | ||
|
||
local function extendPaths (path, ours) | ||
prependCPath(path) | ||
prependPath(path) | ||
if ours then | ||
prependPath(path .. "/lua-libraries") | ||
if "@SYSTEM_LUAROCKS_FALSE@" == "" then -- see ./configure --with[out]-system-luarocks | ||
prependCPath(path .. "/lua_modules/lib/lua/" .. luaversion) | ||
prependPath(path .. "/lua_modules/share/lua/" .. luaversion) | ||
end | ||
else | ||
prependCPath(path .. "/sile") | ||
prependPath(path .. "/sile") | ||
end | ||
end | ||
|
||
-- Facilitate loading SILE classes & packages from system LuaRocks | ||
-- Also weed out CWD relative paths, we add them in a different order later | ||
local luapath = {} | ||
local extpath = {} | ||
for path in package.path:gmatch("[^;]+") do | ||
table.insert(extpath, tostring(path:gsub("%?", "sile/?"))) | ||
table.insert(luapath, path) | ||
end | ||
package.path = table.concat(luapath, ";") | ||
|
||
extendPaths("@SILE_PATH@", true) | ||
extendPaths("@SILE_LIB_PATH@", true) | ||
|
||
package.path = table.concat(extpath, ";") .. ";" .. package.path | ||
|
||
local pathvar = os.getenv("SILE_PATH") | ||
if pathvar then | ||
for path in string.gmatch(pathvar, "[^;]+") do | ||
if not path:match("^./") and path:len() >= 1 then | ||
extendPaths(path) | ||
end | ||
end | ||
end | ||
|
||
local cwd = executable:gsub("(.*)(/.*)", "%1") | ||
if cwd:match("^@") then -- Consider "ours" for the sake of Nix Flake | ||
extendPaths(".", true) | ||
else | ||
if cwd ~= "./" then extendPaths(cwd) end | ||
extendPaths(".") | ||
end | ||
|
||
_G.extendSilePath = extendPaths | ||
|
||
return function () | ||
return executable | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
-- @ROCKSPECWARNING@ | ||
rockspec_format = "3.0" | ||
package = "@TRANSFORMED_PACKAGE_NAME@" | ||
version = "dev-@ROCKREV@" | ||
|
||
source = { | ||
url = "git+https://github.com/sile-typesetter/sile.git", | ||
branch = "master" | ||
} | ||
|
||
description = { | ||
summary = "Simon’s Improved Layout Engine", | ||
detailed = [[SILE is a typesetting system; its job is to produce beautiful printed documents. | ||
Conceptually, SILE is similar to TeX—from which it borrows some concepts and even | ||
syntax and algorithms—but the similarities end there. Rather than being a | ||
derivative of the TeX family SILE is a new typesetting and layout engine written | ||
from the ground up using modern technologies and borrowing some ideas from | ||
graphical systems such as InDesign.]], | ||
license = "MIT", | ||
homepage = "https://github.com/sile-typesetter/fontproof", | ||
issues_url = "https://github.com/sile-typesetter/fontproof/issues", | ||
maintainer = "Caleb Maclennan <caleb@alerque.com>", | ||
labels = { "typesetting" } | ||
} | ||
|
||
dependencies = { | ||
"lua >= 5.1", | ||
"bit32", -- only required on Lua < 5.2, versions vary between Rock and VM provided | ||
"cassowary == 2.3.2-1", | ||
"cldr == 0.3.0-0", | ||
"compat53 == 0.8-1", -- only required on Lua < 5.3 | ||
"cosmo == 16.06.04-1", | ||
"fluent == 0.2.0-0", | ||
"linenoise == 0.9-1", | ||
"loadkit == 1.1.0-1", | ||
"lpeg == 1.0.2-1", | ||
"lua-zlib == 1.2-2", | ||
"lua_cliargs == 3.0-2", | ||
"luaepnf == 0.3-2", | ||
"luaexpat == 1.5.1-1", | ||
"luafilesystem == 1.8.0-1", | ||
"luarepl == 0.10-1", | ||
"luasec == 1.3.1-1", | ||
"luasocket == 3.1.0-1", | ||
"luautf8 == 0.1.5-1", | ||
"penlight == 1.13.1-1", | ||
"vstruct == 2.1.1-1" | ||
} | ||
|
||
build = { | ||
type = "builtin", | ||
modules = {} | ||
} |