diff options
author | Alexander M Pickering <alex@cogarr.net> | 2024-10-25 21:06:57 -0500 |
---|---|---|
committer | Alexander M Pickering <alex@cogarr.net> | 2024-10-25 21:06:57 -0500 |
commit | 6ab35e7c87e11902fefcbf72214f7dd24dcbfcd7 (patch) | |
tree | ade6f859da4bcd2ad9bae131d063f8d1d0fef4b6 | |
parent | 441b1014065e28cfb0b5a6bfa0ca879bb1424e18 (diff) | |
download | lpeg-packaging-6ab35e7c87e11902fefcbf72214f7dd24dcbfcd7.tar.gz lpeg-packaging-6ab35e7c87e11902fefcbf72214f7dd24dcbfcd7.tar.bz2 lpeg-packaging-6ab35e7c87e11902fefcbf72214f7dd24dcbfcd7.zip |
Inital packaging
-rwxr-xr-x | init | 16 | ||||
-rw-r--r-- | lpeg-1.1.0-2.rockspec | 35 | ||||
-rw-r--r-- | meta.lua | 47 |
3 files changed, 93 insertions, 5 deletions
@@ -1 +1,17 @@ | |||
1 | #!/bin/sh -ex | 1 | #!/bin/sh -ex |
2 | |||
3 | cp lpeg-packaging/*.rockspec lpeg | ||
4 | cd lpeg | ||
5 | luarocks config variables.CFLAGS " $CFLAGS" | ||
6 | luarocks make --pack-binary-rock lpeg-1.1.0-2.rockspec | ||
7 | obj="lpeg-1.1.0-2.$(luarocks config arch).rock" | ||
8 | cp $obj /root | ||
9 | cd /root | ||
10 | if [ -z $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then | ||
11 | # Release build, delete docs/ and tests/ | ||
12 | zip -d $obj docs/ docs/* tests/ tests/* | ||
13 | # And pack the library with upx | ||
14 | unzip $obj lib/* | ||
15 | upx --no-progress lib/* | ||
16 | zip -r "$obj" lib | ||
17 | fi | ||
diff --git a/lpeg-1.1.0-2.rockspec b/lpeg-1.1.0-2.rockspec new file mode 100644 index 0000000..22da586 --- /dev/null +++ b/lpeg-1.1.0-2.rockspec | |||
@@ -0,0 +1,35 @@ | |||
1 | package = 'LPeg' | ||
2 | version = '1.1.0-2' | ||
3 | source = { | ||
4 | url = 'https://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.1.0.tar.gz', | ||
5 | md5 = '842a538b403b5639510c9b6fffd2c75b', | ||
6 | } | ||
7 | description = { | ||
8 | summary = 'Parsing Expression Grammars For Lua', | ||
9 | detailed = [[ | ||
10 | LPeg is a new pattern-matching library for Lua, based on Parsing | ||
11 | Expression Grammars (PEGs). The nice thing about PEGs is that it | ||
12 | has a formal basis (instead of being an ad-hoc set of features), | ||
13 | allows an efficient and simple implementation, and does most things | ||
14 | we expect from a pattern-matching library (and more, as we can | ||
15 | define entire grammars). | ||
16 | |||
17 | This version is re-packaged for lua4win with code borrowed from | ||
18 | Gary V. Vaughan <gary@vaughan.pe> | ||
19 | ]], | ||
20 | homepage = 'https://www.inf.puc-rio.br/~roberto/lpeg.html', | ||
21 | maintainer = 'Alexander Pickering <alex@lua4.win>', | ||
22 | license = 'MIT/X11' | ||
23 | } | ||
24 | dependencies = { | ||
25 | 'lua >= 5.1' | ||
26 | } | ||
27 | build = { | ||
28 | type = 'builtin', | ||
29 | modules = { | ||
30 | lpeg = { | ||
31 | 'lpcap.c', 'lpcode.c', 'lpcset.c', 'lpprint.c', 'lptree.c', 'lpvm.c' | ||
32 | }, | ||
33 | re = 're.lua' | ||
34 | } | ||
35 | } | ||
@@ -1,6 +1,43 @@ | |||
1 | return { | 1 | local lua_versions = { |
2 | ["lpeg"] = { | 2 | ["51"] = true, |
3 | requires = {}, | 3 | ["52"] = true, |
4 | produces = {}, | 4 | ["53"] = true, |
5 | } | 5 | ["54"] = true, |
6 | } | ||
7 | local optimizations = { | ||
8 | tiny = "-Oz", | ||
9 | size = "-Os", | ||
10 | zero = "-O0", | ||
11 | one = "-O1", | ||
12 | two = "-O2", | ||
13 | three = "-O3", | ||
14 | debug = "-Og" | ||
6 | } | 15 | } |
16 | local debug = { | ||
17 | release = "", | ||
18 | debug = "-g", | ||
19 | } | ||
20 | local compilers = {--[["mingw32",]]"mingw64"--[[,"clang32","clang64"]]} | ||
21 | |||
22 | local builds = {} | ||
23 | for version, _, name, optimization, rel, flag, _, image in cartesian(lua_versions, optimizations, debug, compilers) do | ||
24 | local buildname = "lpeg-" .. version .. "-" .. name .. "-" .. rel .. "-" .. image | ||
25 | builds[buildname] = { | ||
26 | image = "image-luarocks-" .. version.. "-" .. image, | ||
27 | requires = { | ||
28 | {"git", "lpeg"}, | ||
29 | {"cicd","image-luarocks-" .. version .. "-" .. image}, | ||
30 | {"cicd","lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image .. ":lua" .. version .. ".dll"}, | ||
31 | }, | ||
32 | produces = { | ||
33 | ["lpeg-1.1.0-2.mingw32-x86_64.rock"] = {"luarocks.sh", "lpeg", image, version, name, rel}, | ||
34 | }, | ||
35 | env = { | ||
36 | CFLAGS = optimization .. " " .. flag, | ||
37 | rockver = version:gsub("(%d)(%d)$","%1.%2"), | ||
38 | version = version | ||
39 | }, | ||
40 | } | ||
41 | end | ||
42 | |||
43 | return builds | ||