2013-06-11 22:23:50 +02:00
|
|
|
package = "LuaSocket"
|
2013-06-13 11:13:14 +02:00
|
|
|
version = "scm-0"
|
2013-06-11 22:23:50 +02:00
|
|
|
source = {
|
2013-06-13 11:35:52 +02:00
|
|
|
url = "https://github.com/diegonehab/luasocket/archive/master.zip",
|
|
|
|
dir = "luasocket-master",
|
2013-06-11 22:23:50 +02:00
|
|
|
}
|
|
|
|
description = {
|
|
|
|
summary = "Network support for the Lua language",
|
|
|
|
detailed = [[
|
|
|
|
LuaSocket is a Lua extension library that is composed by two parts: a C core
|
|
|
|
that provides support for the TCP and UDP transport layers, and a set of Lua
|
|
|
|
modules that add support for functionality commonly needed by applications
|
|
|
|
that deal with the Internet.
|
|
|
|
]],
|
|
|
|
homepage = "http://luaforge.net/projects/luasocket/",
|
|
|
|
license = "MIT"
|
|
|
|
}
|
|
|
|
dependencies = {
|
|
|
|
"lua >= 5.1"
|
|
|
|
}
|
|
|
|
|
|
|
|
local function make_plat(plat)
|
|
|
|
local defines = {
|
|
|
|
unix = {
|
|
|
|
"LUASOCKET_DEBUG",
|
|
|
|
"LUASOCKET_API=__attribute__((visibility(\"default\")))",
|
|
|
|
"UNIX_API=__attribute__((visibility(\"default\")))",
|
|
|
|
"MIME_API=__attribute__((visibility(\"default\")))"
|
|
|
|
},
|
|
|
|
macosx = {
|
|
|
|
"LUASOCKET_DEBUG",
|
|
|
|
"UNIX_HAS_SUN_LEN",
|
|
|
|
"LUASOCKET_API=__attribute__((visibility(\"default\")))",
|
|
|
|
"UNIX_API=__attribute__((visibility(\"default\")))",
|
|
|
|
"MIME_API=__attribute__((visibility(\"default\")))"
|
|
|
|
},
|
|
|
|
win32 = {
|
|
|
|
"LUASOCKET_DEBUG",
|
|
|
|
"NDEBUG",
|
|
|
|
"LUASOCKET_API=__declspec(dllexport)",
|
|
|
|
"MIME_API=__declspec(dllexport)"
|
|
|
|
},
|
|
|
|
mingw32 = {
|
|
|
|
"LUASOCKET_DEBUG",
|
|
|
|
"LUASOCKET_INET_PTON",
|
|
|
|
"WINVER=0x0501",
|
|
|
|
"LUASOCKET_API=__declspec(dllexport)",
|
|
|
|
"MIME_API=__declspec(dllexport)"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
local modules = {
|
|
|
|
["socket.core"] = {
|
2015-08-22 03:31:29 +02:00
|
|
|
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" },
|
2013-06-11 22:23:50 +02:00
|
|
|
defines = defines[plat],
|
|
|
|
incdir = "/src"
|
|
|
|
},
|
2015-08-22 03:31:29 +02:00
|
|
|
["mime.core"] = {
|
|
|
|
sources = { "src/mime.c", "src/compat.c" },
|
2013-06-11 22:23:50 +02:00
|
|
|
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"
|
|
|
|
}
|
2016-03-11 20:03:22 +01:00
|
|
|
if plat == "unix" or plat == "macosx" or plat == "haiku" then
|
2013-06-11 22:23:50 +02:00
|
|
|
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/usocket.c"
|
2016-03-11 20:03:22 +01:00
|
|
|
if plat == "haiku" then
|
|
|
|
modules["socket.core"].libraries = {"network"}
|
|
|
|
end
|
2013-06-11 22:23:50 +02:00
|
|
|
modules["socket.unix"] = {
|
2019-01-11 09:04:34 +01:00
|
|
|
sources = { "src/buffer.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" },
|
2013-06-11 22:23:50 +02:00
|
|
|
defines = defines[plat],
|
|
|
|
incdir = "/src"
|
|
|
|
}
|
|
|
|
modules["socket.serial"] = {
|
2015-08-22 03:31:29 +02:00
|
|
|
sources = { "src/buffer.c", "src/auxiliar.c", "src/options.c", "src/timeout.c", "src/io.c", "src/usocket.c", "src/serial.c" },
|
2013-06-11 22:23:50 +02:00
|
|
|
defines = defines[plat],
|
|
|
|
incdir = "/src"
|
|
|
|
}
|
2013-06-13 10:19:03 +02:00
|
|
|
end
|
|
|
|
if plat == "win32" or plat == "mingw32" then
|
2013-06-11 22:23:50 +02:00
|
|
|
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/wsocket.c"
|
|
|
|
modules["socket.core"].libraries = { "ws2_32" }
|
|
|
|
end
|
|
|
|
return { modules = modules }
|
|
|
|
end
|
|
|
|
|
|
|
|
build = {
|
|
|
|
type = "builtin",
|
|
|
|
platforms = {
|
|
|
|
unix = make_plat("unix"),
|
|
|
|
macosx = make_plat("macosx"),
|
2016-03-11 20:03:22 +01:00
|
|
|
haiku = make_plat("haiku"),
|
2013-06-11 22:23:50 +02:00
|
|
|
win32 = make_plat("win32"),
|
|
|
|
mingw32 = make_plat("mingw32")
|
|
|
|
},
|
|
|
|
copy_directories = { "doc", "samples", "etc", "test" }
|
|
|
|
}
|