From e78ecdba666ffea5f476a206795fcec062a497a1 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Wed, 25 Sep 2024 17:16:56 -0500 Subject: Remove extra debugging --- init | 95 -------------------------------------------------------------------- 1 file changed, 95 deletions(-) diff --git a/init b/init index 58d77df..f461251 100755 --- a/init +++ b/init @@ -10,101 +10,6 @@ mkdir build-binary sed -i 's/local program_version = "dev"/local program_version = "lua4.win"/g' /root/luarocks/src/luarocks/core/cfg.lua patch -i /root/luarocks-packaging/all_in_one.patch binary/all_in_one LUAROCKS_CROSS_COMPILING=1 lua5.4 binary/all_in_one "src/bin/luarocks" "" "^src/luarocks/admin/" "/config" "build-binary" "yes" "windows" -cat src/luarocks/core/hardcoded.lua patch -i /root/luarocks-packaging/luarocks.exe.c.patch build-binary/luarocks.exe.c 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 cp build-binary/luarocks.exe /root -#cd luarocks/binary -# mkdir -p build-windows-deps-cicd/lib -# cd build-windows-deps-cicd/lib -# cp /root/liblua.a . -# cp /root/libssl.a . -# cp /root/libz.a . -# cp /root/libbz2.a . -# cd .. -# mkdir bin -# cd bin -# cp /root/*.exe . -# -# mkdir -p windows-deps-cicd/lib -# -# cd ../../.. -#LUA_BINDIR=binary/build-windows-deps-cicd/bin -#./configure --disable-incdir-check --with-lua=binary/build-windows-deps-cicd/bin --with-lua-lib=binary/build-windows-deps/lib -#make -f binary/Makefile.windows BUILD_WINDOWS_DEPS_DIR= -#LUAROCKS_CROSS_COMPILING=1 make binary LUA_DIR=binary/build-windows-deps-cicd/bin CC=gcc NM=nm BINARY_PLATFORM=windows -# all_in_one generates a series of files: -# dir .. "/luarocks/core/hardcoded.lua" -# -# SYSTEM = "windows" -# PROCESSOR = "x86" | "i686" -# FORCE_CONFIG = true -# IS_BINARY = true -# -# --------------------- -# Ok this file is actually pretty involved -# I think the strategy is to modify all_in_one to not call main(), and instead -# call generate() directly. This will output, among other things, luarocks.exe.c, -# (and compile it), but we can re-compile with different cflags if we want. -# We probably also need a bunch of precompiled windows .a to get it to compile. -# TARGET_DIR .. "/" .. program_name .. ".exe.c" -# -# [[static const char* progname = "";]] -# -# [[static void load_main(lua_State* L) {]] -# -# [[if(luaL_loadbuffer(L, code, sizeof(code), "") != LUA_OK) {]] -# [[ fatal(lua_tostring(L, -1));]] -# [[}]] -# [[}]] -# -# ---------------------- -# Lets modify all_in_one: delete the last line that calls main() and replace it -# with: -# cfg.init() -# cfg.variables.LUA_INCDIR_OK = true -# cfg.variables.LUA_LIBDIR_OK = true -# fs.init() -# generate(MAIN_PROGRAM, "src", {EXCLUDE, "^bin/?"}) - -# Make the output directory -# mkdir build-binary -# Then call it like: -# LUAROCKS_CROSS_COMPILING=1 lua5.4 binary/all_in_one - -# Patches to make all_in_one work with lua 5.1: -# Lua 5.1 never defined LUA_OK, which all_in_one uses to check luaL_loadbuffer(), -# define it in the preamble if it doesn't already exist. - -#ifndef LUA_OK -#define LUA_OK 0 -#endif - -# Lua 5.1 doesn't define lua_copy or luaL_traceback, -# for lua_copy, we can rewrite with lua_replace() since we're moving the top element. -# line 137: lua_replace(L,3); -# -# Lua 5.1 doesn't define luaL_traceback(), here's what it looks like in 5.1 lua.c: -#ifndef luaL_traceback -# static inline void -# luaL_traceback(lua_State *L, lua_State *L1, const char *msg, int level){ -# lua_getfield(L, LUA_GLOBALSINDEX, "debug"); -# if(!lua_istable(L,-1)){ -# lua_pop(L,1); -# return; -# } -# lua_getfield(L, -1, "traceback"); -# if(!lua_isfunction(L,-1)){ -# lua_pop(L,2); -# return; -# } -# lua_pushthread(L1); -# lua_pushstring(L,msg); -# lua_pushnumber(L,level); -# lua_call(L,3,1); -# return; -# } -#endif - -# Finally, use gcc to build: -#gcc -o build-binary/luarocks.exe -Os build-binary/luarocks.exe.c -I/root/lua/src /root/libz2.a /root/libssl.a /root/libz.a /root/liblua.a -mconsole -mwindows -lm -- cgit v1.2.3-55-g6feb