Commit 185abca3 authored by Giovanni Panozzo's avatar Giovanni Panozzo

Allow customized runtime paths in cmake.

This patch allow runtime paths to be different from
install paths. This allows relative runtime paths
for AppImage builds.
parent 8f13dff3
......@@ -133,15 +133,33 @@ endif()
if(NOT REMMINA_DATADIR)
set(REMMINA_DATADIR "${CMAKE_INSTALL_FULL_DATADIR}")
if(NOT REMMINA_RUNTIME_DATADIR)
set(REMMINA_RUNTIME_DATADIR "${REMMINA_DATADIR}")
endif()
endif()
if(NOT REMMINA_LOCALEDIR)
set(REMMINA_LOCALEDIR "${CMAKE_INSTALL_FULL_LOCALEDIR}")
if(NOT REMMINA_RUNTIME_LOCALEDIR)
set(REMMINA_RUNTIME_LOCALEDIR "${REMMINA_LOCALEDIR}")
endif()
endif()
if(NOT REMMINA_PLUGINDIR)
set(REMMINA_PLUGINDIR "${CMAKE_INSTALL_FULL_LIBDIR}/remmina/plugins")
if(NOT REMMINA_RUNTIME_PLUGINDIR)
set(REMMINA_RUNTIME_PLUGINDIR "${REMMINA_PLUGINDIR}")
endif()
endif()
if(NOT REMMINA_UIDIR)
set(REMMINA_UIDIR "${REMMINA_DATADIR}/remmina/ui")
if(NOT REMMINA_RUNTIME_UIDIR)
set(REMMINA_RUNTIME_UIDIR "${REMMINA_UIDIR}")
endif()
endif()
if(NOT REMMINA_EXTERNAL_TOOLS_DIR)
set(REMMINA_EXTERNAL_TOOLS_DIR "${REMMINA_DATADIR}/remmina/external_tools")
if(NOT REMMINA_RUNTIME_EXTERNAL_TOOLS_DIR)
set(REMMINA_RUNTIME_EXTERNAL_TOOLS_DIR "${REMMINA_EXTERNAL_TOOLS_DIR}")
endif()
endif()
# Snap package generation support
......
......@@ -22,9 +22,10 @@
#define GETTEXT_PACKAGE remmina
#define REMMINA_DATADIR "${REMMINA_DATADIR}"
#define REMMINA_LOCALEDIR "${REMMINA_LOCALEDIR}"
#define REMMINA_PLUGINDIR "${REMMINA_PLUGINDIR}"
#define REMMINA_UIDIR "${REMMINA_UIDIR}"
#define REMMINA_RUNTIME_DATADIR "${REMMINA_RUNTIME_DATADIR}"
#define REMMINA_RUNTIME_LOCALEDIR "${REMMINA_RUNTIME_LOCALEDIR}"
#define REMMINA_RUNTIME_PLUGINDIR "${REMMINA_RUNTIME_PLUGINDIR}"
#define REMMINA_RUNTIME_UIDIR "${REMMINA_RUNTIME_UIDIR}"
#define REMMINA_RUNTIME_EXTERNAL_TOOLS_DIR "${REMMINA_RUNTIME_EXTERNAL_TOOLS_DIR}"
#endif
......@@ -824,7 +824,7 @@ remmina_plugin_entry(RemminaPluginService *service)
remmina_plugin_nx_service = service;
bindtextdomain(GETTEXT_PACKAGE, REMMINA_LOCALEDIR);
bindtextdomain(GETTEXT_PACKAGE, REMMINA_RUNTIME_LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
if ((dpy = XkbOpenDisplay(NULL, NULL, NULL, NULL, NULL, NULL)) != NULL)
......
......@@ -1496,7 +1496,7 @@ G_MODULE_EXPORT gboolean remmina_plugin_entry(RemminaPluginService* service)
return FALSE;
}
bindtextdomain(GETTEXT_PACKAGE, REMMINA_LOCALEDIR);
bindtextdomain(GETTEXT_PACKAGE, REMMINA_RUNTIME_LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
if (! service->register_plugin((RemminaPlugin*) &remmina_rdp))
......
......@@ -496,7 +496,7 @@ remmina_plugin_entry(RemminaPluginService *service)
TRACE_CALL(__func__);
remmina_plugin_service = service;
bindtextdomain(GETTEXT_PACKAGE, REMMINA_LOCALEDIR);
bindtextdomain(GETTEXT_PACKAGE, REMMINA_RUNTIME_LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
if (!service->register_plugin((RemminaPlugin *) &remmina_plugin_spice))
......
......@@ -66,7 +66,7 @@ remmina_plugin_entry(RemminaPluginService *service)
TRACE_CALL("remmina_plugin_entry");
remmina_plugin_telepathy_service = service;
bindtextdomain(GETTEXT_PACKAGE, REMMINA_LOCALEDIR);
bindtextdomain(GETTEXT_PACKAGE, REMMINA_RUNTIME_LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
if (!service->register_plugin((RemminaPlugin *) &remmina_plugin_telepathy))
......
......@@ -112,7 +112,7 @@ G_MODULE_EXPORT gboolean remmina_plugin_entry(RemminaPluginService *service)
TRACE_CALL("remmina_plugin_entry");
remmina_plugin_service = service;
bindtextdomain(GETTEXT_PACKAGE, REMMINA_LOCALEDIR);
bindtextdomain(GETTEXT_PACKAGE, REMMINA_RUNTIME_LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
if (!service->register_plugin((RemminaPlugin *) &remmina_plugin))
......
......@@ -2099,7 +2099,7 @@ remmina_plugin_entry(RemminaPluginService *service)
TRACE_CALL("remmina_plugin_entry");
remmina_plugin_service = service;
bindtextdomain(GETTEXT_PACKAGE, REMMINA_LOCALEDIR);
bindtextdomain(GETTEXT_PACKAGE, REMMINA_RUNTIME_LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
if (!service->register_plugin((RemminaPlugin *) &remmina_plugin_vnc))
......
......@@ -444,7 +444,7 @@ remmina_plugin_entry(RemminaPluginService *service)
TRACE_CALL("remmina_plugin_entry");
remmina_plugin_service = service;
bindtextdomain(GETTEXT_PACKAGE, REMMINA_LOCALEDIR);
bindtextdomain(GETTEXT_PACKAGE, REMMINA_RUNTIME_LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
if (!service->register_plugin((RemminaPlugin *) &remmina_plugin_xdmcp))
......
......@@ -186,9 +186,6 @@ if(WITH_TRANSLATIONS)
add_subdirectory(po)
endif()
set(REMMINA_EXTERNAL_TOOLS_DIR "${CMAKE_INSTALL_FULL_DATADIR}/remmina/external_tools")
add_definitions( -DREMMINA_EXTERNAL_TOOLS_DIR="${REMMINA_EXTERNAL_TOOLS_DIR}" )
add_subdirectory(icons)
add_subdirectory(desktop)
add_subdirectory(external_tools)
......
......@@ -212,7 +212,7 @@ static void remmina_on_startup(GApplication *app)
gtk_window_set_default_icon_name("remmina");
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
REMMINA_DATADIR G_DIR_SEPARATOR_S "icons");
REMMINA_RUNTIME_DATADIR G_DIR_SEPARATOR_S "icons");
g_application_hold(app);
}
......@@ -239,7 +239,7 @@ int main(int argc, char* argv[])
remmina_masterthread_exec_save_main_thread_id();
bindtextdomain(GETTEXT_PACKAGE, REMMINA_LOCALEDIR);
bindtextdomain(GETTEXT_PACKAGE, REMMINA_RUNTIME_LOCALEDIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
......
......@@ -62,7 +62,7 @@ gboolean remmina_external_tools_from_filename(RemminaMain *remminamain, gchar* r
GDir* dir;
const gchar* name;
strcpy(dirname, REMMINA_EXTERNAL_TOOLS_DIR);
strcpy(dirname, REMMINA_RUNTIME_EXTERNAL_TOOLS_DIR);
dir = g_dir_open(dirname, 0, NULL);
if (dir == NULL)
......@@ -104,7 +104,7 @@ static gboolean remmina_external_tools_launcher(const gchar* filename, const gch
size_t envstrlen;
gchar launcher[MAX_PATH_LEN];
g_snprintf(launcher, MAX_PATH_LEN, "%s/launcher.sh", REMMINA_EXTERNAL_TOOLS_DIR);
g_snprintf(launcher, MAX_PATH_LEN, "%s/launcher.sh", REMMINA_RUNTIME_EXTERNAL_TOOLS_DIR);
remminafile = remmina_file_load(filename);
GHashTableIter iter;
......
......@@ -497,7 +497,7 @@ void remmina_icon_init(void)
{
#ifdef HAVE_LIBAPPINDICATOR
remmina_icon.icon = app_indicator_new ("remmina-icon", remmina_panel, APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
app_indicator_set_icon_theme_path (remmina_icon.icon, REMMINA_DATADIR G_DIR_SEPARATOR_S "icons");
app_indicator_set_icon_theme_path (remmina_icon.icon, REMMINA_RUNTIME_DATADIR G_DIR_SEPARATOR_S "icons");
app_indicator_set_status (remmina_icon.icon, APP_INDICATOR_STATUS_ACTIVE);
app_indicator_set_title (remmina_icon.icon, "Remmina");
......
......@@ -232,7 +232,7 @@ void remmina_plugin_manager_init(void)
return;
}
dir = g_dir_open(REMMINA_PLUGINDIR, 0, NULL);
dir = g_dir_open(REMMINA_RUNTIME_PLUGINDIR, 0, NULL);
if (dir == NULL)
return;
while ((name = g_dir_read_name(dir)) != NULL)
......@@ -242,7 +242,7 @@ void remmina_plugin_manager_init(void)
ptr++;
if (g_strcmp0(ptr, G_MODULE_SUFFIX) != 0)
continue;
fullpath = g_strdup_printf(REMMINA_PLUGINDIR "/%s", name);
fullpath = g_strdup_printf(REMMINA_RUNTIME_PLUGINDIR "/%s", name);
remmina_plugin_manager_load_plugin(fullpath);
g_free(fullpath);
}
......
......@@ -610,7 +610,7 @@ gboolean remmina_public_get_modifier_for_keycode(GdkKeymap *keymap, guint16 keyc
GtkBuilder* remmina_public_gtk_builder_new_from_file(gchar *filename)
{
TRACE_CALL("remmina_public_gtk_builder_new_from_file")
gchar *ui_path = g_strconcat(REMMINA_UIDIR, G_DIR_SEPARATOR_S, filename, NULL);
gchar *ui_path = g_strconcat(REMMINA_RUNTIME_UIDIR, G_DIR_SEPARATOR_S, filename, NULL);
#if GTK_CHECK_VERSION(3, 10, 0)
GtkBuilder *builder = gtk_builder_new_from_file(ui_path);
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment