On Monday, October 6, 2014 3:57:34 PM UTC+3, Gordon Madarm wrote:
I am trying to build lua-gumbo for use from within OpenResty. How do I compile lua-gumbo against OpenResty's luajit instance specifically as opposed to the Ubuntu luajit package which is installed on the server as well? Alternatively, is it better to compile lua-gumbo normally and just use the lua_package_path directive to point to the library?
In general you compile Gumbo as a shared library (gumbo.so, gumbo.dylib or.gumbodll) depending on your platform. Then you place the file somewhere in Lua's package.cpath which is configurable with lua_package_cpath nginx directive [1]. Then you need to place lua-gumbo's *.lua file somewhere in Lua's package.path which is configurable with lua_package_path nginx directive [2] (that means gumbo.lua and all the gumbo directory). In openresty the default path is /usr/local/openresty/lualib/. And then just use it.
[1] https://github.com/openresty/lua-nginx-module/#lua_package_cpath
[2] https://github.com/openresty/lua-nginx-module/#lua_package_path