From fbb21e7aa341b968c9f3577fef3c6580ffcceb11 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Thu, 27 Feb 2025 13:44:15 -0600 Subject: Start work --- init | 14 ++++++++++++++ lpeglabel-1.6.2-1.rockspec | 35 ++++++++++++++++++++++++++++++++++ meta.lua | 47 +++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 lpeglabel-1.6.2-1.rockspec diff --git a/init b/init index 642d265..eb031e0 100755 --- a/init +++ b/init @@ -1 +1,15 @@ #!/bin/sh -ex + +cp lpeglabel-packaging/*.rockspec lpeglabel +cd lpeglabel +luarocks config variables.CFLAGS " $CFLAGS" +luarocks make --pack-binary-rock lpeglabel-1.6.2-1.rockspec +obj="lpeg-1.6.2-1.$(luarocks config arch).rock" +cp $obj /root +cd /root +if [ -z $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then + # And pack the library with upx + unzip $obj lib/* + upx --no-progress lib/* + zip -r "$obj" lib +fi diff --git a/lpeglabel-1.6.2-1.rockspec b/lpeglabel-1.6.2-1.rockspec new file mode 100644 index 0000000..911f753 --- /dev/null +++ b/lpeglabel-1.6.2-1.rockspec @@ -0,0 +1,35 @@ +package = "LPegLabel" +version = "1.6.2-1" +source = { + url = "https://github.com/sqmedeiros/lpeglabel/archive/v1.6.2-1.tar.gz", + tag = "v1.6.2-1", + dir = "lpeglabel-1.6.2-1", +} +description = { + summary = "Parsing Expression Grammars For Lua with Labeled Failures", + detailed = [[ + LPegLabel is a conservative extension of the LPeg library that provides + an implementation of Parsing Expression Grammars (PEGs) with labeled failures. + By using labeled failures we can properly report syntactical errors. + We can also recover from such errors by describing a grammar rule with + the same name of a given label. + LPegLabel also reports the farthest failure position in case of an ordinary failure. + + This version was repackaged for lua4.win, send bug reports there first. + ]], + homepage = "https://github.com/sqmedeiros/lpeglabel/", + maintainer = "Alex Pickering ", + license = "MIT/X11" +} +dependencies = { + "lua >= 5.1", +} +build = { + type = "builtin", + modules = { + lpeglabel = { + "lplcap.c", "lplcode.c", "lplprint.c", "lpltree.c", "lplvm.c" + }, + relabel = "relabel.lua" + } +} diff --git a/meta.lua b/meta.lua index 438a99e..c468467 100644 --- a/meta.lua +++ b/meta.lua @@ -1,6 +1,43 @@ -return { - ["lpeglabel"] = { - 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 = "lpeglabel-" .. version .. "-" .. name .. "-" .. rel .. "-" .. image + builds[buildname] = { + image = "image-luarocks-" .. version.. "-" .. image, + requires = { + {"git", "lpeglabel"}, + {"cicd","image-luarocks-" .. version .. "-" .. image}, + {"cicd","lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image .. ":lua" .. version .. ".dll"}, + }, + produces = { + ["lpeglabel-1.6.2-1.mingw32-x86_64.rock"] = {"luarocks.sh", "lpeglabel", image, version, name, rel}, + }, + env = { + CFLAGS = optimization .. " " .. flag, + rockver = version:gsub("(%d)(%d)$","%1.%2"), + version = version + }, + } +end + +return builds -- cgit v1.2.3-55-g6feb