diff options
| -rwxr-xr-x | init | 43 | ||||
| -rw-r--r-- | meta.lua | 17 |
2 files changed, 55 insertions, 5 deletions
| @@ -12,8 +12,51 @@ cp /root/libz.a . | |||
| 12 | cp /root/libbz2.a . | 12 | cp /root/libbz2.a . |
| 13 | cd .. | 13 | cd .. |
| 14 | mkdir bin | 14 | mkdir bin |
| 15 | cd bin | ||
| 15 | cp /root/*.exe . | 16 | cp /root/*.exe . |
| 16 | 17 | ||
| 18 | mkdir -p windows-deps-cicd/lib | ||
| 19 | |||
| 17 | cd ../../.. | 20 | cd ../../.. |
| 18 | LUA_BINDIR=binary/build-windows-deps-cicd/bin | 21 | LUA_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 |
| 23 | make -f binary/Makefile.windows BUILD_WINDOWS_DEPS_DIR= | ||
| 24 | LUAROCKS_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: | ||
| 53 | cfg.init() | ||
| 54 | cfg.variables.LUA_INCDIR_OK = true | ||
| 55 | cfg.variables.LUA_LIBDIR_OK = true | ||
| 56 | fs.init() | ||
| 57 | generate(MAIN_PROGRAM, "src", {EXCLUDE, "^bin/?"}) | ||
| 58 | |||
| 59 | # Make the output directory | ||
| 60 | mkdir build-binary | ||
| 61 | # Then call it like: | ||
| 62 | LUAROCKS_CROSS_COMPILING=1 lua5.4 binary/all_in_one | ||
| @@ -1,5 +1,10 @@ | |||
| 1 | local lua_versions = { | 1 | local 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, |
