diff options
author | Alexander M Pickering <alex@cogarr.net> | 2024-12-09 00:00:36 -0600 |
---|---|---|
committer | Alexander M Pickering <alex@cogarr.net> | 2024-12-09 00:00:36 -0600 |
commit | 4d311dd0ea315d09154cae4d4212f6b14e3ae211 (patch) | |
tree | f97b0bcfd27b9940d8842ba904a427f8d0b9f716 | |
parent | d42f7ceae0825a1b66b33dd10ee371fde230b59b (diff) | |
download | luasystem-packaging-4d311dd0ea315d09154cae4d4212f6b14e3ae211.tar.gz luasystem-packaging-4d311dd0ea315d09154cae4d4212f6b14e3ae211.tar.bz2 luasystem-packaging-4d311dd0ea315d09154cae4d4212f6b14e3ae211.zip |
Inital stab at packaging
-rwxr-xr-x | init | 14 | ||||
-rw-r--r-- | meta.lua | 54 |
2 files changed, 63 insertions, 5 deletions
@@ -1 +1,15 @@ | |||
1 | #!/bin/sh -ex | 1 | #!/bin/sh -ex |
2 | |||
3 | cd luasystem | ||
4 | mv rockspecs/* . | ||
5 | luarocks config variables.CFLAGS " $CFLAGS" | ||
6 | luarocks make --pack-binary-rock luasystem-$packver.rockspec | ||
7 | obj="luasystem-$packver.$(luarocks config arch).rock" | ||
8 | cp $obj /root | ||
9 | cd /root | ||
10 | if [ -z $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then | ||
11 | # And pack the library with upx | ||
12 | unzip $obj lib/* | ||
13 | upx --no-progress lib/* | ||
14 | zip -r "$obj" lib | ||
15 | fi | ||
@@ -1,6 +1,50 @@ | |||
1 | return { | 1 | local lua_versions = { |
2 | ["luasystem"] = { | 2 | ["51"] = true, |
3 | requires = {}, | 3 | ["52"] = true, |
4 | produces = {}, | 4 | ["53"] = true, |
5 | } | 5 | ["54"] = true, |
6 | } | 6 | } |
7 | local package_versions = { | ||
8 | ["0.4.4-1"] = true, | ||
9 | ["scm-0"] = true | ||
10 | } | ||
11 | local optimizations = { | ||
12 | tiny = "-Oz", | ||
13 | size = "-Os", | ||
14 | zero = "-O0", | ||
15 | one = "-O1", | ||
16 | two = "-O2", | ||
17 | three = "-O3", | ||
18 | debug = "-Og" | ||
19 | } | ||
20 | local debug = { | ||
21 | release = "", | ||
22 | debug = "-g", | ||
23 | } | ||
24 | local compilers = {--[["mingw32",]]"mingw64"--[[,"clang32","clang64"]]} | ||
25 | |||
26 | local builds = {} | ||
27 | for version, _, name, optimization, rel, flag, _, image in cartesian(lua_versions, optimizations, debug, compilers) do | ||
28 | for package_version, _ in pairs(package_versions) do | ||
29 | local buildname = "luasystem-" .. package_version:gsub("[%W]","-") .. "-" .. version .. "-" .. name .. "-" .. rel .. "-" .. image | ||
30 | builds[buildname] = { | ||
31 | image = "image-luarocks-" .. version.. "-" .. image, | ||
32 | requires = { | ||
33 | {"git", "luasystem"}, | ||
34 | {"cicd","image-luarocks-" .. version .. "-" .. image}, | ||
35 | {"cicd","lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image .. ":lua" .. version .. ".dll"}, | ||
36 | }, | ||
37 | produces = { | ||
38 | ["luasystem-" .. package_version .. ".mingw32-x86_64.rock"] = {"luarocks.sh", "luasystem", image, version, name, rel}, | ||
39 | }, | ||
40 | env = { | ||
41 | CFLAGS = optimization .. " " .. flag, | ||
42 | rockver = version:gsub("(%d)(%d)$","%1.%2"), | ||
43 | version = version, | ||
44 | packver = package_version, | ||
45 | }, | ||
46 | } | ||
47 | end | ||
48 | end | ||
49 | |||
50 | return builds | ||