mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-23 19:43:06 +00:00
Fix. Support Lua 5.3.beta
This commit is contained in:
@@ -6,6 +6,7 @@ env:
|
||||
matrix:
|
||||
- LUA=lua5.1
|
||||
- LUA=lua5.2
|
||||
- LUA=lua5.3
|
||||
- LUA=luajit
|
||||
|
||||
branches:
|
||||
@@ -17,7 +18,7 @@ before_install:
|
||||
- sudo pip install cpp-coveralls
|
||||
|
||||
install:
|
||||
- sudo luarocks make rockspecs/luafilesystem-cvs-2.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"
|
||||
- sudo luarocks make rockspecs/luafilesystem-cvs-3.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"
|
||||
|
||||
script:
|
||||
- cd tests
|
||||
|
||||
@@ -56,15 +56,22 @@ else
|
||||
elif [ "$LUA" == "lua5.2" ]; then
|
||||
curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz
|
||||
cd lua-5.2.3;
|
||||
elif [ "$LUA" == "lua5.3" ]; then
|
||||
curl http://www.lua.org/work/lua-5.3.0-beta.tar.gz | tar xz
|
||||
cd lua-5.3.0-beta;
|
||||
fi
|
||||
sudo make $PLATFORM install;
|
||||
fi
|
||||
|
||||
cd $TRAVIS_BUILD_DIR
|
||||
cd $TRAVIS_BUILD_DIR;
|
||||
|
||||
LUAROCKS_BASE=luarocks-$LUAROCKS
|
||||
|
||||
# curl http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | tar xz
|
||||
|
||||
git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_BASE
|
||||
cd $LUAROCKS_BASE
|
||||
|
||||
git checkout v$LUAROCKS
|
||||
|
||||
if [ "$LUA" == "luajit" ]; then
|
||||
@@ -89,4 +96,6 @@ elif [ "$LUA" == "lua5.1" ]; then
|
||||
rm -rf lua-5.1.5;
|
||||
elif [ "$LUA" == "lua5.2" ]; then
|
||||
rm -rf lua-5.2.3;
|
||||
elif [ "$LUA" == "lua5.3" ]; then
|
||||
rm -rf lua-5.3.0-beta;
|
||||
fi
|
||||
|
||||
27
rockspecs/luafilesystem-cvs-3.rockspec
Normal file
27
rockspecs/luafilesystem-cvs-3.rockspec
Normal file
@@ -0,0 +1,27 @@
|
||||
package = "LuaFileSystem"
|
||||
|
||||
version = "cvs-3"
|
||||
|
||||
source = {
|
||||
url = "git://github.com/keplerproject/luafilesystem.git",
|
||||
}
|
||||
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
LuaFileSystem is a Lua library developed to complement the set of
|
||||
functions related to file systems offered by the standard Lua
|
||||
distribution. LuaFileSystem offers a portable way to access the
|
||||
underlying directory structure and file attributes.
|
||||
]]
|
||||
}
|
||||
|
||||
dependencies = {
|
||||
"lua >= 5.1, < 5.4"
|
||||
}
|
||||
|
||||
build = {
|
||||
type = "builtin",
|
||||
modules = { lfs = "src/lfs.c" },
|
||||
copy_directories = { "doc", "tests" }
|
||||
}
|
||||
@@ -65,6 +65,14 @@
|
||||
#define LFS_VERSION "1.6.2"
|
||||
#define LFS_LIBNAME "lfs"
|
||||
|
||||
#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */
|
||||
|
||||
#ifndef luaL_optlong
|
||||
#define luaL_optlong luaL_optinteger
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if LUA_VERSION_NUM < 502
|
||||
# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user