rockspecs: remove visibility and dllexport defines in favor of in-source labeling

This commit is contained in:
E. Westbrook 2019-02-25 16:06:30 -07:00
parent 2d8f0d9901
commit e2e43d62fa
2 changed files with 231 additions and 177 deletions

View File

@ -1,105 +1,132 @@
package = "LuaSocket" package = "LuaSocket"
version = "scm-0" version = "scm-0"
source = { source = {
url = "https://github.com/diegonehab/luasocket/archive/master.zip", url = "git://github.com/diegonehab/luasocket.git"
dir = "luasocket-master", , branch="master"
} }
description = { description = {
summary = "Network support for the Lua language", summary = "Network support for the Lua language",
detailed = [[ detailed = [[
LuaSocket is a Lua extension library that is composed by two parts: a C core 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 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 modules that add support for functionality commonly needed by applications
that deal with the Internet. that deal with the Internet.
]], ]],
homepage = "http://luaforge.net/projects/luasocket/", homepage = "http://luaforge.net/projects/luasocket/",
license = "MIT" license = "MIT"
} }
dependencies = { dependencies = {
"lua >= 5.1" "lua >= 5.1"
} }
local function make_plat(plat) local function make_plat(plat)
local defines = { local defines = {
unix = { unix = {
"LUASOCKET_DEBUG", "LUASOCKET_DEBUG"
"LUASOCKET_API=__attribute__((visibility(\"default\")))", },
"UNIX_API=__attribute__((visibility(\"default\")))", macosx = {
"MIME_API=__attribute__((visibility(\"default\")))" "LUASOCKET_DEBUG",
}, "UNIX_HAS_SUN_LEN"
macosx = { },
"LUASOCKET_DEBUG", win32 = {
"UNIX_HAS_SUN_LEN", "LUASOCKET_DEBUG",
"LUASOCKET_API=__attribute__((visibility(\"default\")))", "NDEBUG"
"UNIX_API=__attribute__((visibility(\"default\")))", },
"MIME_API=__attribute__((visibility(\"default\")))" mingw32 = {
}, "LUASOCKET_DEBUG",
win32 = { "LUASOCKET_INET_PTON",
"LUASOCKET_DEBUG", "WINVER=0x0501"
"NDEBUG", }
"LUASOCKET_API=__declspec(dllexport)", }
"MIME_API=__declspec(dllexport)" local modules = {
}, ["socket.core"] = {
mingw32 = { sources = {
"LUASOCKET_DEBUG", "src/luasocket.c"
"LUASOCKET_INET_PTON", , "src/timeout.c"
"WINVER=0x0501", , "src/buffer.c"
"LUASOCKET_API=__declspec(dllexport)", , "src/io.c"
"MIME_API=__declspec(dllexport)" , "src/auxiliar.c"
} , "src/options.c"
} , "src/inet.c"
local modules = { , "src/except.c"
["socket.core"] = { , "src/select.c"
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" }, , "src/tcp.c"
defines = defines[plat], , "src/udp.c"
incdir = "/src" , "src/compat.c" },
}, defines = defines[plat],
["mime.core"] = { incdir = "/src"
sources = { "src/mime.c", "src/compat.c" }, },
defines = defines[plat], ["mime.core"] = {
incdir = "/src" sources = { "src/mime.c", "src/compat.c" },
}, defines = defines[plat],
["socket.http"] = "src/http.lua", incdir = "/src"
["socket.url"] = "src/url.lua", },
["socket.tp"] = "src/tp.lua", ["socket.http"] = "src/http.lua",
["socket.ftp"] = "src/ftp.lua", ["socket.url"] = "src/url.lua",
["socket.headers"] = "src/headers.lua", ["socket.tp"] = "src/tp.lua",
["socket.smtp"] = "src/smtp.lua", ["socket.ftp"] = "src/ftp.lua",
ltn12 = "src/ltn12.lua", ["socket.headers"] = "src/headers.lua",
socket = "src/socket.lua", ["socket.smtp"] = "src/smtp.lua",
mime = "src/mime.lua" ltn12 = "src/ltn12.lua",
} socket = "src/socket.lua",
if plat == "unix" or plat == "macosx" or plat == "haiku" then mime = "src/mime.lua"
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/usocket.c" }
if plat == "haiku" then if plat == "unix"
modules["socket.core"].libraries = {"network"} or plat == "macosx"
end or plat == "haiku"
modules["socket.unix"] = { then
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" }, modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/usocket.c"
defines = defines[plat], if plat == "haiku" then
incdir = "/src" modules["socket.core"].libraries = {"network"}
} end
modules["socket.serial"] = { modules["socket.unix"] = {
sources = { "src/buffer.c", "src/auxiliar.c", "src/options.c", "src/timeout.c", "src/io.c", "src/usocket.c", "src/serial.c" }, sources = {
defines = defines[plat], "src/buffer.c"
incdir = "/src" , "src/auxiliar.c"
} , "src/options.c"
end , "src/timeout.c"
if plat == "win32" or plat == "mingw32" then , "src/io.c"
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/wsocket.c" , "src/usocket.c"
modules["socket.core"].libraries = { "ws2_32" } , "src/unix.c"
end , "src/unixdgram.c"
return { modules = modules } , "src/unixstream.c" },
defines = defines[plat],
incdir = "/src"
}
modules["socket.serial"] = {
sources = {
"src/buffer.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" }
end
return { modules = modules }
end end
build = { build = {
type = "builtin", type = "builtin",
platforms = { platforms = {
unix = make_plat("unix"), unix = make_plat("unix"),
macosx = make_plat("macosx"), macosx = make_plat("macosx"),
haiku = make_plat("haiku"), haiku = make_plat("haiku"),
win32 = make_plat("win32"), win32 = make_plat("win32"),
mingw32 = make_plat("mingw32") mingw32 = make_plat("mingw32")
}, },
copy_directories = { "doc", "samples", "etc", "test" } copy_directories = {
"doc"
, "samples"
, "etc"
, "test" }
} }

View File

@ -1,105 +1,132 @@
package = "LuaSocket" package = "LuaSocket"
version = "3.0rc2-1" version = "3.0rc2-1"
source = { source = {
url = "git://github.com/diegonehab/luasocket.git", url = "git://github.com/diegonehab/luasocket.git",
tag = "v3.0-rc2", tag = "v3.0-rc2",
} }
description = { description = {
summary = "Network support for the Lua language", summary = "Network support for the Lua language",
detailed = [[ detailed = [[
LuaSocket is a Lua extension library that is composed by two parts: a C core 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 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 modules that add support for functionality commonly needed by applications
that deal with the Internet. that deal with the Internet.
]], ]],
homepage = "http://luaforge.net/projects/luasocket/", homepage = "http://luaforge.net/projects/luasocket/",
license = "MIT" license = "MIT"
} }
dependencies = { dependencies = {
"lua >= 5.1" "lua >= 5.1"
} }
local function make_plat(plat) local function make_plat(plat)
local defines = { local defines = {
unix = { unix = {
"LUASOCKET_DEBUG", "LUASOCKET_DEBUG"
"LUASOCKET_API=__attribute__((visibility(\"default\")))", },
"UNIX_API=__attribute__((visibility(\"default\")))", macosx = {
"MIME_API=__attribute__((visibility(\"default\")))" "LUASOCKET_DEBUG",
}, "UNIX_HAS_SUN_LEN"
macosx = { },
"LUASOCKET_DEBUG", win32 = {
"UNIX_HAS_SUN_LEN", "LUASOCKET_DEBUG",
"LUASOCKET_API=__attribute__((visibility(\"default\")))", "NDEBUG"
"UNIX_API=__attribute__((visibility(\"default\")))", },
"MIME_API=__attribute__((visibility(\"default\")))" mingw32 = {
}, "LUASOCKET_DEBUG",
win32 = { "LUASOCKET_INET_PTON",
"LUASOCKET_DEBUG", "WINVER=0x0501"
"NDEBUG", }
"LUASOCKET_API=__declspec(dllexport)", }
"MIME_API=__declspec(dllexport)" local modules = {
}, ["socket.core"] = {
mingw32 = { sources = {
"LUASOCKET_DEBUG", "src/luasocket.c"
"LUASOCKET_INET_PTON", , "src/timeout.c"
"WINVER=0x0501", , "src/buffer.c"
"LUASOCKET_API=__declspec(dllexport)", , "src/io.c"
"MIME_API=__declspec(dllexport)" , "src/auxiliar.c"
} , "src/options.c"
} , "src/inet.c"
local modules = { , "src/except.c"
["socket.core"] = { , "src/select.c"
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" }, , "src/tcp.c"
defines = defines[plat], , "src/udp.c"
incdir = "/src" , "src/compat.c" },
}, defines = defines[plat],
["mime.core"] = { incdir = "/src"
sources = { "src/mime.c", "src/compat.c" }, },
defines = defines[plat], ["mime.core"] = {
incdir = "/src" sources = { "src/mime.c", "src/compat.c" },
}, defines = defines[plat],
["socket.http"] = "src/http.lua", incdir = "/src"
["socket.url"] = "src/url.lua", },
["socket.tp"] = "src/tp.lua", ["socket.http"] = "src/http.lua",
["socket.ftp"] = "src/ftp.lua", ["socket.url"] = "src/url.lua",
["socket.headers"] = "src/headers.lua", ["socket.tp"] = "src/tp.lua",
["socket.smtp"] = "src/smtp.lua", ["socket.ftp"] = "src/ftp.lua",
ltn12 = "src/ltn12.lua", ["socket.headers"] = "src/headers.lua",
socket = "src/socket.lua", ["socket.smtp"] = "src/smtp.lua",
mime = "src/mime.lua" ltn12 = "src/ltn12.lua",
} socket = "src/socket.lua",
if plat == "unix" or plat == "macosx" or plat == "haiku" then mime = "src/mime.lua"
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/usocket.c" }
if plat == "haiku" then if plat == "unix"
modules["socket.core"].libraries = {"network"} or plat == "macosx"
end or plat == "haiku"
modules["socket.unix"] = { then
sources = { "src/buffer.c", "src/auxiliar.c", "src/options.c", "src/timeout.c", "src/io.c", "src/usocket.c", "src/unix.c" }, modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/usocket.c"
defines = defines[plat], if plat == "haiku" then
incdir = "/src" modules["socket.core"].libraries = {"network"}
} end
modules["socket.serial"] = { modules["socket.unix"] = {
sources = { "src/buffer.c", "src/auxiliar.c", "src/options.c", "src/timeout.c", "src/io.c", "src/usocket.c", "src/serial.c" }, sources = {
defines = defines[plat], "src/buffer.c"
incdir = "/src" , "src/auxiliar.c"
} , "src/options.c"
end , "src/timeout.c"
if plat == "win32" or plat == "mingw32" then , "src/io.c"
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/wsocket.c" , "src/usocket.c"
modules["socket.core"].libraries = { "ws2_32" } , "src/unix.c"
end , "src/unixdgram.c"
return { modules = modules } , "src/unixstream.c" },
defines = defines[plat],
incdir = "/src"
}
modules["socket.serial"] = {
sources = {
"src/buffer.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" }
end
return { modules = modules }
end end
build = { build = {
type = "builtin", type = "builtin",
platforms = { platforms = {
unix = make_plat("unix"), unix = make_plat("unix"),
macosx = make_plat("macosx"), macosx = make_plat("macosx"),
haiku = make_plat("haiku"), haiku = make_plat("haiku"),
win32 = make_plat("win32"), win32 = make_plat("win32"),
mingw32 = make_plat("mingw32") mingw32 = make_plat("mingw32")
}, },
copy_directories = { "doc", "samples", "etc", "test" } copy_directories = {
"doc"
, "samples"
, "etc"
, "test" }
} }