From adb4955c34bd1cddda7482d214787a918d28171b Mon Sep 17 00:00:00 2001 From: Philip Flohr Date: Mon, 7 May 2018 18:13:27 +0200 Subject: [PATCH 1/8] Fail plugin installation if the target file already exists --- src/plugins/plugins.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index ced170fe..d10cf5b8 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -175,6 +175,12 @@ plugins_install(const char *const plugin_name, const char *const filename) g_string_append(target_path, "/"); g_string_append(target_path, plugin_name); + if (g_file_test (filename,G_FILE_TEST_EXISTS)) + { + log_info("Failed to install plugin: %s, file exists", plugin_name); + return FALSE; + } + ProfPlugin *plugin = g_hash_table_lookup(plugins, plugin_name); if (plugin) { plugins_unload(plugin_name); From 1f66c08567bf85eaa51eeffbc08d60e5903151f2 Mon Sep 17 00:00:00 2001 From: Philip Flohr Date: Mon, 7 May 2018 18:27:01 +0200 Subject: [PATCH 2/8] provide feedback on failure cause if plugin installation fails --- src/command/cmd_funcs.c | 5 +++-- src/plugins/plugins.c | 9 ++++++--- src/plugins/plugins.h | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index c8aa22b4..a955e2f8 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -6616,12 +6616,13 @@ cmd_plugins_install(ProfWin *window, const char *const command, gchar **args) return TRUE; } + GString* error_message = g_string_new(NULL); gchar *plugin_name = g_path_get_basename(path); - gboolean result = plugins_install(plugin_name, path); + gboolean result = plugins_install(plugin_name, path, error_message); if (result) { cons_show("Plugin installed: %s", plugin_name); } else { - cons_show("Failed to install plugin: %s", plugin_name); + cons_show("Failed to install plugin: %s. %s", plugin_name, error_message->str); } g_free(plugin_name); diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index d10cf5b8..e63aec84 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -149,10 +149,12 @@ plugins_install_all(const char *const path) get_file_paths_recursive(path, &contents); GSList *curr = contents; + GString *error_message = NULL; while (curr) { + error_message = g_string_new(NULL); if (g_str_has_suffix(curr->data, ".py") || g_str_has_suffix(curr->data, ".so")) { gchar *plugin_name = g_path_get_basename(curr->data); - if (plugins_install(plugin_name, curr->data)) { + if (plugins_install(plugin_name, curr->data, error_message)) { result->installed = g_slist_append(result->installed, strdup(curr->data)); } else { result->failed = g_slist_append(result->failed, strdup(curr->data)); @@ -167,7 +169,7 @@ plugins_install_all(const char *const path) } gboolean -plugins_install(const char *const plugin_name, const char *const filename) +plugins_install(const char *const plugin_name, const char *const filename, GString *error_message) { char *plugins_dir = files_get_data_path(DIR_PLUGINS); GString *target_path = g_string_new(plugins_dir); @@ -175,9 +177,10 @@ plugins_install(const char *const plugin_name, const char *const filename) g_string_append(target_path, "/"); g_string_append(target_path, plugin_name); - if (g_file_test (filename,G_FILE_TEST_EXISTS)) + if (g_file_test (target_path->str, G_FILE_TEST_EXISTS)) { log_info("Failed to install plugin: %s, file exists", plugin_name); + g_string_assign(error_message, "File exists"); return FALSE; } diff --git a/src/plugins/plugins.h b/src/plugins/plugins.h index 16d6874a..c787ee93 100644 --- a/src/plugins/plugins.h +++ b/src/plugins/plugins.h @@ -114,7 +114,7 @@ void plugins_shutdown(void); void plugins_free_install_result(PluginsInstallResult *result); -gboolean plugins_install(const char *const plugin_name, const char *const filename); +gboolean plugins_install(const char *const plugin_name, const char *const filename, GString * error_message); PluginsInstallResult* plugins_install_all(const char *const path); gboolean plugins_load(const char *const name); GSList* plugins_load_all(void); From 2795dc487cdcd9a4adf55799b36516bfd7725710 Mon Sep 17 00:00:00 2001 From: Philip Flohr Date: Mon, 7 May 2018 18:28:22 +0200 Subject: [PATCH 3/8] removed unreachable code: if plugin is loaded it is also installed and therefore installation will fail. -> The unload code is not needed --- src/plugins/plugins.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index e63aec84..889bb91b 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -184,11 +184,6 @@ plugins_install(const char *const plugin_name, const char *const filename, GStri return FALSE; } - ProfPlugin *plugin = g_hash_table_lookup(plugins, plugin_name); - if (plugin) { - plugins_unload(plugin_name); - } - gboolean result = copy_file(filename, target_path->str); g_string_free(target_path, TRUE); From e4ddced4203235c8393369ba3f0a62de1f5e980e Mon Sep 17 00:00:00 2001 From: Philip Flohr Date: Mon, 7 May 2018 19:41:47 +0200 Subject: [PATCH 4/8] use gio functions for file copy --- src/common.c | 35 +++++++++++++++-------------------- src/common.h | 2 +- src/plugins/plugins.c | 3 +-- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/common.c b/src/common.c index 164523a2..251eddc6 100644 --- a/src/common.c +++ b/src/common.c @@ -46,6 +46,7 @@ #include #include #include +#include #ifdef HAVE_NCURSESW_NCURSES_H #include @@ -105,28 +106,22 @@ mkdir_recursive(const char *dir) } gboolean -copy_file(const char *const sourcepath, const char *const targetpath) +copy_file(const char *const sourcepath, const char *const targetpath, const gboolean overwrite_existing) { - int ch; - FILE *source = fopen(sourcepath, "rb"); - if (source == NULL) { - return FALSE; + GFile *source = g_file_new_for_path(sourcepath); + GFile *dest = g_file_new_for_path(targetpath); + GError *error = NULL; + gboolean success = false; + + if (overwrite_existing) + { + success = g_file_copy (source, dest, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &error); + } + else + { + success = g_file_copy (source, dest, G_FILE_COPY_NONE, NULL, NULL, NULL, &error); } - - FILE *target = fopen(targetpath, "wb"); - if (target == NULL) { - fclose(source); - return FALSE; - } - - while((ch = fgetc(source)) != EOF) { - fputc(ch, target); - } - - fclose(source); - fclose(target); - - return TRUE; + return success; } char* diff --git a/src/common.h b/src/common.h index b2c36c3f..cb0a3b5a 100644 --- a/src/common.h +++ b/src/common.h @@ -82,7 +82,7 @@ typedef enum { gboolean create_dir(char *name); gboolean mkdir_recursive(const char *dir); -gboolean copy_file(const char *const src, const char *const target); +gboolean copy_file(const char *const src, const char *const target, const gboolean overwrite_existing); char* str_replace(const char *string, const char *substr, const char *replacement); int str_contains(const char str[], int size, char ch); gboolean strtoi_range(char *str, int *saveptr, int min, int max, char **err_msg); diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index 889bb91b..8c1bc2cf 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -184,13 +184,12 @@ plugins_install(const char *const plugin_name, const char *const filename, GStri return FALSE; } - gboolean result = copy_file(filename, target_path->str); + gboolean result = copy_file(filename, target_path->str, false); g_string_free(target_path, TRUE); if (result) { result = plugins_load(plugin_name); } - return result; } From cd86f5bc288872ae8050c6f56515d4b8a5c77475 Mon Sep 17 00:00:00 2001 From: Philip Flohr Date: Mon, 7 May 2018 20:29:34 +0200 Subject: [PATCH 5/8] added the possibility to uninstall a plugin --- src/command/cmd_defs.c | 4 ++++ src/command/cmd_funcs.c | 17 +++++++++++++++++ src/command/cmd_funcs.h | 1 + src/plugins/plugins.c | 15 +++++++++++++++ src/plugins/plugins.h | 2 ++ 5 files changed, 39 insertions(+) diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index a523c939..54df4903 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2084,6 +2084,7 @@ static struct cmd_t command_defs[] = CMD_SUBFUNCS( { "sourcepath", cmd_plugins_sourcepath }, { "install", cmd_plugins_install }, + { "uninstall", cmd_plugins_uninstall }, { "load", cmd_plugins_load }, { "unload", cmd_plugins_unload }, { "reload", cmd_plugins_reload }, @@ -2095,6 +2096,7 @@ static struct cmd_t command_defs[] = "/plugins sourcepath set ", "/plugins sourcepath clear", "/plugins install []", + "/plugins uninstall []", "/plugins unload []", "/plugins load []", "/plugins reload []", @@ -2105,6 +2107,7 @@ static struct cmd_t command_defs[] = { "sourcepath set ", "Set the default path to install plugins from, will be used if no arg is passed to /plugins install." }, { "sourcepath clear", "Clear the default plugins source path." }, { "install []", "Install a plugin, or all plugins found in a directory (recursive). Passing no argument will use the sourcepath if one is set." }, + { "uninstall []", "Uninstall a plugin." }, { "load []", "Load a plugin that already exists in the plugin directory, passing no argument loads all found plugins." }, { "unload []", "Unload a loaded plugin, passing no argument will unload all plugins." }, { "reload []", "Reload a plugin, passing no argument will reload all plugins." }, @@ -2113,6 +2116,7 @@ static struct cmd_t command_defs[] = "/plugins sourcepath set /home/meee/projects/profanity-plugins", "/plugins install", "/plugins install /home/steveharris/Downloads/metal.py", + "/plugins uninstall browser.py", "/plugins load browser.py", "/plugins unload say.py", "/plugins reload wikipedia.py") diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index a955e2f8..6aae8fb2 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -6663,6 +6663,23 @@ cmd_plugins_install(ProfWin *window, const char *const command, gchar **args) return TRUE; } +gboolean +cmd_plugins_uninstall(ProfWin *window, const char *const command, gchar **args) +{ + if (args[1] == NULL) { + return FALSE; + } + + gboolean res = plugins_uninstall(args[1]); + if (res) { + cons_show("Uninstalled plugin: %s", args[1]); + } else { + cons_show("Failed to uninstall plugin: %s", args[1]); + } + + return TRUE; +} + gboolean cmd_plugins_load(ProfWin *window, const char *const command, gchar **args) { diff --git a/src/command/cmd_funcs.h b/src/command/cmd_funcs.h index 0bbf338e..a00fce5d 100644 --- a/src/command/cmd_funcs.h +++ b/src/command/cmd_funcs.h @@ -162,6 +162,7 @@ gboolean cmd_console(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins_sourcepath(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins_install(ProfWin *window, const char *const command, gchar **args); +gboolean cmd_plugins_uninstall(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins_load(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins_unload(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins_reload(ProfWin *window, const char *const command, gchar **args); diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index 8c1bc2cf..5b60b398 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -34,6 +34,7 @@ #include #include +#include #include "log.h" #include "config.h" @@ -168,6 +169,20 @@ plugins_install_all(const char *const path) return result; } +gboolean +plugins_uninstall(const char *const plugin_name) +{ + plugins_unload(plugin_name); + char *plugins_dir = files_get_data_path(DIR_PLUGINS); + GString *target_path = g_string_new(plugins_dir); + free(plugins_dir); + g_string_append(target_path, "/"); + g_string_append(target_path, plugin_name); + GFile *file = g_file_new_for_path(target_path->str); + GError *error = NULL; + return g_file_delete(file, NULL, &error); +} + gboolean plugins_install(const char *const plugin_name, const char *const filename, GString *error_message) { diff --git a/src/plugins/plugins.h b/src/plugins/plugins.h index c787ee93..56f2e042 100644 --- a/src/plugins/plugins.h +++ b/src/plugins/plugins.h @@ -115,6 +115,8 @@ void plugins_shutdown(void); void plugins_free_install_result(PluginsInstallResult *result); gboolean plugins_install(const char *const plugin_name, const char *const filename, GString * error_message); +gboolean plugins_uninstall(const char *const plugin_name); +gboolean plugins_update(const char *const plugin_name, const char *const filename, GString * error_message); PluginsInstallResult* plugins_install_all(const char *const path); gboolean plugins_load(const char *const name); GSList* plugins_load_all(void); From a5a7db9e2b63c5748dea312d23aafbb89d660667 Mon Sep 17 00:00:00 2001 From: Philip Flohr Date: Mon, 7 May 2018 20:57:32 +0200 Subject: [PATCH 6/8] implemented plugin updates --- src/command/cmd_defs.c | 4 +++ src/command/cmd_funcs.c | 58 +++++++++++++++++++++++++++++++++++++++++ src/command/cmd_funcs.h | 1 + 3 files changed, 63 insertions(+) diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 54df4903..ee320e84 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2085,6 +2085,7 @@ static struct cmd_t command_defs[] = { "sourcepath", cmd_plugins_sourcepath }, { "install", cmd_plugins_install }, { "uninstall", cmd_plugins_uninstall }, + { "update", cmd_plugins_update }, { "load", cmd_plugins_load }, { "unload", cmd_plugins_unload }, { "reload", cmd_plugins_reload }, @@ -2097,6 +2098,7 @@ static struct cmd_t command_defs[] = "/plugins sourcepath clear", "/plugins install []", "/plugins uninstall []", + "/plugins update []", "/plugins unload []", "/plugins load []", "/plugins reload []", @@ -2108,6 +2110,7 @@ static struct cmd_t command_defs[] = { "sourcepath clear", "Clear the default plugins source path." }, { "install []", "Install a plugin, or all plugins found in a directory (recursive). Passing no argument will use the sourcepath if one is set." }, { "uninstall []", "Uninstall a plugin." }, + { "update []", "Updates an installed plugin" }, { "load []", "Load a plugin that already exists in the plugin directory, passing no argument loads all found plugins." }, { "unload []", "Unload a loaded plugin, passing no argument will unload all plugins." }, { "reload []", "Reload a plugin, passing no argument will reload all plugins." }, @@ -2116,6 +2119,7 @@ static struct cmd_t command_defs[] = "/plugins sourcepath set /home/meee/projects/profanity-plugins", "/plugins install", "/plugins install /home/steveharris/Downloads/metal.py", + "/plugins update /home/steveharris/Downloads/metal.py", "/plugins uninstall browser.py", "/plugins load browser.py", "/plugins unload say.py", diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 6aae8fb2..fa675309 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -6663,6 +6663,64 @@ cmd_plugins_install(ProfWin *window, const char *const command, gchar **args) return TRUE; } +gboolean +cmd_plugins_update(ProfWin *window, const char *const command, gchar **args) +{ + char *path = args[1]; + if (path == NULL) { + char* sourcepath = prefs_get_string(PREF_PLUGINS_SOURCEPATH); + if (sourcepath) { + path = strdup(sourcepath); + prefs_free_string(sourcepath); + } else { + cons_show("Either a path must be provided or the sourcepath property must be set, see /help plugins"); + return TRUE; + } + } else if (path[0] == '~' && path[1] == '/') { + if (asprintf(&path, "%s/%s", getenv("HOME"), path+2) == -1) { + return TRUE; + } + } else { + path = strdup(path); + } + + if (access(path, R_OK) != 0) { + cons_show("File not found: %s", path); + free(path); + return TRUE; + } + + if (is_regular_file(path)) { + if (!g_str_has_suffix(path, ".py") && !g_str_has_suffix(path, ".so")) { + cons_show("Plugins must have one of the following extensions: '.py' '.so'"); + free(path); + return TRUE; + } + + GString* error_message = g_string_new(NULL); + gchar *plugin_name = g_path_get_basename(path); + gboolean result = plugins_unload(plugin_name); + result |= plugins_uninstall(plugin_name); + result |= plugins_install(plugin_name, path, error_message); + if (result) { + cons_show("Plugin installed: %s", plugin_name); + } else { + cons_show("Failed to install plugin: %s. %s", plugin_name, error_message->str); + } + g_free(plugin_name); + + free(path); + return TRUE; + } + + if (is_dir(path)) { + return FALSE; + } + + cons_show("Argument must be a file or directory."); + return TRUE; +} + gboolean cmd_plugins_uninstall(ProfWin *window, const char *const command, gchar **args) { diff --git a/src/command/cmd_funcs.h b/src/command/cmd_funcs.h index a00fce5d..f4933d44 100644 --- a/src/command/cmd_funcs.h +++ b/src/command/cmd_funcs.h @@ -162,6 +162,7 @@ gboolean cmd_console(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins_sourcepath(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins_install(ProfWin *window, const char *const command, gchar **args); +gboolean cmd_plugins_update(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins_uninstall(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins_load(ProfWin *window, const char *const command, gchar **args); gboolean cmd_plugins_unload(ProfWin *window, const char *const command, gchar **args); From 054267d738af1799ed47704d24626b2dab4f962f Mon Sep 17 00:00:00 2001 From: Philip Flohr Date: Thu, 2 Aug 2018 07:51:13 +0200 Subject: [PATCH 7/8] Fix extended plugin handling PR Fixes problems found in PR #999 --- src/command/cmd_funcs.c | 23 +++++++++++++++-------- src/common.c | 14 ++++---------- src/plugins/plugins.c | 7 ++++++- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index fa675309..9cc7b881 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -6625,7 +6625,7 @@ cmd_plugins_install(ProfWin *window, const char *const command, gchar **args) cons_show("Failed to install plugin: %s. %s", plugin_name, error_message->str); } g_free(plugin_name); - + g_string_free(error_message, TRUE); free(path); return TRUE; } @@ -6699,24 +6699,31 @@ cmd_plugins_update(ProfWin *window, const char *const command, gchar **args) GString* error_message = g_string_new(NULL); gchar *plugin_name = g_path_get_basename(path); - gboolean result = plugins_unload(plugin_name); - result |= plugins_uninstall(plugin_name); - result |= plugins_install(plugin_name, path, error_message); - if (result) { - cons_show("Plugin installed: %s", plugin_name); + if (plugins_unload(plugin_name)) { + if (plugins_uninstall(plugin_name)) { + if (plugins_install(plugin_name, path, error_message)) { + cons_show("Plugin installed: %s", plugin_name); + } else { + cons_show("Failed to install plugin: %s. %s", plugin_name, error_message->str); + } + } else { + cons_show("Failed to uninstall plugin: %s.", plugin_name); + } } else { - cons_show("Failed to install plugin: %s. %s", plugin_name, error_message->str); + cons_show("Failed to unload plugin: %s.", plugin_name); } g_free(plugin_name); - + g_string_free(error_message, TRUE); free(path); return TRUE; } if (is_dir(path)) { + free(path); return FALSE; } + free(path); cons_show("Argument must be a file or directory."); return TRUE; } diff --git a/src/common.c b/src/common.c index 251eddc6..1f37b664 100644 --- a/src/common.c +++ b/src/common.c @@ -111,16 +111,10 @@ copy_file(const char *const sourcepath, const char *const targetpath, const gboo GFile *source = g_file_new_for_path(sourcepath); GFile *dest = g_file_new_for_path(targetpath); GError *error = NULL; - gboolean success = false; - - if (overwrite_existing) - { - success = g_file_copy (source, dest, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &error); - } - else - { - success = g_file_copy (source, dest, G_FILE_COPY_NONE, NULL, NULL, NULL, &error); - } + GFileCopyFlags flags = overwrite_existing ? G_FILE_COPY_OVERWRITE : G_FILE_COPY_NONE; + gboolean success = g_file_copy (source, dest, flags, NULL, NULL, NULL, &error); + g_object_unref(source); + g_object_unref(dest); return success; } diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index 5b60b398..3e07af4d 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -162,6 +162,7 @@ plugins_install_all(const char *const path) } } curr = g_slist_next(curr); + g_string_free(error_message, TRUE); } g_slist_free_full(contents, g_free); @@ -180,7 +181,11 @@ plugins_uninstall(const char *const plugin_name) g_string_append(target_path, plugin_name); GFile *file = g_file_new_for_path(target_path->str); GError *error = NULL; - return g_file_delete(file, NULL, &error); + gboolean result = g_file_delete(file, NULL, &error); + g_object_unref(file); + g_error_free(error); + g_string_free(target_path, TRUE); + return result; } gboolean From b367c848d46a2312fc79125da9288cacfc8c4c41 Mon Sep 17 00:00:00 2001 From: Dmitry Podgorny Date: Thu, 6 Sep 2018 19:46:36 +0300 Subject: [PATCH 8/8] configure.ac: add proper check for gio-2.0 PR #999 adds call of g_object_unref() which requires libgobject-2.0. The library is dependency of gio-2.0 and the problem is that current configure.ac simply adds -lgio-2.0 without dependencies. As fix, use pkg-config module. --- configure.ac | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 5f85c83a..8f79a711 100644 --- a/configure.ac +++ b/configure.ac @@ -159,9 +159,13 @@ CFLAGS="$CFLAGS_RESTORE" AS_IF([test "x$ncurses_cv_wget_wch" != xyes], [AC_MSG_ERROR([ncurses does not support wide characters])]) -### Check for other profanity dependencies +### Check for glib libraries PKG_CHECK_MODULES([glib], [glib-2.0 >= 2.40], [], [AC_MSG_ERROR([glib 2.40 or higher is required for profanity])]) +PKG_CHECK_MODULES([gio], [gio-2.0], [], + [AC_MSG_ERROR([libgio-2.0 from glib-2.0 is required for profanity])]) + +### Check for other profanity dependencies PKG_CHECK_MODULES([curl], [libcurl], [], [AC_CHECK_LIB([curl], [main], [], [AC_MSG_ERROR([libcurl is required for profanity])])]) @@ -297,9 +301,9 @@ AS_IF([test "x$PACKAGE_STATUS" = xdevelopment], AS_IF([test "x$PLATFORM" = xosx], [AM_CFLAGS="$AM_CFLAGS -Qunused-arguments"]) AM_LDFLAGS="$AM_LDFLAGS -export-dynamic" -AM_CPPFLAGS="$AM_CPPFLAGS $glib_CFLAGS $curl_CFLAGS $libnotify_CFLAGS $PYTHON_CPPFLAGS ${GTK_CFLAGS}" +AM_CPPFLAGS="$AM_CPPFLAGS $glib_CFLAGS $gio_CFLAGS $curl_CFLAGS $libnotify_CFLAGS $PYTHON_CPPFLAGS ${GTK_CFLAGS}" AM_CPPFLAGS="$AM_CPPFLAGS -DTHEMES_PATH=\"\\\"$THEMES_PATH\\\"\" -DICONS_PATH=\"\\\"$ICONS_PATH\\\"\"" -LIBS="$glib_LIBS $curl_LIBS $libnotify_LIBS $PYTHON_LIBS $PYTHON_LDFLAGS ${GTK_LIBS} -lgio-2.0 $LIBS" +LIBS="$glib_LIBS $gio_LIBS $curl_LIBS $libnotify_LIBS $PYTHON_LIBS $PYTHON_LDFLAGS ${GTK_LIBS} $LIBS" AC_SUBST(AM_LDFLAGS) AC_SUBST(AM_CFLAGS)