From e4f4ce98515f4c47a194061df29cb9087b561caf Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Tue, 13 Aug 2024 16:19:14 -0500 Subject: Generate some luarocks images --- init | 18 ++++++++++++++++++ meta.lua | 41 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/init b/init index 642d265..451c299 100755 --- a/init +++ b/init @@ -1 +1,19 @@ #!/bin/sh -ex + +rc-service networking start + +apk add luarocks$maj.$min zip +ln -s /usr/bin/luarocks-$maj.$min /usr/local/bin/luarocks +ln -s /root/lua$maj$min.dll /root/liblua.dll + +luaver=$(ls lua-*.tar.gz | grep -Eo "lua-.\\..") +mkdir "$luaver" +tar -xvzf lua-*.tar.gz --directory="$luaver" --strip-components=1 +rm /root/$luaver/src/*.c +rm -rf /root/$luaver/doc +rm -rf /root/$luaver/test +rm -rf /root/$luaver/etc +rm /root/*.tar.gz +rm -rf /root/image-mingw64 +luarocks config arch $arch +luarocks config link_lua_explicitly true diff --git a/meta.lua b/meta.lua index 65e58da..a950f7e 100644 --- a/meta.lua +++ b/meta.lua @@ -1,6 +1,37 @@ -return { - ["image-luarocks"] = { - requires = {}, - produces = {}, - } + +local lua_versions = { + ["51"] = "https://www.lua.org/ftp/lua-5.1.5.tar.gz", + --[[ + ["52"] = "https://www.lua.org/ftp/lua-5.2.4.tar.gz", + ["53"] = "https://www.lua.org/ftp/lua-5.3.6.tar.gz", + ["54"] = "https://www.lua.org/ftp/lua-5.4.7.tar.gz", + ]] } +local sources = { + --mingw32 = "mingw32-x86", + mignw64 = "mingw32-x86_64", + --"clang32", + --"claing64" +} + +local builds = {} + +for image, arch, version, link in cartesian(sources, lua_versions) do + builds["image-luarocks-" .. version.. "-" .. image] = { + image = "image-" .. image, + requires = { + {"http", link} + + }, + produces = {}, + export = true, + env = { + maj = version:match("(%d)%d"), + min = version:match("%d(%d)"), + arch = arch + } + } +end + + +return builds -- cgit v1.2.3-55-g6feb