From b5a1b7de2ab8a0d3eb2c517af1de6f73e48fbe23 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 8 Dec 2022 17:08:14 -0300 Subject: Windows binary build tweaks --- binary/all_in_one | 2 +- binary/luasocket-3.1.0-1.rockspec | 136 ++++++++++++++++++++++++++++++++++++++ makedist | 2 +- 3 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 binary/luasocket-3.1.0-1.rockspec diff --git a/binary/all_in_one b/binary/all_in_one index 9db25bf8..eace5290 100755 --- a/binary/all_in_one +++ b/binary/all_in_one @@ -470,7 +470,7 @@ local function main() ["lua-zlib"] = "./binary/lua-zlib-1.2-0.rockspec", ["lua-bz2"] = "./binary/lua-bz2-0.2.1-1.rockspec", luaposix = if_platform("unix", "./binary/luaposix-35.1-1.rockspec"), - luasocket = "luasocket", + luasocket = "./binary/luasocket-3.1.0-1.rockspec", luafilesystem = "luafilesystem", dkjson = "dkjson", } diff --git a/binary/luasocket-3.1.0-1.rockspec b/binary/luasocket-3.1.0-1.rockspec new file mode 100644 index 00000000..f33080b0 --- /dev/null +++ b/binary/luasocket-3.1.0-1.rockspec @@ -0,0 +1,136 @@ +package = "LuaSocket" +version = "3.1.0-1" +source = { + url = "git+https://github.com/lunarmodules/luasocket.git", + tag = "v3.1.0" +} +description = { + summary = "Network support for the Lua language", + detailed = [[ + LuaSocket is a Lua extension library composed of two parts: a set of C + modules that provide support for the TCP and UDP transport layers, and a + set of Lua modules that provide functions commonly needed by applications + that deal with the Internet. + ]], + homepage = "https://github.com/lunarmodules/luasocket", + license = "MIT" +} +dependencies = { + "lua >= 5.1" +} + +local function make_plat(plat) + local defines = { + unix = { + "LUASOCKET_DEBUG" + }, + macosx = { + "LUASOCKET_DEBUG", + "UNIX_HAS_SUN_LEN" + }, + win32 = { + "LUASOCKET_DEBUG", + "NDEBUG" + }, + mingw32 = { + "LUASOCKET_DEBUG", + "LUASOCKET_INET_PTON", + "WINVER=0x0501", + }, + } + local modules = { + ["socket.core"] = { + sources = { + "src/luasocket.c" + , "src/timeout.c" + , "src/buffer.c" + , "src/io.c" + , "src/auxiliar.c" + , "src/options.c" + , "src/inet.c" + , "src/except.c" + , "src/select.c" + , "src/tcp.c" + , "src/udp.c" + , "src/compat.c" }, + defines = defines[plat], + incdir = "/src" + }, + ["mime.core"] = { + sources = { "src/mime.c", "src/compat.c" }, + defines = defines[plat], + incdir = "/src" + }, + ["socket.http"] = "src/http.lua", + ["socket.url"] = "src/url.lua", + ["socket.tp"] = "src/tp.lua", + ["socket.ftp"] = "src/ftp.lua", + ["socket.headers"] = "src/headers.lua", + ["socket.smtp"] = "src/smtp.lua", + ltn12 = "src/ltn12.lua", + socket = "src/socket.lua", + mime = "src/mime.lua" + } + if plat == "unix" + or plat == "macosx" + or plat == "haiku" + then + modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/usocket.c" + if plat == "haiku" then + modules["socket.core"].libraries = {"network"} + end + modules["socket.unix"] = { + sources = { + "src/buffer.c" + , "src/compat.c" + , "src/auxiliar.c" + , "src/options.c" + , "src/timeout.c" + , "src/io.c" + , "src/usocket.c" + , "src/unix.c" + , "src/unixdgram.c" + , "src/unixstream.c" }, + defines = defines[plat], + incdir = "/src" + } + modules["socket.serial"] = { + sources = { + "src/buffer.c" + , "src/compat.c" + , "src/auxiliar.c" + , "src/options.c" + , "src/timeout.c" + , "src/io.c" + , "src/usocket.c" + , "src/serial.c" }, + defines = defines[plat], + incdir = "/src" + } + end + if plat == "win32" + or plat == "mingw32" + then + modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/wsocket.c" + modules["socket.core"].libraries = { "ws2_32" } + modules["socket.core"].libdirs = {} + end + return { modules = modules } +end + +build = { + type = "builtin", + platforms = { + unix = make_plat("unix"), + macosx = make_plat("macosx"), + haiku = make_plat("haiku"), + win32 = make_plat("win32"), + mingw32 = make_plat("mingw32"), + mingw64 = make_plat("mingw64") + }, + copy_directories = { + "docs" + , "samples" + , "etc" + , "test" } +} diff --git a/makedist b/makedist index 0cc247d3..0ba46034 100755 --- a/makedist +++ b/makedist @@ -150,7 +150,7 @@ if [ "$1" = "binary" ] then shift - ./configure --lua-version=5.4 + ./configure --lua-version=5.4 --with-lua=${LUA_DIR:-/usr} make binary cd build-binary -- cgit v1.2.3-55-g6feb