mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-26 04:17:33 +00:00
Make lua required by cmake
This commit is contained in:
parent
4ac40e6054
commit
b5ff3eb411
@ -115,11 +115,8 @@ else(BUILD_X11)
|
||||
set(BUILD_IMLIB2 false CACHE BOOL "Enable Imlib2 support" FORCE)
|
||||
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_IMLIB2 "Build Imlib2 bindings for Lua" false)
|
||||
endif(BUILD_LUA)
|
||||
option(BUILD_LUA_CAIRO "Build cairo bindings for Lua" false)
|
||||
option(BUILD_LUA_IMLIB2 "Build Imlib2 bindings for Lua" false)
|
||||
|
||||
option(BUILD_AUDACIOUS "Build audacious (music player) support" false)
|
||||
|
||||
|
@ -205,27 +205,25 @@ if(BUILD_X11)
|
||||
endif(X11_FOUND)
|
||||
endif(BUILD_X11)
|
||||
|
||||
if(BUILD_LUA)
|
||||
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_includes ${conky_includes} ${LUA_INCLUDE_DIRS})
|
||||
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})
|
||||
find_program(APP_PATCH patch)
|
||||
if(NOT APP_PATCH)
|
||||
message(FATAL_ERROR "Unable to find program 'patch'")
|
||||
endif(NOT APP_PATCH)
|
||||
endif(BUILD_LUA_CAIRO)
|
||||
if(BUILD_LUA_IMLIB2)
|
||||
set(WANT_TOLUA true)
|
||||
pkg_check_modules(IMLIB2 imlib2)
|
||||
set(luaimlib2_libs ${IMLIB2_LIB} ${LUA_LIBRARIES})
|
||||
set(luaimlib2_includes ${IMLIB2_INCLUDE_PATH} ${LUA_INCLUDE_DIRS})
|
||||
endif(BUILD_LUA_IMLIB2)
|
||||
endif(BUILD_LUA)
|
||||
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_includes ${conky_includes} ${LUA_INCLUDE_DIRS})
|
||||
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})
|
||||
find_program(APP_PATCH patch)
|
||||
if(NOT APP_PATCH)
|
||||
message(FATAL_ERROR "Unable to find program 'patch'")
|
||||
endif(NOT APP_PATCH)
|
||||
endif(BUILD_LUA_CAIRO)
|
||||
if(BUILD_LUA_IMLIB2)
|
||||
set(WANT_TOLUA true)
|
||||
pkg_check_modules(IMLIB2 imlib2)
|
||||
set(luaimlib2_libs ${IMLIB2_LIB} ${LUA_LIBRARIES})
|
||||
set(luaimlib2_includes ${IMLIB2_INCLUDE_PATH} ${LUA_INCLUDE_DIRS})
|
||||
endif(BUILD_LUA_IMLIB2)
|
||||
|
||||
if(BUILD_AUDACIOUS)
|
||||
set(WANT_GLIB true)
|
||||
|
@ -45,8 +45,6 @@
|
||||
|
||||
#cmakedefine BUILD_XDBE 1
|
||||
|
||||
#cmakedefine BUILD_LUA 1
|
||||
|
||||
#cmakedefine BUILD_PORT_MONITORS 1
|
||||
|
||||
#cmakedefine BUILD_AUDACIOUS 1
|
||||
|
@ -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
|
||||
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
|
||||
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_library(timed-thread timed-thread.cc)
|
||||
@ -145,11 +145,6 @@ if(BUILD_WEATHER)
|
||||
set(optional_sources ${optional_sources} ${weather})
|
||||
endif(BUILD_WEATHER)
|
||||
|
||||
if(BUILD_LUA)
|
||||
set(lua llua.cc)
|
||||
set(optional_sources ${optional_sources} ${lua})
|
||||
endif(BUILD_LUA)
|
||||
|
||||
if(BUILD_NVIDIA)
|
||||
set(nvidia nvidia.cc)
|
||||
set(optional_sources ${optional_sources} ${nvidia})
|
||||
|
28
src/conky.cc
28
src/conky.cc
@ -87,9 +87,7 @@
|
||||
#ifdef BUILD_ICONV
|
||||
#include "iconv_tools.h"
|
||||
#endif
|
||||
#ifdef BUILD_LUA
|
||||
#include "llua.h"
|
||||
#endif /* BUILD_LUA */
|
||||
#include "logging.h"
|
||||
#include "mail.h"
|
||||
#include "nc.h"
|
||||
@ -325,7 +323,6 @@ static void print_version(void)
|
||||
#ifdef BUILD_NCURSES
|
||||
<< " * ncurses\n"
|
||||
#endif /* BUILD_NCURSES */
|
||||
#ifdef BUILD_LUA
|
||||
<< " * Lua\n"
|
||||
<< _("\n Lua bindings:\n")
|
||||
#ifdef BUILD_LUA_CAIRO
|
||||
@ -334,7 +331,6 @@ static void print_version(void)
|
||||
#ifdef BUILD_LUA_IMLIB2
|
||||
<< " * Imlib2\n"
|
||||
#endif /* BUILD_LUA_IMLIB2 */
|
||||
#endif /* BUILD_LUA */
|
||||
#ifdef BUILD_I18N
|
||||
<< " * Internationalization support\n"
|
||||
#endif
|
||||
@ -1088,10 +1084,8 @@ static void update_text_area(void)
|
||||
text_start_x = x;
|
||||
text_start_y = y;
|
||||
}
|
||||
#ifdef BUILD_LUA
|
||||
/* update lua window globals */
|
||||
llua_update_window_table(text_start_x, text_start_y, text_width, text_height);
|
||||
#endif /* BUILD_LUA */
|
||||
}
|
||||
|
||||
/* drawing stuff */
|
||||
@ -1850,9 +1844,7 @@ static void draw_text(void)
|
||||
}
|
||||
#endif
|
||||
#ifdef BUILD_X11
|
||||
#ifdef BUILD_LUA
|
||||
llua_draw_pre_hook();
|
||||
#endif /* BUILD_LUA */
|
||||
if (out_to_x.get(*state)) {
|
||||
cur_y = text_start_y;
|
||||
int bw = border_width.get(*state);
|
||||
@ -1884,9 +1876,9 @@ static void draw_text(void)
|
||||
attron(COLOR_PAIR(COLOR_WHITE));
|
||||
#endif /* BUILD_NCURSES */
|
||||
for_each_line(text_buffer, draw_line);
|
||||
#if defined(BUILD_LUA) && defined(BUILD_X11)
|
||||
#ifdef BUILD_X11
|
||||
llua_draw_post_hook();
|
||||
#endif /* BUILD_LUA */
|
||||
#endif /* BUILD_X11 */
|
||||
#ifdef BUILD_HTTP
|
||||
if (out_to_http.get(*state)) {
|
||||
webpage.append(WEBPAGE_END);
|
||||
@ -1996,9 +1988,7 @@ static void update_text(void)
|
||||
clear_text(1);
|
||||
#endif /* BUILD_X11 */
|
||||
need_to_update = 1;
|
||||
#ifdef BUILD_LUA
|
||||
llua_update_info(&info, active_update_interval());
|
||||
#endif /* BUILD_LUA */
|
||||
}
|
||||
|
||||
#ifdef HAVE_SYS_INOTIFY_H
|
||||
@ -2109,10 +2099,8 @@ static void main_loop(void)
|
||||
#endif
|
||||
|
||||
changed++;
|
||||
#ifdef BUILD_LUA
|
||||
/* update lua window globals */
|
||||
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 */
|
||||
@ -2441,11 +2429,9 @@ static void main_loop(void)
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifdef BUILD_LUA
|
||||
else {
|
||||
llua_inotify_query(ev->wd, ev->mask);
|
||||
}
|
||||
#endif /* BUILD_LUA */
|
||||
idx += INOTIFY_EVENT_SIZE + ev->len;
|
||||
}
|
||||
}
|
||||
@ -2456,9 +2442,7 @@ static void main_loop(void)
|
||||
}
|
||||
#endif /* HAVE_SYS_INOTIFY_H */
|
||||
|
||||
#ifdef BUILD_LUA
|
||||
llua_update_info(&info, active_update_interval());
|
||||
#endif /* BUILD_LUA */
|
||||
g_signal_pending = 0;
|
||||
}
|
||||
clean_up(NULL, NULL);
|
||||
@ -2550,9 +2534,7 @@ void clean_up_without_threads(void *memtofree1, void* memtofree2)
|
||||
#ifdef BUILD_RSS
|
||||
rss_free_info();
|
||||
#endif
|
||||
#ifdef BUILD_LUA
|
||||
llua_shutdown_hook();
|
||||
#endif /* BUILD_LUA */
|
||||
#if defined BUILD_WEATHER_XOAP || defined BUILD_RSS
|
||||
xmlCleanupParser();
|
||||
#endif
|
||||
@ -2639,10 +2621,8 @@ static void X11_create_window(void)
|
||||
selected_font = 0;
|
||||
update_text_area(); /* to get initial size of the window */
|
||||
}
|
||||
#ifdef BUILD_LUA
|
||||
/* setup lua window globals */
|
||||
llua_setup_window_table(text_start_x, text_start_y, text_width, text_height);
|
||||
#endif /* BUILD_LUA */
|
||||
}
|
||||
#endif /* BUILD_X11 */
|
||||
|
||||
@ -2966,9 +2946,7 @@ void initialisation(int argc, char **argv) {
|
||||
#ifdef BUILD_X11
|
||||
X11_create_window();
|
||||
#endif /* BUILD_X11 */
|
||||
#ifdef BUILD_LUA
|
||||
llua_setup_info(&info, active_update_interval());
|
||||
#endif /* BUILD_LUA */
|
||||
#ifdef BUILD_WEATHER_XOAP
|
||||
xmlInitParser();
|
||||
#endif /* BUILD_WEATHER_XOAP */
|
||||
@ -2989,9 +2967,7 @@ void initialisation(int argc, char **argv) {
|
||||
NORM_ERR("error setting signal handler: %s", strerror(errno));
|
||||
}
|
||||
|
||||
#ifdef BUILD_LUA
|
||||
llua_startup_hook();
|
||||
#endif /* BUILD_LUA */
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
@ -64,9 +64,7 @@
|
||||
#ifdef BUILD_ICONV
|
||||
#include "iconv_tools.h"
|
||||
#endif
|
||||
#ifdef BUILD_LUA
|
||||
#include "llua.h"
|
||||
#endif /* BUILD_LUA */
|
||||
#include "logging.h"
|
||||
#include "mixer.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.free = &free_weather;
|
||||
#endif /* BUILD_WEATHER_XOAP */
|
||||
#ifdef BUILD_LUA
|
||||
END OBJ_ARG(lua, 0, "lua needs arguments: <function name> [function parameters]")
|
||||
obj->data.s = strndup(arg, text_buffer_size.get(*state));
|
||||
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.free = &gen_free_opaque;
|
||||
#endif /* BUILD_X11 */
|
||||
#endif /* BUILD_LUA */
|
||||
#ifdef BUILD_HDDTEMP
|
||||
END OBJ(hddtemp, &update_hddtemp)
|
||||
if (arg)
|
||||
|
Loading…
Reference in New Issue
Block a user