diff options
| -rwxr-xr-x | init | 27 | ||||
| -rw-r--r-- | meta.lua | 57 |
2 files changed, 79 insertions, 5 deletions
| @@ -1 +1,28 @@ | |||
| 1 | #!/bin/sh -ex | 1 | #!/bin/sh -ex |
| 2 | |||
| 3 | cd lua-compat-5.3 | ||
| 4 | cp rockspecs/compat53-scm-1.rockspec . | ||
| 5 | cp rockspecs/bit32-scm-1.rockspec . | ||
| 6 | luarocks config variables.CFLAGS " $CFLAGS" | ||
| 7 | luarocks make --pack-binary-rock compat53-scm-1.rockspec | ||
| 8 | luarocks make --pack-binary-rock bit32-scm-1.rockspec | ||
| 9 | obj1="compat53-scm-1.$(luarocks config arch).rock" | ||
| 10 | obj2="bit32-scm-1.$(luarocks config arch).rock" | ||
| 11 | cp $obj1 /root | ||
| 12 | cp $obj2 /root | ||
| 13 | cd /root | ||
| 14 | if [ -z $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then | ||
| 15 | # Release build, delete docs/ and tests/ | ||
| 16 | zip -d $obj1 docs/ docs/* tests/ tests/* | ||
| 17 | zip -d $obj2 docs/ docs/* tests/ tests/* | ||
| 18 | # And pack the library with upx | ||
| 19 | unzip $obj1 lib/* | ||
| 20 | upx --no-progress lib/* | ||
| 21 | zip -r "$obj1" lib | ||
| 22 | rm -rf lib | ||
| 23 | |||
| 24 | unzip $obj2 lib/* | ||
| 25 | upx --no-progress lib/* | ||
| 26 | zip -r "$obj2" lib | ||
| 27 | rm -rf lib | ||
| 28 | fi | ||
| @@ -1,6 +1,53 @@ | |||
| 1 | return { | 1 | local lua_versions = { |
| 2 | ["lua-compat-5.3"] = { | 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" | ||
| 15 | } | ||
| 16 | local debug = { | ||
| 17 | release = "", | ||
| 18 | debug = "-g", | ||
| 6 | } | 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 = "lua-compat-5.3-" .. version .. "-" .. name .. "-" .. rel .. "-" .. image | ||
| 25 | builds[buildname] = { | ||
| 26 | image = "image-luarocks-" .. version.. "-" .. image, | ||
| 27 | requires = { | ||
| 28 | {"git", "lua-compat-5.3"}, | ||
| 29 | {"cicd","image-luarocks-" .. version .. "-" .. image}, | ||
| 30 | {"cicd","lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image .. ":lua" .. version .. ".dll"}, | ||
| 31 | }, | ||
| 32 | produces = { | ||
| 33 | ["compat53-scm-1.mingw32-x86_64.rock"] = {"luarocks.sh", "compat53", image, version, name, rel}, | ||
| 34 | ["bit32-scm-1.mingw32-x86_64.rock"] = {"luarocks.sh", "bit32", image, version, name, rel}, | ||
| 35 | }, | ||
| 36 | env = { | ||
| 37 | CFLAGS = optimization .. " " .. flag, | ||
| 38 | rockver = version:gsub("(%d)(%d)$","%1.%2"), | ||
| 39 | version = version | ||
| 40 | }, | ||
| 41 | } | ||
| 42 | --[[ | ||
| 43 | builds[buildname .. "-test"] = { | ||
| 44 | image = "image-wine", | ||
| 45 | requires = { | ||
| 46 | {"cicd", buildname .. ":luafilesystem-scm-1.mingw32-x86_64.rock"}, | ||
| 47 | {"cicd", "lua-" .. version .. "-" .. optimization .. "-" .. rel .. "-" .. } | ||
| 48 | } | ||
| 49 | } | ||
| 50 | ]] | ||
| 51 | end | ||
| 52 | |||
| 53 | return builds | ||
