summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander M Pickering <alex@cogarr.net>2024-11-22 17:41:20 -0600
committerAlexander M Pickering <alex@cogarr.net>2024-11-22 17:41:20 -0600
commitedf05590e666ca35a3a512aa49e26e9eae153ece (patch)
tree68707c5122b891bd141c1b745ec73af4098bd783
parent5282a90383bec06b6c276c03c767de42d6a6b87d (diff)
downloadlua-compat-53-packaging-edf05590e666ca35a3a512aa49e26e9eae153ece.tar.gz
lua-compat-53-packaging-edf05590e666ca35a3a512aa49e26e9eae153ece.tar.bz2
lua-compat-53-packaging-edf05590e666ca35a3a512aa49e26e9eae153ece.zip
Break bit32 into it's own build target.
-rwxr-xr-xbit3218
-rwxr-xr-xinit20
-rw-r--r--meta.lua35
3 files changed, 50 insertions, 23 deletions
diff --git a/bit32 b/bit32
new file mode 100755
index 0000000..90534bd
--- /dev/null
+++ b/bit32
@@ -0,0 +1,18 @@
1#!/bin/sh -ex
2
3cd lua-compat-5.3
4cp rockspecs/bit32-scm-1.rockspec .
5luarocks config variables.CFLAGS " $CFLAGS"
6luarocks make --pack-binary-rock bit32-scm-1.rockspec
7obj="bit32-scm-1.$(luarocks config arch).rock"
8cp $obj /root
9cd /root
10if [ -z $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then
11 # Release build, delete docs/ and tests/
12 zip -d $obj doc/ doc/*
13 # And pack the library with upx
14 unzip $obj lib/*
15 upx --no-progress lib/*
16 zip -r "$obj" lib
17 rm -rf lib
18fi
diff --git a/init b/init
index 5ffad4d..86d8c92 100755
--- a/init
+++ b/init
@@ -2,27 +2,17 @@
2 2
3cd lua-compat-5.3 3cd lua-compat-5.3
4cp rockspecs/compat53-$packver.rockspec . 4cp rockspecs/compat53-$packver.rockspec .
5cp rockspecs/bit32-$packver.rockspec .
6luarocks config variables.CFLAGS " $CFLAGS" 5luarocks config variables.CFLAGS " $CFLAGS"
7luarocks make --pack-binary-rock compat53-$packver.rockspec 6luarocks make --pack-binary-rock compat53-$packver.rockspec
8luarocks make --pack-binary-rock bit32-$packver.rockspec 7obj="compat53-$packver.$(luarocks config arch).rock"
9obj1="compat53-$packver.$(luarocks config arch).rock" 8cp $obj /root
10obj2="bit32-$packver.$(luarocks config arch).rock"
11cp $obj1 /root
12cp $obj2 /root
13cd /root 9cd /root
14if [ -z $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then 10if [ -z $(echo $CFLAGS | grep -o -E -- '( |^)-g( |$)') ]; then
15 # Release build, delete docs/ and tests/ 11 # Release build, delete docs/ and tests/
16 zip -d $obj1 doc/ doc/* 12 zip -d $obj doc/ doc/*
17 zip -d $obj2 doc/ doc/*
18 # And pack the library with upx 13 # And pack the library with upx
19 unzip $obj1 lib/* 14 unzip $obj lib/*
20 upx --no-progress lib/compat53/* 15 upx --no-progress lib/compat53/*
21 zip -r "$obj1" lib 16 zip -r "$obj" lib
22 rm -rf lib
23
24 unzip $obj2 lib/*
25 upx --no-progress lib/*
26 zip -r "$obj2" lib
27 rm -rf lib 17 rm -rf lib
28fi 18fi
diff --git a/meta.lua b/meta.lua
index 1b67b20..7362ad1 100644
--- a/meta.lua
+++ b/meta.lua
@@ -1,4 +1,4 @@
1local package_versions = { 1local compat_versions = {
2 ["scm-1"] = true, 2 ["scm-1"] = true,
3 ["0.12-1"] = true 3 ["0.12-1"] = true
4} 4}
@@ -24,22 +24,41 @@ local debug = {
24local compilers = {--[["mingw32",]]"mingw64"--[[,"clang32","clang64"]]} 24local compilers = {--[["mingw32",]]"mingw64"--[[,"clang32","clang64"]]}
25 25
26local builds = {} 26local builds = {}
27for package_version, _, version, _, name, optimization, rel, flag, _, image in cartesian(package_versions, lua_versions, optimizations, debug, compilers) do 27for version, _, name, optimization, rel, flag, _, image in cartesian(lua_versions, optimizations, debug, compilers) do
28 local buildname = "lua-compat-53-".. package_version:gsub("[%W]","-") .. "-" .. version .. "-" .. name .. "-" .. rel .. "-" .. image 28 for package_version,_ in pairs(compat_versions) do
29 builds[buildname] = { 29 local buildname = "lua-compat-53-" .. version .. "-" .. name .. "-" .. rel .. "-" .. image
30 image = "image-luarocks-" .. version.. "-" .. image, 30 builds[buildname] = {
31 image = "image-luarocks-" .. version.. "-" .. image,
32 requires = {
33 {"git", "lua-compat-5.3"},
34 {"cicd","image-luarocks-" .. version .. "-" .. image},
35 {"cicd","lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image .. ":lua" .. version .. ".dll"},
36 },
37 produces = {
38 ["compat53-" .. package_version .. ".mingw32-x86_64.rock"] = {"luarocks.sh", "compat53", image, version, name, rel},
39 },
40 env = {
41 CFLAGS = optimization .. " " .. flag,
42 packver = package_version,
43 rockver = version:gsub("(%d)(%d)$","%1.%2"),
44 version = version
45 },
46 }
47 end
48 local buildname2 = "lua-bit32-" .. version .. "-" .. name .. "-" .. rel .. "-" .. image
49 builds[buildname2] = {
50 image = "image-luarocks-" .. version .. "-" .. image,
51 entrypoint="bit32",
31 requires = { 52 requires = {
32 {"git", "lua-compat-5.3"}, 53 {"git", "lua-compat-5.3"},
33 {"cicd","image-luarocks-" .. version .. "-" .. image}, 54 {"cicd","image-luarocks-" .. version .. "-" .. image},
34 {"cicd","lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image .. ":lua" .. version .. ".dll"}, 55 {"cicd","lua" .. version .. "-" .. name .. "-" .. rel .. "-" .. image .. ":lua" .. version .. ".dll"},
35 }, 56 },
36 produces = { 57 produces = {
37 ["compat53-" .. package_version .. ".mingw32-x86_64.rock"] = {"luarocks.sh", "compat53", image, version, name, rel}, 58 ["bit32-scm-1.mingw32-x86_64.rock"] = {"luarocks.sh", "bit32", image, version, name, rel},
38 ["bit32-" .. package_version .. ".mingw32-x86_64.rock"] = {"luarocks.sh", "bit32", image, version, name, rel},
39 }, 59 },
40 env = { 60 env = {
41 CFLAGS = optimization .. " " .. flag, 61 CFLAGS = optimization .. " " .. flag,
42 packver = package_version,
43 rockver = version:gsub("(%d)(%d)$","%1.%2"), 62 rockver = version:gsub("(%d)(%d)$","%1.%2"),
44 version = version 63 version = version
45 }, 64 },