diff options
author | Alexander M Pickering <alex@cogarr.net> | 2024-09-23 15:31:19 -0500 |
---|---|---|
committer | Alexander M Pickering <alex@cogarr.net> | 2024-09-23 15:31:19 -0500 |
commit | cbd88cf79dd21911003efde5b9c9c3d476b5af8c (patch) | |
tree | d2347095cd9832dfab612e9d677707eb6879d1b5 | |
parent | ee696544d079d3fb1699a838e2dcb7e61bffda8a (diff) | |
download | luarocks-packaging-cbd88cf79dd21911003efde5b9c9c3d476b5af8c.tar.gz luarocks-packaging-cbd88cf79dd21911003efde5b9c9c3d476b5af8c.tar.bz2 luarocks-packaging-cbd88cf79dd21911003efde5b9c9c3d476b5af8c.zip |
Add a patch for luarocks.exe.c
-rw-r--r-- | all_in_one.patch | 2 | ||||
-rwxr-xr-x | init | 9 | ||||
-rw-r--r-- | luarocks.exe.c.patch | 47 | ||||
-rw-r--r-- | meta.lua | 1 |
4 files changed, 54 insertions, 5 deletions
diff --git a/all_in_one.patch b/all_in_one.patch index 234bcb7..adc49b9 100644 --- a/all_in_one.patch +++ b/all_in_one.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | --- "binary/all_in_one.orig" 2024-09-23 13:31:16.489277700 -0500 | 1 | --- "binary/all_in_one" 2024-09-23 13:31:16.489277700 -0500 |
2 | +++ "binary/all_in_one" 2024-09-23 13:31:14.032152500 -0500 | 2 | +++ "binary/all_in_one" 2024-09-23 13:31:14.032152500 -0500 |
3 | @@ -406,27 +406,6 @@ | 3 | @@ -406,27 +406,6 @@ |
4 | fd:write(reindent_c(table.concat(out, "\n"))) | 4 | fd:write(reindent_c(table.concat(out, "\n"))) |
@@ -3,13 +3,16 @@ | |||
3 | if [ -e libluajit.a ]; then | 3 | if [ -e libluajit.a ]; then |
4 | mv libluajit.a liblua.a | 4 | mv libluajit.a liblua.a |
5 | fi | 5 | fi |
6 | mkdir lua | ||
6 | tar -xvzf lua-*.tar.gz --directory="lua" --strip-components=1 | 7 | tar -xvzf lua-*.tar.gz --directory="lua" --strip-components=1 |
7 | mv hardcoded.lua luarocks/src/core/hardcoded.lua | 8 | mv luarocks-packaging/hardcoded.lua luarocks/src/luarocks/core/hardcoded.lua |
8 | cd luarocks | 9 | cd luarocks |
9 | mkdir build-binary | 10 | mkdir build-binary |
10 | patch -p1 -i /root/luarocks-packaging/all_in_one.patch | 11 | patch -i /root/luarocks-packaging/all_in_one.patch binary/all_in_one |
11 | LUAROCKS_CROSS_COMPILING=1 lua5.4 binary/all_in_one | 12 | LUAROCKS_CROSS_COMPILING=1 lua5.4 binary/all_in_one |
12 | 13 | patch -i /root/luarocks-packaging/luarocks.exe.c.patch build-binary/luarocks.exe.c | |
14 | gcc -o build-binary/luarocks.exe -Oz build-binary/luarocks.exe.c -I/root/lua/src /root/libbz2.a /root/libssl.a /root/libz.a /root/liblua.a -mconsole -mwindows -lm | ||
15 | cp build-binary/luarocks.exe /root | ||
13 | #cd luarocks/binary | 16 | #cd luarocks/binary |
14 | # mkdir -p build-windows-deps-cicd/lib | 17 | # mkdir -p build-windows-deps-cicd/lib |
15 | # cd build-windows-deps-cicd/lib | 18 | # cd build-windows-deps-cicd/lib |
diff --git a/luarocks.exe.c.patch b/luarocks.exe.c.patch new file mode 100644 index 0000000..5410bfc --- /dev/null +++ b/luarocks.exe.c.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | --- luarocks.exe.c 2024-09-23 15:27:52.663551300 -0500 | ||
2 | +++ luarocks.exe.c.orig 2024-09-23 15:25:00.870448000 -0500 | ||
3 | @@ -17,33 +17,6 @@ | ||
4 | #define getprogname() | ||
5 | #endif | ||
6 | |||
7 | -/* LUA_OK defined in lua 5.2+ */ | ||
8 | -#ifndef LUA_OK | ||
9 | -#define LUA_OK 0 | ||
10 | -#endif | ||
11 | - | ||
12 | -/* luaL_traceback() introduced in lua 5.2 */ | ||
13 | -#ifndef luaL_traceback | ||
14 | -static inline void | ||
15 | -luaL_traceback(lua_State *L, lua_State *L1, const char *msg, int level){ | ||
16 | - lua_getfield(L, LUA_GLOBALSINDEX, "debug"); | ||
17 | - if(!lua_istable(L,-1)){ | ||
18 | - lua_pop(L,1); | ||
19 | - return; | ||
20 | - } | ||
21 | - lua_getfield(L, -1, "traceback"); | ||
22 | - if(!lua_isfunction(L,-1)){ | ||
23 | - lua_pop(L,2); | ||
24 | - return; | ||
25 | - } | ||
26 | - lua_pushthread(L1); | ||
27 | - lua_pushstring(L,msg); | ||
28 | - lua_pushnumber(L,level); | ||
29 | - lua_call(L,3,1); | ||
30 | - return; | ||
31 | -} | ||
32 | -#endif | ||
33 | - | ||
34 | static int registry_key; | ||
35 | |||
36 | /* fatal error, from srlua */ | ||
37 | @@ -38309,9 +38282,7 @@ | ||
38 | lua_pop(L, 1); | ||
39 | lua_getfield(L, -1, "loaders"); /* table table.insert package package.loaders */ | ||
40 | } | ||
41 | - /* lua_copy introduced in lua 5.2 */ | ||
42 | - lua_replace(L,3); | ||
43 | - //lua_copy(L, 4, 3); /* table table.insert package.searchers */ | ||
44 | + lua_copy(L, 4, 3); /* table table.insert package.searchers */ | ||
45 | lua_settop(L, 3); /* table table.insert package.searchers */ | ||
46 | lua_pushnumber(L, 1); /* table table.insert package.searchers 1 */ | ||
47 | lua_pushcfunction(L, pkg_loader); /* table table.insert package.searchers 1 pkg_loader */ | ||
@@ -48,7 +48,6 @@ for version_k, version_v, opti_k, opti_v, debug_k, debug_v, comp_k, comp_v in ca | |||
48 | }, | 48 | }, |
49 | produces = { | 49 | produces = { |
50 | ["luarocks.exe"] = true, | 50 | ["luarocks.exe"] = true, |
51 | ["luarocks-admin.exe"] = true, | ||
52 | }, | 51 | }, |
53 | env = { | 52 | env = { |
54 | CFLAGS=" " .. opti_v .. " " .. debug_v, | 53 | CFLAGS=" " .. opti_v .. " " .. debug_v, |