From b58292174e9efa683a32c350efbd1bde2921fd60 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Fri, 22 Nov 2024 13:07:01 -0600 Subject: Start working on 53 compat --- init | 27 +++++++++++++++++++++++++++ meta.lua | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 79 insertions(+), 5 deletions(-) diff --git a/init b/init index 642d265..3f9af63 100755 --- a/init +++ b/init @@ -1 +1,28 @@ #!/bin/sh -ex + +cd lua-compat-5.3 +cp rockspecs/compat53-scm-1.rockspec . +cp rockspecs/bit32-scm-1.rockspec . +luarocks config variables.CFLAGS " $CFLAGS" +luarocks make --pack-binary-rock compat53-scm-1.rockspec +luarocks make --pack-binary-rock bit32-scm-1.rockspec +obj1="compat53-scm-1.$(luarocks config arch).rock" +obj2="bit32-scm-1.$(luarocks config arch).rock" +cp $obj1 /root +cp $obj2 /root +cd /root +if [ -z $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then + # Release build, delete docs/ and tests/ + zip -d $obj1 docs/ docs/* tests/ tests/* + zip -d $obj2 docs/ docs/* tests/ tests/* + # And pack the library with upx + unzip $obj1 lib/* + upx --no-progress lib/* + zip -r "$obj1" lib + rm -rf lib + + unzip $obj2 lib/* + upx --no-progress lib/* + zip -r "$obj2" lib + rm -rf lib +fi diff --git a/meta.lua b/meta.lua index 10f3559..014f590 100644 --- a/meta.lua +++ b/meta.lua @@ -1,6 +1,53 @@ -return { - ["lua-compat-5.3"] = { - requires = {}, - produces = {}, - } +local lua_versions = { + ["51"] = true, + ["52"] = true, + ["53"] = true, + ["54"] = true, +} +local optimizations = { + tiny = "-Oz", + size = "-Os", + zero = "-O0", + one = "-O1", + two = "-O2", + three = "-O3", + debug = "-Og" +} +local debug = { + release = "", + debug = "-g", } +local compilers = {--[["mingw32",]]"mingw64"--[[,"clang32","clang64"]]} + +local builds = {} +for version, _, name, optimization, rel, flag, _, image in cartesian(lua_versions, optimizations, debug, compilers) do + local buildname = "lua-compat-5.3-" .. version .. "-" .. name .. "-" .. rel .. "-" .. image + builds[buildname] = { + image = "image-luarocks-" .. version.. "-" .. image, + requires = { + {"git", "lua-compat-5.3"}, + {"cicd","image-luarocks-" .. version .. "-" .. image}, + {"cicd","lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image .. ":lua" .. version .. ".dll"}, + }, + produces = { + ["compat53-scm-1.mingw32-x86_64.rock"] = {"luarocks.sh", "compat53", image, version, name, rel}, + ["bit32-scm-1.mingw32-x86_64.rock"] = {"luarocks.sh", "bit32", image, version, name, rel}, + }, + env = { + CFLAGS = optimization .. " " .. flag, + rockver = version:gsub("(%d)(%d)$","%1.%2"), + version = version + }, + } + --[[ + builds[buildname .. "-test"] = { + image = "image-wine", + requires = { + {"cicd", buildname .. ":luafilesystem-scm-1.mingw32-x86_64.rock"}, + {"cicd", "lua-" .. version .. "-" .. optimization .. "-" .. rel .. "-" .. } + } + } + ]] +end + +return builds -- cgit v1.2.3-55-g6feb