1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 04:32:55 +00:00

Make lua required by cmake

This commit is contained in:
Nikolas Garofil 2010-11-14 01:41:07 +01:00
parent 4ac40e6054
commit b5ff3eb411
6 changed files with 24 additions and 64 deletions

View File

@ -115,11 +115,8 @@ else(BUILD_X11)
set(BUILD_IMLIB2 false CACHE BOOL "Enable Imlib2 support" FORCE) set(BUILD_IMLIB2 false CACHE BOOL "Enable Imlib2 support" FORCE)
endif(BUILD_X11) endif(BUILD_X11)
option(BUILD_LUA "Build Lua support" true)
if(BUILD_LUA)
option(BUILD_LUA_CAIRO "Build cairo bindings for Lua" false) option(BUILD_LUA_CAIRO "Build cairo bindings for Lua" false)
option(BUILD_LUA_IMLIB2 "Build Imlib2 bindings for Lua" false) option(BUILD_LUA_IMLIB2 "Build Imlib2 bindings for Lua" false)
endif(BUILD_LUA)
option(BUILD_AUDACIOUS "Build audacious (music player) support" false) option(BUILD_AUDACIOUS "Build audacious (music player) support" false)

View File

@ -205,7 +205,6 @@ if(BUILD_X11)
endif(X11_FOUND) endif(X11_FOUND)
endif(BUILD_X11) endif(BUILD_X11)
if(BUILD_LUA)
pkg_search_module(LUA REQUIRED lua>=5.1 lua-5.1>=5.1 lua5.1>=5.1) pkg_search_module(LUA REQUIRED lua>=5.1 lua-5.1>=5.1 lua5.1>=5.1)
set(conky_libs ${conky_libs} ${LUA_LIBRARIES}) set(conky_libs ${conky_libs} ${LUA_LIBRARIES})
set(conky_includes ${conky_includes} ${LUA_INCLUDE_DIRS}) set(conky_includes ${conky_includes} ${LUA_INCLUDE_DIRS})
@ -225,7 +224,6 @@ if(BUILD_LUA)
set(luaimlib2_libs ${IMLIB2_LIB} ${LUA_LIBRARIES}) set(luaimlib2_libs ${IMLIB2_LIB} ${LUA_LIBRARIES})
set(luaimlib2_includes ${IMLIB2_INCLUDE_PATH} ${LUA_INCLUDE_DIRS}) set(luaimlib2_includes ${IMLIB2_INCLUDE_PATH} ${LUA_INCLUDE_DIRS})
endif(BUILD_LUA_IMLIB2) endif(BUILD_LUA_IMLIB2)
endif(BUILD_LUA)
if(BUILD_AUDACIOUS) if(BUILD_AUDACIOUS)
set(WANT_GLIB true) set(WANT_GLIB true)

View File

@ -45,8 +45,6 @@
#cmakedefine BUILD_XDBE 1 #cmakedefine BUILD_XDBE 1
#cmakedefine BUILD_LUA 1
#cmakedefine BUILD_PORT_MONITORS 1 #cmakedefine BUILD_PORT_MONITORS 1
#cmakedefine BUILD_AUDACIOUS 1 #cmakedefine BUILD_AUDACIOUS 1

View File

@ -38,7 +38,7 @@ set(conky_sources colours.cc combine.cc common.cc conky.cc core.cc
diskio.cc entropy.cc exec.cc fs.cc mail.cc mixer.cc net_stat.cc template.cc diskio.cc entropy.cc exec.cc fs.cc mail.cc mixer.cc net_stat.cc template.cc
mboxscan.cc read_tcpip.cc scroll.cc specials.cc tailhead.cc mboxscan.cc read_tcpip.cc scroll.cc specials.cc tailhead.cc
temphelper.cc text_object.cc timeinfo.cc top.cc algebra.cc prioqueue.cc proc.cc temphelper.cc text_object.cc timeinfo.cc top.cc algebra.cc prioqueue.cc proc.cc
user.cc luamm.cc data-source.cc lua-config.cc setting.cc) user.cc luamm.cc data-source.cc lua-config.cc setting.cc llua.cc)
# add timed thread library # add timed thread library
add_library(timed-thread timed-thread.cc) add_library(timed-thread timed-thread.cc)
@ -145,11 +145,6 @@ if(BUILD_WEATHER)
set(optional_sources ${optional_sources} ${weather}) set(optional_sources ${optional_sources} ${weather})
endif(BUILD_WEATHER) endif(BUILD_WEATHER)
if(BUILD_LUA)
set(lua llua.cc)
set(optional_sources ${optional_sources} ${lua})
endif(BUILD_LUA)
if(BUILD_NVIDIA) if(BUILD_NVIDIA)
set(nvidia nvidia.cc) set(nvidia nvidia.cc)
set(optional_sources ${optional_sources} ${nvidia}) set(optional_sources ${optional_sources} ${nvidia})

