From c07ad19ca1b6cf3f0e9e482db0023497135fa668 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Thu, 13 Jun 2013 16:19:03 +0800 Subject: [PATCH] Merging moteus suggestions for rockspec and travis --- .travis.yml | 54 +++++++++++++++++++ ...3.0-1.rockspec => luasocket-scm-0.rockspec | 7 ++- 2 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 .travis.yml rename luasocket-3.0-1.rockspec => luasocket-scm-0.rockspec (96%) diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ee6cfc7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,54 @@ +language: erlang + +env: + global: + - LUAROCKS_BASE=luarocks-2.0.13 + matrix: + - LUA=lua5.1 LUA_DEV=liblua5.1-dev LUA_VER=5.1 LUA_SFX=5.1 LUA_INCDIR=/usr/include/lua5.1 + - LUA=lua5.2 LUA_DEV=liblua5.2-dev LUA_VER=5.2 LUA_SFX=5.2 LUA_INCDIR=/usr/include/lua5.2 + - LUA=luajit LUA_DEV=libluajit-5.1-dev LUA_VER=5.1 LUA_SFX=jit LUA_INCDIR=/usr/include/luajit-2.0 + +branches: + only: + - master + +before_install: + - if [ $LUA = "luajit" ]; then + sudo add-apt-repository ppa:mwild1/ppa -y && sudo apt-get update -y; + fi + - sudo apt-get install $LUA + - sudo apt-get install $LUA_DEV + - lua$LUA_SFX -v + # Install a recent luarocks release + - wget http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz + - tar zxvpf $LUAROCKS_BASE.tar.gz + - cd $LUAROCKS_BASE + - ./configure + --lua-version=$LUA_VER --lua-suffix=$LUA_SFX --with-lua-include="$LUA_INCDIR" + - sudo make + - sudo make install + - cd $TRAVIS_BUILD_DIR + + +install: + - export DEBUG=DEBUG + - sudo -E luarocks make rockspecs/luasocket-scm-0.rockspec + +script: + - cd test + - lua$LUA_SFX hello.lua + - lua$LUA_SFX testsrvr.lua > /dev/null & + - lua$LUA_SFX testclnt.lua + - lua$LUA_SFX stufftest.lua + - lua$LUA_SFX excepttest.lua + - lua$LUA_SFX test_bind.lua + - lua$LUA_SFX test_getaddrinfo.lua + - lua$LUA_SFX ltn12test.lua + - lua$LUA_SFX mimetest.lua + - lua$LUA_SFX urltest.lua + - lua$LUA_SFX test_socket_error.lua + +notifications: + email: + on_success: change + on_failure: always \ No newline at end of file diff --git a/luasocket-3.0-1.rockspec b/luasocket-scm-0.rockspec similarity index 96% rename from luasocket-3.0-1.rockspec rename to luasocket-scm-0.rockspec index c3fa080..64155ee 100644 --- a/luasocket-3.0-1.rockspec +++ b/luasocket-scm-0.rockspec @@ -1,5 +1,5 @@ package = "LuaSocket" -version = "3.0-1" +version = "scm" source = { url = "git://github.com/diegonehab/luasocket.git", branch = "master" @@ -38,7 +38,6 @@ local function make_plat(plat) "LUASOCKET_DEBUG", "NDEBUG", "LUASOCKET_API=__declspec(dllexport)", - "UNIX_API=__declspec(dllexport)", "MIME_API=__declspec(dllexport)" }, mingw32 = { @@ -46,7 +45,6 @@ local function make_plat(plat) "LUASOCKET_INET_PTON", "WINVER=0x0501", "LUASOCKET_API=__declspec(dllexport)", - "UNIX_API=__declspec(dllexport)", "MIME_API=__declspec(dllexport)" } } @@ -86,7 +84,8 @@ local function make_plat(plat) defines = defines[plat], incdir = "/src" } - else + 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