aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander M Pickering <alex@cogarr.net>2024-09-23 10:06:19 -0500
committerAlexander M Pickering <alex@cogarr.net>2024-09-23 10:06:19 -0500
commitfd91580f2d8860d044bbb2237ecc9e6ec0fa0124 (patch)
treee92a26bbc82f1fa44c217e627ab63085d17f7fab
parentbc34aa29dad6ed73049beaf1e3513c0a7ea9e09e (diff)
downloadluarocks-packaging-fd91580f2d8860d044bbb2237ecc9e6ec0fa0124.tar.gz
luarocks-packaging-fd91580f2d8860d044bbb2237ecc9e6ec0fa0124.tar.bz2
luarocks-packaging-fd91580f2d8860d044bbb2237ecc9e6ec0fa0124.zip
Reorder dependencies to include lua
-rwxr-xr-xinit43
-rw-r--r--meta.lua17
2 files changed, 55 insertions, 5 deletions
diff --git a/init b/init
index 8aa8d04..26b3428 100755
--- a/init
+++ b/init
@@ -12,8 +12,51 @@ cp /root/libz.a .
12cp /root/libbz2.a . 12cp /root/libbz2.a .
13cd .. 13cd ..
14mkdir bin 14mkdir bin
15cd bin
15cp /root/*.exe . 16cp /root/*.exe .
16 17
18mkdir -p windows-deps-cicd/lib
19
17cd ../../.. 20cd ../../..
18LUA_BINDIR=binary/build-windows-deps-cicd/bin 21LUA_BINDIR=binary/build-windows-deps-cicd/bin
19./configure --disable-incdir-check --with-lua=binary/build-windows-deps-cicd/bin --with-lua-lib=binary/build-windows-deps/lib 22./configure --disable-incdir-check --with-lua=binary/build-windows-deps-cicd/bin --with-lua-lib=binary/build-windows-deps/lib
23make -f binary/Makefile.windows BUILD_WINDOWS_DEPS_DIR=
24LUAROCKS_CROSS_COMPILING=1 make binary LUA_DIR=binary/build-windows-deps-cicd/bin CC=gcc NM=nm BINARY_PLATFORM=windows
25# all_in_one generates a series of files:
26# dir .. "/luarocks/core/hardcoded.lua"
27#
28# SYSTEM = "windows"
29# PROCESSOR = "x86" | "i686"
30# FORCE_CONFIG = true
31# IS_BINARY = true
32#
33# ---------------------
34# Ok this file is actually pretty involved
35# I think the strategy is to modify all_in_one to not call main(), and instead
36# call generate() directly. This will output, among other things, luarocks.exe.c,
37# (and compile it), but we can re-compile with different cflags if we want.
38# We probably also need a bunch of precompiled windows .a to get it to compile.
39# TARGET_DIR .. "/" .. program_name .. ".exe.c"
40#
41# [[static const char* progname = "<program_name>";]]
42# <c_preamble>
43# [[static void load_main(lua_State* L) {]]
44# <bin2c src/bin/luarocks>
45# [[if(luaL_loadbuffer(L, code, sizeof(code), "<program_name>") != LUA_OK) {]]
46# [[ fatal(lua_tostring(L, -1));]]
47# [[}]]
48# [[}]]
49#
50# ----------------------
51# Lets modify all_in_one: delete the last line that calls main() and replace it
52# with:
53cfg.init()
54cfg.variables.LUA_INCDIR_OK = true
55cfg.variables.LUA_LIBDIR_OK = true
56fs.init()
57generate(MAIN_PROGRAM, "src", {EXCLUDE, "^bin/?"})
58
59# Make the output directory
60mkdir build-binary
61# Then call it like:
62LUAROCKS_CROSS_COMPILING=1 lua5.4 binary/all_in_one
diff --git a/meta.lua b/meta.lua
index be3565e..60f7f2d 100644
--- a/meta.lua
+++ b/meta.lua
@@ -1,5 +1,10 @@
1local lua_versions = { 1local lua_versions = {
2 ["51"] = {"liblua.a", "lua.exe", "lua51.dll"}, 2 ["51"] = {
3 link = "https://www.lua.org/ftp/lua-5.1.5.tar.gz",
4 slib = "liblua.a",
5 bin = "lua.exe",
6 dlib = "lua51.dll"
7 },
3 --[[ 8 --[[
4 ["52"] = {"liblua.a", "lua.exe", "lua52.dll"}, 9 ["52"] = {"liblua.a", "lua.exe", "lua52.dll"},
5 ["53"] = {"liblua.a", "lua.exe", "lua53.dll"}, 10 ["53"] = {"liblua.a", "lua.exe", "lua53.dll"},
@@ -33,15 +38,17 @@ for version_k, version_v, opti_k, opti_v, debug_k, debug_v, comp_k, comp_v in ca
33 image="image-" .. comp_v, 38 image="image-" .. comp_v,
34 requires = { 39 requires = {
35 {"git", "luarocks"}, 40 {"git", "luarocks"},
41 {"http", version_v.link},
42 {"cicd", "lua" .. version_k .. "-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":" .. version_v.slib},
43 {"cicd", "lua" .. version_k .. "-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":" .. version_v.bin},
44 {"cicd", "lua" .. version_k .. "-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":" .. version_v.dlib},
45 {"cicd", "bzip2-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":libbz2.a"},
36 {"cicd", "libressl-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":libssl.a"}, 46 {"cicd", "libressl-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":libssl.a"},
37 {"cicd", "libz-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":libz.a"}, 47 {"cicd", "libz-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":libz.a"},
38 {"cicd", "lua" .. version_k .. "-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":" .. version_v[1]},
39 {"cicd", "lua" .. version_k .. "-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":" .. version_v[2]},
40 {"cicd", "lua" .. version_k .. "-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":" .. version_v[3]},
41 {"cicd", "bzip2-" .. opti_k .. "-" .. debug_k .. "-" .. comp_v .. ":libbz2.a"},
42 }, 48 },
43 produces = { 49 produces = {
44 ["luarocks.exe"] = true, 50 ["luarocks.exe"] = true,
51 ["luarocks-admin.exe"] = true,
45 }, 52 },
46 env = { 53 env = {
47 CFLAGS=" " .. opti_v .. " " .. debug_v, 54 CFLAGS=" " .. opti_v .. " " .. debug_v,