View File

@ -87,9 +87,7 @@
#ifdef BUILD_ICONV #ifdef BUILD_ICONV
#include "iconv_tools.h" #include "iconv_tools.h"
#endif #endif
#ifdef BUILD_LUA
#include "llua.h" #include "llua.h"
#endif /* BUILD_LUA */
#include "logging.h" #include "logging.h"
#include "mail.h" #include "mail.h"
#include "nc.h" #include "nc.h"
@ -325,7 +323,6 @@ static void print_version(void)
#ifdef BUILD_NCURSES #ifdef BUILD_NCURSES
<< " * ncurses\n" << " * ncurses\n"
#endif /* BUILD_NCURSES */ #endif /* BUILD_NCURSES */
#ifdef BUILD_LUA
<< " * Lua\n" << " * Lua\n"
<< _("\n Lua bindings:\n") << _("\n Lua bindings:\n")
#ifdef BUILD_LUA_CAIRO #ifdef BUILD_LUA_CAIRO
@ -334,7 +331,6 @@ static void print_version(void)
#ifdef BUILD_LUA_IMLIB2 #ifdef BUILD_LUA_IMLIB2
<< " * Imlib2\n" << " * Imlib2\n"
#endif /* BUILD_LUA_IMLIB2 */ #endif /* BUILD_LUA_IMLIB2 */
#endif /* BUILD_LUA */
#ifdef BUILD_I18N #ifdef BUILD_I18N
<< " * Internationalization support\n" << " * Internationalization support\n"
#endif #endif
@ -1088,10 +1084,8 @@ static void update_text_area(void)
text_start_x = x; text_start_x = x;
text_start_y = y; text_start_y = y;
} }
#ifdef BUILD_LUA
/* update lua window globals */ /* update lua window globals */
llua_update_window_table(text_start_x, text_start_y, text_width, text_height); llua_update_window_table(text_start_x, text_start_y, text_width, text_height);
#endif /* BUILD_LUA */
} }
/* drawing stuff */ /* drawing stuff */
@ -1850,9 +1844,7 @@ static void draw_text(void)
} }
#endif #endif
#ifdef BUILD_X11 #ifdef BUILD_X11
#ifdef BUILD_LUA
llua_draw_pre_hook(); llua_draw_pre_hook();
#endif /* BUILD_LUA */
if (out_to_x.get(*state)) { if (out_to_x.get(*state)) {
cur_y = text_start_y; cur_y = text_start_y;
int bw = border_width.get(*state); int bw = border_width.get(*state);
@ -1884,9 +1876,9 @@ static void draw_text(void)
attron(COLOR_PAIR(COLOR_WHITE)); attron(COLOR_PAIR(COLOR_WHITE));
#endif /* BUILD_NCURSES */ #endif /* BUILD_NCURSES */
for_each_line(text_buffer, draw_line); for_each_line(text_buffer, draw_line);
#if defined(BUILD_LUA) && defined(BUILD_X11) #ifdef BUILD_X11
llua_draw_post_hook(); llua_draw_post_hook();
#endif /* BUILD_LUA */ #endif /* BUILD_X11 */
#ifdef BUILD_HTTP #ifdef BUILD_HTTP
if (out_to_http.get(*state)) { if (out_to_http.get(*state)) {
webpage.append(WEBPAGE_END); webpage.append(WEBPAGE_END);
@ -1996,9 +1988,7 @@ static void update_text(void)
clear_text(1); clear_text(1);
#endif /* BUILD_X11 */ #endif /* BUILD_X11 */
need_to_update = 1; need_to_update = 1;
#ifdef BUILD_LUA
llua_update_info(&info, active_update_interval()); llua_update_info(&info, active_update_interval());
#endif /* BUILD_LUA */
} }
#ifdef HAVE_SYS_INOTIFY_H #ifdef HAVE_SYS_INOTIFY_H
@ -2109,10 +2099,8 @@ static void main_loop(void)
#endif #endif
changed++; changed++;
#ifdef BUILD_LUA
/* update lua window globals */ /* update lua window globals */
llua_update_window_table(text_start_x, text_start_y, text_width, text_height); llua_update_window_table(text_start_x, text_start_y, text_width, text_height);
#endif /* BUILD_LUA */
} }
/* move window if it isn't in right position */ /* move window if it isn't in right position */
@ -2441,11 +2429,9 @@ static void main_loop(void)
} }
break; break;
} }
#ifdef BUILD_LUA
else { else {
llua_inotify_query(ev->wd, ev->mask); llua_inotify_query(ev->wd, ev->mask);
} }
#endif /* BUILD_LUA */
idx += INOTIFY_EVENT_SIZE + ev->len; idx += INOTIFY_EVENT_SIZE + ev->len;
} }
} }
@ -2456,9 +2442,7 @@ static void main_loop(void)
} }
#endif /* HAVE_SYS_INOTIFY_H */ #endif /* HAVE_SYS_INOTIFY_H */
#ifdef BUILD_LUA
llua_update_info(&info, active_update_interval()); llua_update_info(&info, active_update_interval());
#endif /* BUILD_LUA */
g_signal_pending = 0; g_signal_pending = 0;
} }
clean_up(NULL, NULL); clean_up(NULL, NULL);
@ -2550,9 +2534,7 @@ void clean_up_without_threads(void *memtofree1, void* memtofree2)
#ifdef BUILD_RSS #ifdef BUILD_RSS
rss_free_info(); rss_free_info();
#endif #endif
#ifdef BUILD_LUA
llua_shutdown_hook(); llua_shutdown_hook();
#endif /* BUILD_LUA */
#if defined BUILD_WEATHER_XOAP || defined BUILD_RSS #if defined BUILD_WEATHER_XOAP || defined BUILD_RSS
xmlCleanupParser(); xmlCleanupParser();
#endif #endif
@ -2639,10 +2621,8 @@ static void X11_create_window(void)
selected_font = 0; selected_font = 0;
update_text_area(); /* to get initial size of the window */ update_text_area(); /* to get initial size of the window */
} }
#ifdef BUILD_LUA
/* setup lua window globals */ /* setup lua window globals */
llua_setup_window_table(text_start_x, text_start_y, text_width, text_height); llua_setup_window_table(text_start_x, text_start_y, text_width, text_height);
#endif /* BUILD_LUA */
} }
#endif /* BUILD_X11 */ #endif /* BUILD_X11 */
@ -2966,9 +2946,7 @@ void initialisation(int argc, char **argv) {
#ifdef BUILD_X11 #ifdef BUILD_X11
X11_create_window(); X11_create_window();
#endif /* BUILD_X11 */ #endif /* BUILD_X11 */
#ifdef BUILD_LUA
llua_setup_info(&info, active_update_interval()); llua_setup_info(&info, active_update_interval());
#endif /* BUILD_LUA */
#ifdef BUILD_WEATHER_XOAP #ifdef BUILD_WEATHER_XOAP
xmlInitParser(); xmlInitParser();
#endif /* BUILD_WEATHER_XOAP */ #endif /* BUILD_WEATHER_XOAP */
@ -2989,9 +2967,7 @@ void initialisation(int argc, char **argv) {
NORM_ERR("error setting signal handler: %s", strerror(errno)); NORM_ERR("error setting signal handler: %s", strerror(errno));
} }
#ifdef BUILD_LUA
llua_startup_hook(); llua_startup_hook();
#endif /* BUILD_LUA */
} }
int main(int argc, char **argv) int main(int argc, char **argv)

