diff --git a/cmake/ConkyPlatformChecks.cmake b/cmake/ConkyPlatformChecks.cmake index 05063286..0511c9db 100644 --- a/cmake/ConkyPlatformChecks.cmake +++ b/cmake/ConkyPlatformChecks.cmake @@ -250,12 +250,28 @@ if(BUILD_X11) endif(X11_FOUND) endif(BUILD_X11) -pkg_search_module(LUA REQUIRED lua5.2 lua-5.2 lua>=5.1 lua5.1 lua-5.1) +# Check whether we want Lua bindings +if(BUILD_LUA_CAIRO OR BUILD_LUA_IMLIB2 OR BUILD_LUA_RSVG) + set(WANT_TOLUA true) +endif(BUILD_LUA_CAIRO OR BUILD_LUA_IMLIB2 OR BUILD_LUA_RSVG) + +# Check for Lua itself +if(WANT_TOLUA) + # If we need tolua++, we must compile against Lua 5.1 + pkg_search_module(LUA REQUIRED lua5.1 lua-5.1 lua51 lua) + if(NOT LUA_VERSION VERSION_LESS 5.2.0) + message(FATAL_ERROR "Unable to find Lua 5.1.x") + endif(NOT LUA_VERSION VERSION_LESS 5.2.0) +else(WANT_TOLUA) + # Otherwise, use the most recent Lua version + pkg_search_module(LUA REQUIRED lua>=5.3 lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua>=5.1) +endif(WANT_TOLUA) set(conky_libs ${conky_libs} ${LUA_LIBRARIES}) set(conky_includes ${conky_includes} ${LUA_INCLUDE_DIRS}) link_directories(${LUA_LIBRARY_DIRS}) + +# Check for libraries used by Lua bindings if(BUILD_LUA_CAIRO) - set(WANT_TOLUA true) pkg_check_modules(CAIRO REQUIRED cairo cairo-xlib) set(luacairo_libs ${CAIRO_LIBRARIES} ${LUA_LIBRARIES}) set(luacairo_includes ${CAIRO_INCLUDE_DIRS} ${LUA_INCLUDE_DIRS}) @@ -265,13 +281,11 @@ if(BUILD_LUA_CAIRO) endif(NOT APP_PATCH) endif(BUILD_LUA_CAIRO) if(BUILD_LUA_IMLIB2) - set(WANT_TOLUA true) - pkg_check_modules(IMLIB2 imlib2) + pkg_search_module(IMLIB2 REQUIRED imlib2 Imlib2) set(luaimlib2_libs ${IMLIB2_LIB} ${LUA_LIBRARIES}) set(luaimlib2_includes ${IMLIB2_INCLUDE_PATH} ${LUA_INCLUDE_DIRS}) endif(BUILD_LUA_IMLIB2) if(BUILD_LUA_RSVG) - set(WANT_TOLUA true) pkg_check_modules(RSVG REQUIRED librsvg-2.0) set(luarsvg_libs ${RSVG_LIBRARIES} ${LUA_LIBRARIES}) set(luarsvg_includes ${RSVG_INCLUDE_DIRS} ${LUA_INCLUDE_DIRS}) diff --git a/doc/docs.xml b/doc/docs.xml index 2ddc3a96..83e9a320 100644 --- a/doc/docs.xml +++ b/doc/docs.xml @@ -192,15 +192,15 @@ Lua API Conky features a Lua Programming API, and also ships with Lua - bindings for some useful libraries. Conky defines certain global - functions and variables which can be accessed from Lua code running - in Conky. + bindings for some useful libraries. Note that the bindings require + tolua++, which currently only compiles against Lua 5.1. To use Lua Conky, you first need to make sure you have a version of Conky - with Lua support enabled (``conky -v'' will report this). Scripts - must first be loaded using the lua_load configuration option. You - then call functions in Lua via Conky's $lua, $lua_read, and Lua - hooks. + with Lua support enabled (``conky -v'' will report this). Conky defines + certain global functions and variables which can be accessed from Lua + code running in Conky. Scripts must first be loaded using the lua_load + configuration option. You then call functions in Lua via Conky's $lua, + $lua_read, and Lua hooks. Be careful when creating threaded objects through the Lua API. You @@ -263,7 +263,7 @@ - ~/.config/conky/rc + ~/.config/conky/conky.conf Default personal configuration file. @@ -308,8 +308,8 @@ the BSD license (see LICENSE.BSD for a copy). All code written since the fork of torsmo is licensed under the GPL (see LICENSE.GPL for a copy), except where noted - differently (such as in portmon and audacious code which are LGPL, and - prss which is an MIT-style license). + differently (such as in portmon and audacious code which are LGPL, and + prss which is an MIT-style license). Authors