diff options
-rw-r--r-- | .travis.yml | 3 | ||||
-rw-r--r-- | .travis/setup_lua.sh | 11 | ||||
-rw-r--r-- | rockspecs/luafilesystem-cvs-3.rockspec | 27 | ||||
-rw-r--r-- | src/lfs.c | 8 |
4 files changed, 47 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml index a2a79b3..67b5812 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -6,6 +6,7 @@ env: | |||
6 | matrix: | 6 | matrix: |
7 | - LUA=lua5.1 | 7 | - LUA=lua5.1 |
8 | - LUA=lua5.2 | 8 | - LUA=lua5.2 |
9 | - LUA=lua5.3 | ||
9 | - LUA=luajit | 10 | - LUA=luajit |
10 | 11 | ||
11 | branches: | 12 | branches: |
@@ -17,7 +18,7 @@ before_install: | |||
17 | - sudo pip install cpp-coveralls | 18 | - sudo pip install cpp-coveralls |
18 | 19 | ||
19 | install: | 20 | install: |
20 | - sudo luarocks make rockspecs/luafilesystem-cvs-2.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage" | 21 | - sudo luarocks make rockspecs/luafilesystem-cvs-3.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage" |
21 | 22 | ||
22 | script: | 23 | script: |
23 | - cd tests | 24 | - cd tests |
diff --git a/.travis/setup_lua.sh b/.travis/setup_lua.sh index 1ead166..373e24d 100644 --- a/.travis/setup_lua.sh +++ b/.travis/setup_lua.sh | |||
@@ -56,15 +56,22 @@ else | |||
56 | elif [ "$LUA" == "lua5.2" ]; then | 56 | elif [ "$LUA" == "lua5.2" ]; then |
57 | curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz | 57 | curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz |
58 | cd lua-5.2.3; | 58 | cd lua-5.2.3; |
59 | elif [ "$LUA" == "lua5.3" ]; then | ||
60 | curl http://www.lua.org/work/lua-5.3.0-beta.tar.gz | tar xz | ||
61 | cd lua-5.3.0-beta; | ||
59 | fi | 62 | fi |
60 | sudo make $PLATFORM install; | 63 | sudo make $PLATFORM install; |
61 | fi | 64 | fi |
62 | 65 | ||
63 | cd $TRAVIS_BUILD_DIR | 66 | cd $TRAVIS_BUILD_DIR; |
64 | 67 | ||
65 | LUAROCKS_BASE=luarocks-$LUAROCKS | 68 | LUAROCKS_BASE=luarocks-$LUAROCKS |
69 | |||
70 | # curl http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | tar xz | ||
71 | |||
66 | git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_BASE | 72 | git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_BASE |
67 | cd $LUAROCKS_BASE | 73 | cd $LUAROCKS_BASE |
74 | |||
68 | git checkout v$LUAROCKS | 75 | git checkout v$LUAROCKS |
69 | 76 | ||
70 | if [ "$LUA" == "luajit" ]; then | 77 | if [ "$LUA" == "luajit" ]; then |
@@ -89,4 +96,6 @@ elif [ "$LUA" == "lua5.1" ]; then | |||
89 | rm -rf lua-5.1.5; | 96 | rm -rf lua-5.1.5; |
90 | elif [ "$LUA" == "lua5.2" ]; then | 97 | elif [ "$LUA" == "lua5.2" ]; then |
91 | rm -rf lua-5.2.3; | 98 | rm -rf lua-5.2.3; |
99 | elif [ "$LUA" == "lua5.3" ]; then | ||
100 | rm -rf lua-5.3.0-beta; | ||
92 | fi | 101 | fi |
diff --git a/rockspecs/luafilesystem-cvs-3.rockspec b/rockspecs/luafilesystem-cvs-3.rockspec new file mode 100644 index 0000000..a4388cd --- /dev/null +++ b/rockspecs/luafilesystem-cvs-3.rockspec | |||
@@ -0,0 +1,27 @@ | |||
1 | package = "LuaFileSystem" | ||
2 | |||
3 | version = "cvs-3" | ||
4 | |||
5 | source = { | ||
6 | url = "git://github.com/keplerproject/luafilesystem.git", | ||
7 | } | ||
8 | |||
9 | description = { | ||
10 | summary = "File System Library for the Lua Programming Language", | ||
11 | detailed = [[ | ||
12 | LuaFileSystem is a Lua library developed to complement the set of | ||
13 | functions related to file systems offered by the standard Lua | ||
14 | distribution. LuaFileSystem offers a portable way to access the | ||
15 | underlying directory structure and file attributes. | ||
16 | ]] | ||
17 | } | ||
18 | |||
19 | dependencies = { | ||
20 | "lua >= 5.1, < 5.4" | ||
21 | } | ||
22 | |||
23 | build = { | ||
24 | type = "builtin", | ||
25 | modules = { lfs = "src/lfs.c" }, | ||
26 | copy_directories = { "doc", "tests" } | ||
27 | } | ||
@@ -65,6 +65,14 @@ | |||
65 | #define LFS_VERSION "1.6.2" | 65 | #define LFS_VERSION "1.6.2" |
66 | #define LFS_LIBNAME "lfs" | 66 | #define LFS_LIBNAME "lfs" |
67 | 67 | ||
68 | #if LUA_VERSION_NUM >= 503 /* Lua 5.3 */ | ||
69 | |||
70 | #ifndef luaL_optlong | ||
71 | #define luaL_optlong luaL_optinteger | ||
72 | #endif | ||
73 | |||
74 | #endif | ||
75 | |||
68 | #if LUA_VERSION_NUM < 502 | 76 | #if LUA_VERSION_NUM < 502 |
69 | # define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l)) | 77 | # define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l)) |
70 | #endif | 78 | #endif |