diff options
| -rwxr-xr-x | init | 15 | ||||
| -rw-r--r-- | meta.lua | 46 |
2 files changed, 56 insertions, 5 deletions
| @@ -1 +1,16 @@ | |||
| 1 | #!/bin/sh -ex | 1 | #!/bin/sh -ex |
| 2 | |||
| 3 | cd lua-cjson | ||
| 4 | luarocks config variables.CFLAGS " $CFLAGS" | ||
| 5 | luarocks make --pack-binary-rock *.rockspec | ||
| 6 | obj=$(ls *.rock) | ||
| 7 | cp $obj /root | ||
| 8 | cd /root | ||
| 9 | if [ -z $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then | ||
| 10 | # Release build, delete docs/ and tests/ | ||
| 11 | zip -d $obj docs/ docs/* tests/ tests/* | ||
| 12 | # And pack the library with upx | ||
| 13 | unzip $obj lib/* | ||
| 14 | find lib -type f | xargs upx --no-progress | ||
| 15 | zip -r "$obj" lib | ||
| 16 | fi | ||
| @@ -1,6 +1,42 @@ | |||
| 1 | return { | 1 | local lua_versions = { |
| 2 | ["lua-cjson"] = { | 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", | ||
| 6 | } | 14 | } |
| 15 | local debug = { | ||
| 16 | release = "", | ||
| 17 | debug = "-g", | ||
| 18 | } | ||
| 19 | local compilers = {--[["mingw32",]]"mingw64"--[[,"clang32","clang64"]]} | ||
| 20 | local package = "lua-cjson" | ||
| 21 | |||
| 22 | local builds = {} | ||
| 23 | for version, _, name, optimization, rel, flag, _, image in cartesian(lua_versions, optimizations, debug, compilers) do | ||
| 24 | builds[package .. "-" .. version .. "-" .. name .. "-" .. rel .. "-" .. image] = { | ||
| 25 | image = "image-luarocks-" .. version.. "-" .. image, | ||
| 26 | requires = { | ||
| 27 | {"git", package}, | ||
| 28 | {"cicd","image-luarocks-" .. version .. "-" .. image}, | ||
| 29 | {"cicd","lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image .. ":lua" .. version .. ".dll"}, | ||
| 30 | }, | ||
| 31 | produces = { | ||
| 32 | ["lua-cjson-2.1.0.14-1.mingw32-x86_64.rock"] = {"luarocks.sh", package, image, version, name, rel}, | ||
| 33 | }, | ||
| 34 | env = { | ||
| 35 | CFLAGS = optimization .. " " .. flag, | ||
| 36 | rockver = version:gsub("(%d)(%d)$","%1.%2"), | ||
| 37 | version = version | ||
| 38 | }, | ||
| 39 | } | ||
| 40 | end | ||
| 41 | |||
| 42 | return builds | ||
