From 29f3fe70aeb5f566864c7868f7c89483547e92b4 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 13 May 2014 14:42:20 +1000 Subject: Extantz calls love, and love calls LuaSL, and clean out the need for scripts to twiddle the Lua paths. --- src/extantz/extantz.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/extantz/extantz.c') diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index b422343..c077f44 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c @@ -1,3 +1,5 @@ +#include + #include "extantz.h" #include "SledjHamr.h" #include "LumbrJack.h" @@ -408,7 +410,7 @@ void overlay_add(globals *ourGlobals) EAPI_MAIN int elm_main(int argc, char **argv) { GLData *gld = NULL; - char buf[PATH_MAX]; + char buf[PATH_MAX * 2], *env; // Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't. /* Set the locale according to the system pref. @@ -428,6 +430,21 @@ EAPI_MAIN int elm_main(int argc, char **argv) logDom = loggingStartup("extantz", logDom); + // Add extras, so we can run test.lua later. + env = getenv("LUA_CPATH"); + if (!env) env = ""; + sprintf(buf, "%s;%s/src/GuiLua/?.so", env, elm_app_bin_dir_get()); + setenv("LUA_CPATH", buf, 1); + + env = getenv("LUA_PATH"); + if (!env) env = ""; + sprintf(buf, "%s;%s/src/GuiLua/?.lua", env, elm_app_bin_dir_get()); + setenv("LUA_PATH", buf, 1); + + sprintf(buf, "%s/love &", elm_app_bin_dir_get()); + system(buf); + sleep(1); + // Don't do this, we need to clean up other stuff to, so set a clean up function below. //elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); elm_policy_set(ELM_POLICY_EXIT, ELM_POLICY_EXIT_NONE); -- cgit v1.1