From ae3e8e4331852dc89479fba5c5175721bd27c20e Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Mon, 29 Jul 2024 16:32:59 -0500 Subject: Start working on builds --- init | 10 +++++++++- meta.lua | 49 +++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/init b/init index 30ad5d0..d9c208f 100755 --- a/init +++ b/init @@ -1,2 +1,10 @@ #!/bin/sh -ex -ls -lah + +luaver=$(ls lua-*.tar.gz | grep -Eo "lua-.\\..") +mkdir "$luaver" +tar -xvzf lua-*.tar.gz --directory="$luaver" --strip-components=1 +cd "$luaver" +make mingw "CFLAGS= -Wall -Wextra -std=c99 -pedantic $1 $2" +cd "/root/" +cp "$luaver/src/*.exe" . +cp "$luaver/src/*.dll" . diff --git a/meta.lua b/meta.lua index 6fd3d9b..7ac570f 100644 --- a/meta.lua +++ b/meta.lua @@ -1,11 +1,44 @@ -local lua_versions = {"5.1","5.2","5.3","5.4"} +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"]]} +-- We can't actually use the git version from github, it's missing luac.c, which is needed to build the luac executable. +-- Even though early makefiles, and later `onelua.c` files suggest it should exist. -return { - { - name = "lua51", +local builds = {} +for version, link, name, optimization, rel, flag, _, image in cartesian(lua_versions, optimizations, debug, compilers) do + table.insert(builds,{ + image = "image-" .. compilers, + name = "lua" .. version .. optimization .. "-" .. rel .. "-" .. name .. "-" .. image, requires = { - {"git","lua#v5.1"}, + {"http", link}, }, - produces = {}, - } -} + produces = { + "lua.exe", + "lua" .. version .. ".dll", + "luac.exe", + }, + entrypoint = "init " .. rel .. " " .. flag, + }) +end +return builds -- cgit v1.2.3-55-g6feb