View File

@ -64,9 +64,7 @@
#ifdef BUILD_ICONV #ifdef BUILD_ICONV
#include "iconv_tools.h" #include "iconv_tools.h"
#endif #endif
#ifdef BUILD_LUA
#include "llua.h" #include "llua.h"
#endif /* BUILD_LUA */
#include "logging.h" #include "logging.h"
#include "mixer.h" #include "mixer.h"
#include "mail.h" #include "mail.h"
@ -1628,7 +1626,6 @@ struct text_object *construct_text_object(char *s, const char *arg, long
obj->callbacks.print = &print_weather_forecast; obj->callbacks.print = &print_weather_forecast;
obj->callbacks.free = &free_weather; obj->callbacks.free = &free_weather;
#endif /* BUILD_WEATHER_XOAP */ #endif /* BUILD_WEATHER_XOAP */
#ifdef BUILD_LUA
END OBJ_ARG(lua, 0, "lua needs arguments: <function name> [function parameters]") END OBJ_ARG(lua, 0, "lua needs arguments: <function name> [function parameters]")
obj->data.s = strndup(arg, text_buffer_size.get(*state)); obj->data.s = strndup(arg, text_buffer_size.get(*state));
obj->callbacks.print = &print_lua; obj->callbacks.print = &print_lua;
@ -1667,7 +1664,6 @@ struct text_object *construct_text_object(char *s, const char *arg, long
obj->callbacks.gaugeval = &lua_barval; obj->callbacks.gaugeval = &lua_barval;
obj->callbacks.free = &gen_free_opaque; obj->callbacks.free = &gen_free_opaque;
#endif /* BUILD_X11 */ #endif /* BUILD_X11 */
#endif /* BUILD_LUA */
#ifdef BUILD_HDDTEMP #ifdef BUILD_HDDTEMP
END OBJ(hddtemp, &update_hddtemp) END OBJ(hddtemp, &update_hddtemp)
if (arg) if (arg)