From f709bc88f3fda4f1669f5d455ece2eaba293ede0 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Mon, 5 Aug 2024 18:40:46 -0500 Subject: Start working on filesystem --- init | 2 +- meta.lua | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----- prepare | 9 +++++++++ 3 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 prepare diff --git a/init b/init index 250276c..642d265 100755 --- a/init +++ b/init @@ -1 +1 @@ -#!/bin/bash -ex +#!/bin/sh -ex diff --git a/meta.lua b/meta.lua index 705152e..49bcc29 100644 --- a/meta.lua +++ b/meta.lua @@ -1,7 +1,57 @@ -return { - { - name = "##NAME##", - requires = {}, +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 optimizations = { + --[[ + size = "-Os", + zero = "-O0", + one = "-O1", + two = "-O2", + ]] + three = "-O3", +} +local debug = { + --[[ + release = "", + ]] + debug = "-g", +} +local compilers = {--[["mingw32",]]"mingw64"--[[,"clang32","clang64"]]} + +local builds = {} +for _,image,lua_ver,link in cartesian(compilers,lua_versions) do + builds["image-luafilesystem-" .. image .. "-lua" .. lua_ver] = { + image = "image-luafilesystem" .. image .. "-lua" .. lua_ver, + requires = { + {"http",link} + }, produces = {}, + export = true, + entrypoint = "prepare", + env = { + rockver = lua_ver:gsub("(%d)(%d)$","%1.%2") + } } -} +end +for version, link, name, optimization, rel, flag, _, image in cartesian(lua_versions, optimizations, debug, compilers) do + local name = "lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image + builds[name] = { + image = "image-luafilesystem-" .. image .. "-lua" .. lua_ver, + requires = { + {"git", "luafilesystem"}, + {"cicd","lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image}, + }, + produces = { + "luafilesystem-git-1.win32-" .. image .. ".rock" + }, + env = { + CFLAGS = optimization .. " " .. flag, + rockver = lua_ver:gsub("(%d)(%d)$","%1.%2") + }, + } +end diff --git a/prepare b/prepare new file mode 100644 index 0000000..73e85b6 --- /dev/null +++ b/prepare @@ -0,0 +1,9 @@ +#!/bin/sh -ex + +apk add luarocks$rocks_ver +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" +luarocks-$rocks_ver config variables.LUA_INCDIR "/root/$luaver/src" +luarocks-$rocks_ver config variables.CFLAGS "$CFLAGS" -- cgit v1.2.3-55-g6feb