From cce138c8e50f6fa5d585f8e0d9d0a3bdc05f7a5f Mon Sep 17 00:00:00 2001 From: Fabio Mascarenhas Date: Tue, 11 Jun 2013 17:23:50 -0300 Subject: [PATCH] new rockspec using builtin build type --- luasocket-3.0-1.rockspec | 105 +++++++++++++++++++++++++++++++++++++++ luasocket-3.0.rockspec | 67 ------------------------- 2 files changed, 105 insertions(+), 67 deletions(-) create mode 100644 luasocket-3.0-1.rockspec delete mode 100644 luasocket-3.0.rockspec diff --git a/luasocket-3.0-1.rockspec b/luasocket-3.0-1.rockspec new file mode 100644 index 0000000..c3fa080 --- /dev/null +++ b/luasocket-3.0-1.rockspec @@ -0,0 +1,105 @@ +package = "LuaSocket" +version = "3.0-1" +source = { + url = "git://github.com/diegonehab/luasocket.git", + branch = "master" +} +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)", + "UNIX_API=__declspec(dllexport)", + "MIME_API=__declspec(dllexport)" + }, + mingw32 = { + "LUASOCKET_DEBUG", + "LUASOCKET_INET_PTON", + "WINVER=0x0501", + "LUASOCKET_API=__declspec(dllexport)", + "UNIX_API=__declspec(dllexport)", + "MIME_API=__declspec(dllexport)" + } + } + 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" }, + defines = defines[plat], + incdir = "/src" + }, + ["mime.core"] = { + sources = { "src/mime.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" then + modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/usocket.c" + modules["socket.unix"] = { + sources = { "src/buffer.c", "src/auxiliar.c", "src/options.c", "src/timeout.c", "src/io.c", + "src/usocket.c", "src/unix.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" + } + else + 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"), + win32 = make_plat("win32"), + mingw32 = make_plat("mingw32") + }, + copy_directories = { "doc", "samples", "etc", "test" } +} diff --git a/luasocket-3.0.rockspec b/luasocket-3.0.rockspec deleted file mode 100644 index 9c59abe..0000000 --- a/luasocket-3.0.rockspec +++ /dev/null @@ -1,67 +0,0 @@ -package = "LuaSocket" -version = "2.1-1" -source = { - url = "git://github.com/diegonehab/luasocket.git", - branch = "unstable" -} -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" -} -build = { - type = "make", - build_variables = { - PLAT="linux", - LUAINC_linux="$(LUA_INCDIR)" - }, - install_variables = { - INSTALL_TOP_SHARE = "$(LUADIR)", - INSTALL_TOP_LIB = "$(LIBDIR)" - }, - platforms = { - macosx = { - build_variables = { - PLAT="macosx", - LUAINC_macosx="$(LUA_INCDIR)" - } - }, - windows={ - type= "command", - build_command= - "set INCLUDE=$(LUA_INCDIR);%INCLUDE% &".. - "set LIB=$(LUA_LIBDIR);%LIB% &".. - "msbuild /p:\"VCBuildAdditionalOptions= /useenv\" luasocket.sln &".. - "mkdir mime & mkdir socket &".. - "cp src/mime.dll mime/core.dll &".. - "cp src/socket.dll socket/core.dll", - install= { - lib = { - ["mime.core"] = "mime/core.dll", - ["socket.core"] = "socket/core.dll" - }, - lua = { - "src/ltn12.lua", - "src/mime.lua", - "src/socket.lua", - ["socket.headers"] = "src/headers.lua", - ["socket.ftp"] = "src/ftp.lua", - ["socket.http"] = "src/http.lua", - ["socket.smtp"] = "src/smtp.lua", - ["socket.tp"] = "src/tp.lua", - ["socket.url"] = "src/url.lua", - } - } - } - }, - copy_directories = { "doc", "samples", "etc", "test" } -}