diff --git a/camera-1.0-0.rockspec b/camera-1.0-0.rockspec deleted file mode 100644 index 18174aa..0000000 --- a/camera-1.0-0.rockspec +++ /dev/null @@ -1,34 +0,0 @@ -package = "camera" -version = "1.0-0" - -source = { - url = "git://github.com/clementfarabet/lua---camera", - tag = "1.0-0" -} - -description = { - summary = "A simple wrapper package to give torch access to a webcam", - detailed = [[ -Uses OpenCV on MacOS and video4linux2 on Linux to proved the low level access to the camera hardware. - ]], - homepage = "https://github.com/clementfarabet/lua---camera", - license = "BSD" -} - -dependencies = { - "torch >= 7.0", - "xlua >= 1.0", - "sys >= 1.0", - "image >= 1.0.1" -} - -build = { - type = "command", - build_command = [[ -cmake -E make_directory build; -cd build; -cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(LUA_BINDIR)/.." -DCMAKE_INSTALL_PREFIX="$(PREFIX)"; -$(MAKE) - ]], - install_command = "cd build && $(MAKE) install" -} diff --git a/opencv/opencv.c b/opencv/opencv.c index c15d3b4..b82bc63 100644 --- a/opencv/opencv.c +++ b/opencv/opencv.c @@ -12,6 +12,9 @@ #include #include +#include "lauxlib.h" +#include "lualib.h" + #include #include #include @@ -132,7 +135,7 @@ static int l_releaseCam (lua_State *L) { } // Register functions -static const struct luaL_reg opencv [] = { +static const struct luaL_Reg opencv [] = { // replace luaL_reg with luaL_Reg {"initCam", l_initCam}, {"grabFrame", l_grabFrame}, {"releaseCam", l_releaseCam}, @@ -140,6 +143,7 @@ static const struct luaL_reg opencv [] = { }; int luaopen_libcamopencv (lua_State *L) { - luaL_openlib(L, "libcamopencv", opencv, 0); + // luaL_openlib(L, "libcamopencv", opencv, 0); + luaL_newlib(L, opencv); // luaL_openlib is deprecated; use luaL_newlib to register libraries return 1; }