mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 04:17:33 +00:00
Merge pull request #184 from marcpayne/lua-bindings
Require Lua 5.1 when building the Lua bindings
This commit is contained in:
commit
49babf1181
@ -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})
|
||||
|
20
doc/docs.xml
20
doc/docs.xml
@ -192,15 +192,15 @@
|
||||
<refsect1>
|
||||
<title>Lua API</title>
|
||||
<para>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.
|
||||
</para>
|
||||
<para>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.
|
||||
</para>
|
||||
<para>
|
||||
Be careful when creating threaded objects through the Lua API. You
|
||||
@ -263,7 +263,7 @@
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>~/.config/conky/rc</filename>
|
||||
<filename>~/.config/conky/conky.conf</filename>
|
||||
</term>
|
||||
<listitem>Default personal configuration
|
||||
file.</listitem>
|
||||
@ -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).</para>
|
||||
differently (such as in portmon and audacious code which are LGPL, and
|
||||
prss which is an MIT-style license).</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Authors</title>
|
||||
|
Loading…
Reference in New Issue
Block a user