Fri, 28 Dec 2018 23:34:00 +0000
Merged in default (pull request #448)
Drop static plugin build support
Approved-by: Elliott Sales de Andrade
Approved-by: Gary Kramlich
Approved-by: Eion Robb
| libpurple/core.c | file | annotate | diff | comparison | revisions | |
| libpurple/plugins.h | file | annotate | diff | comparison | revisions | |
| meson.build | file | annotate | diff | comparison | revisions | |
| pidgin/plugins/ticker/gtkticker.h | file | annotate | diff | comparison | revisions |
--- a/libpurple/core.c Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/core.c Fri Dec 28 23:34:00 2018 +0000 @@ -60,9 +60,6 @@ static PurpleCoreUiOps *_ops = NULL; static PurpleCore *_core = NULL; -STATIC_PROTO_LOAD -STATIC_PROTO_UNLOAD - static void purple_core_print_version(void) { @@ -144,9 +141,6 @@ purple_cmds_init(); purple_protocols_init(); - /* Load all static protocols. */ - static_proto_load(); - /* Since plugins get probed so early we should probably initialize their * subsystem right away too. */ @@ -248,7 +242,6 @@ purple_prefs_uninit(); purple_plugins_uninit(); - static_proto_unload(); purple_protocols_uninit(); purple_cmds_uninit();
--- a/libpurple/plugins.h Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/plugins.h Fri Dec 28 23:34:00 2018 +0000 @@ -239,27 +239,7 @@ * * Defines the plugin's entry points. */ -#if !defined(PURPLE_PLUGINS) || defined(PURPLE_STATIC_PRPL) -#define PURPLE_PLUGIN_INIT(pluginname,pluginquery,pluginload,pluginunload) \ - PurplePluginInfo * pluginname##_plugin_query(void); \ - PurplePluginInfo * pluginname##_plugin_query(void) { \ - return pluginquery(NULL); \ - } \ - gboolean pluginname##_plugin_load(void); \ - gboolean pluginname##_plugin_load(void) { \ - GError *e = NULL; \ - gboolean loaded = pluginload(NULL, &e); \ - if (e) g_error_free(e); \ - return loaded; \ - } \ - gboolean pluginname##_plugin_unload(void); \ - gboolean pluginname##_plugin_unload(void) { \ - GError *e = NULL; \ - gboolean unloaded = pluginunload(NULL, &e); \ - if (e) g_error_free(e); \ - return unloaded; \ - } -#else /* PURPLE_PLUGINS && !PURPLE_STATIC_PRPL */ +#ifdef PURPLE_PLUGINS #define PURPLE_PLUGIN_INIT(pluginname,pluginquery,pluginload,pluginunload) \ G_MODULE_EXPORT GPluginPluginInfo *gplugin_query(GError **e); \ G_MODULE_EXPORT GPluginPluginInfo *gplugin_query(GError **e) { \ @@ -285,14 +265,8 @@ * function; and a *_register_type() function for use in your plugin's load * function. You must define an instance initialization function *_init() * and a class initialization function *_class_init() for the type. - * - * The type will be registered statically if used in a static protocol or if - * plugins support is disabled. */ -#if !defined(PURPLE_PLUGINS) || defined(PURPLE_STATIC_PRPL) -#define PURPLE_DEFINE_TYPE(TN, t_n, T_P) \ - PURPLE_DEFINE_STATIC_TYPE(TN, t_n, T_P) -#else +#ifdef PURPLE_PLUGINS #define PURPLE_DEFINE_TYPE(TN, t_n, T_P) \ PURPLE_DEFINE_DYNAMIC_TYPE(TN, t_n, T_P) #endif @@ -308,10 +282,7 @@ * A more general version of PURPLE_DEFINE_TYPE() which allows you to * specify #GTypeFlags and custom code. */ -#if !defined(PURPLE_PLUGINS) || defined(PURPLE_STATIC_PRPL) -#define PURPLE_DEFINE_TYPE_EXTENDED \ - PURPLE_DEFINE_STATIC_TYPE_EXTENDED -#else +#ifdef PURPLE_PLUGINS #define PURPLE_DEFINE_TYPE_EXTENDED \ PURPLE_DEFINE_DYNAMIC_TYPE_EXTENDED #endif @@ -341,10 +312,7 @@ * of PURPLE_DEFINE_TYPE_EXTENDED(). You should use this macro if the * interface lives in the plugin. */ -#if !defined(PURPLE_PLUGINS) || defined(PURPLE_STATIC_PRPL) -#define PURPLE_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) \ - PURPLE_IMPLEMENT_INTERFACE_STATIC(TYPE_IFACE, iface_init) -#else +#ifdef PURPLE_PLUGINS #define PURPLE_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) \ PURPLE_IMPLEMENT_INTERFACE_DYNAMIC(TYPE_IFACE, iface_init) #endif @@ -400,46 +368,6 @@ purple_plugin_add_interface(plugin, type_id, TYPE_IFACE, &interface_info); \ } -/** - * PURPLE_DEFINE_STATIC_TYPE: - * - * A convenience macro for static type implementations. - */ -#define PURPLE_DEFINE_STATIC_TYPE(TN, t_n, T_P) \ - PURPLE_DEFINE_STATIC_TYPE_EXTENDED (TN, t_n, T_P, 0, {}) - -/** - * PURPLE_DEFINE_STATIC_TYPE_EXTENDED: - * - * A more general version of PURPLE_DEFINE_STATIC_TYPE(). - */ -#define PURPLE_DEFINE_STATIC_TYPE_EXTENDED(TypeName, type_name, TYPE_PARENT, flags, CODE) \ -static GType type_name##_type_id = 0; \ -GType type_name##_get_type(void) { \ - if (G_UNLIKELY(type_name##_type_id == 0)) { \ - GType type_id; \ - const GTypeInfo type_info = { \ - sizeof (TypeName##Class), \ - (GBaseInitFunc) NULL, \ - (GBaseFinalizeFunc) NULL, \ - (GClassInitFunc) type_name##_class_init, \ - (GClassFinalizeFunc) NULL, \ - NULL, \ - sizeof (TypeName), \ - 0, \ - (GInstanceInitFunc) type_name##_init, \ - NULL \ - }; \ - type_id = g_type_register_static(TYPE_PARENT, #TypeName, &type_info, \ - (GTypeFlags) flags); \ - type_name##_type_id = type_id; \ - { CODE ; } \ - } \ - return type_name##_type_id; \ -} \ -void type_name##_register_type(PurplePlugin *); \ -void type_name##_register_type(PurplePlugin *plugin) { } - G_BEGIN_DECLS /**************************************************************************/
--- a/libpurple/protocols/bonjour/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/protocols/bonjour/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -23,12 +23,7 @@ bonjour_link_args = [] endif -if STATIC_BONJOUR - bonjour_prpl = static_library('bonjour', BONJOURSOURCES, - c_args : '-DPURPLE_STATIC_PRPL', - link_args : bonjour_link_args, - dependencies : [libxml, avahi, libpurple_dep, glib, ws2_32]) -elif DYNAMIC_BONJOUR +if DYNAMIC_BONJOUR bonjour_prpl = shared_library('bonjour', BONJOURSOURCES, link_args : bonjour_link_args, dependencies : [libxml, avahi, libpurple_dep, glib, ws2_32],
--- a/libpurple/protocols/facebook/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/protocols/facebook/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -18,11 +18,7 @@ 'util.h' ] -if STATIC_FACEBOOK - facebook_prpl = static_library('facebook', FACEBOOKSOURCES, - c_args : '-DPURPLE_STATIC_PRPL', - dependencies : [json, libpurple_dep, glib]) -elif DYNAMIC_FACEBOOK +if DYNAMIC_FACEBOOK facebook_prpl = shared_library('facebook', FACEBOOKSOURCES, dependencies : [json, libpurple_dep, glib], install : true, install_dir : PURPLE_PLUGINDIR)
--- a/libpurple/protocols/gg/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/protocols/gg/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -51,11 +51,7 @@ 'oauth/oauth-purple.h' ] -if STATIC_GG - gg_prpl = static_library('gg', GGSOURCES, - c_args : '-DPURPLE_STATIC_PRPL', - dependencies : [libgadu, json, libpurple_dep, glib]) -elif DYNAMIC_GG +if DYNAMIC_GG gg_prpl = shared_library('gg', GGSOURCES, dependencies : [libgadu, json, libpurple_dep, glib], install : true, install_dir : PURPLE_PLUGINDIR)
--- a/libpurple/protocols/irc/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/protocols/irc/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -7,11 +7,7 @@ 'parse.c' ] -if STATIC_IRC - irc_prpl = static_library('irc', IRCSOURCES, - c_args : '-DPURPLE_STATIC_PRPL', - dependencies : [sasl, libpurple_dep, glib, gio, ws2_32]) -elif DYNAMIC_IRC +if DYNAMIC_IRC irc_prpl = shared_library('irc', IRCSOURCES, dependencies : [sasl, libpurple_dep, glib, gio, ws2_32], install : true, install_dir : PURPLE_PLUGINDIR)
--- a/libpurple/protocols/jabber/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/protocols/jabber/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -114,12 +114,7 @@ jabber_link_args = [] endif -if STATIC_JABBER - jabber_prpl = static_library('jabber', JABBERSOURCES, - c_args : ['-DPURPLE_STATIC_PRPL', use_idn], - link_args : jabber_link_args, - dependencies : [gstreamer, idn, libxml, sasl, libpurple_dep, glib, gio, math, ws2_32]) -elif DYNAMIC_JABBER +if DYNAMIC_JABBER jabber_prpl = shared_library('jabber', JABBERSOURCES, c_args : use_idn, link_args : jabber_link_args,
--- a/libpurple/protocols/novell/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/protocols/novell/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -23,11 +23,7 @@ 'novell.c' ] -if STATIC_NOVELL - novell_prpl = static_library('novell', NOVELLSOURCES, - c_args : '-DPURPLE_STATIC_PRPL', - dependencies : [libpurple_dep, glib, ws2_32]) -elif DYNAMIC_NOVELL +if DYNAMIC_NOVELL novell_prpl = shared_library('novell', NOVELLSOURCES, dependencies : [libpurple_dep, glib, ws2_32], install : true, install_dir : PURPLE_PLUGINDIR)
--- a/libpurple/protocols/oscar/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/protocols/oscar/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -53,12 +53,7 @@ oscar_link_args = [] endif -if STATIC_OSCAR - oscar_prpl = static_library('oscar', OSCARSOURCES, - c_args : '-DPURPLE_STATIC_PRPL', - link_args : oscar_link_args, - dependencies : [libpurple_dep, glib, ws2_32]) -elif DYNAMIC_OSCAR +if DYNAMIC_OSCAR oscar_prpl = shared_library('oscar', OSCARSOURCES, link_args : oscar_link_args, dependencies : [libpurple_dep, glib, ws2_32],
--- a/libpurple/protocols/sametime/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/protocols/sametime/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -3,11 +3,7 @@ 'sametime.h' ] -if STATIC_SAMETIME - sametime_prpl = static_library('sametime', SAMETIMESOURCES, - c_args : ['-DG_LOG_DOMAIN="sametime"', '-DPURPLE_STATIC_PRPL'], - dependencies : [meanwhile, libpurple_dep, glib]) -elif DYNAMIC_SAMETIME +if DYNAMIC_SAMETIME sametime_prpl = shared_library('sametime', SAMETIMESOURCES, c_args : ['-DG_LOG_DOMAIN="sametime"'], dependencies : [meanwhile, libpurple_dep, glib],
--- a/libpurple/protocols/silc/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/protocols/silc/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -11,11 +11,7 @@ 'wb.h' ] -if STATIC_SILC - silc_prpl = static_library('silcpurple', SILCSOURCES, - c_args : '-DPURPLE_STATIC_PRPL', - dependencies : [silc, libpurple_dep, glib]) -elif DYNAMIC_SILC +if DYNAMIC_SILC silc_prpl = shared_library('silcpurple', SILCSOURCES, dependencies : [silc, libpurple_dep, glib], install : true, install_dir : PURPLE_PLUGINDIR)
--- a/libpurple/protocols/simple/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/protocols/simple/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -7,11 +7,7 @@ 'sipmsg.h' ] -if STATIC_SIMPLE - simple_prpl = static_library('simple', SIMPLESOURCES, - c_args : '-DPURPLE_STATIC_PRPL', - dependencies : [libpurple_dep, nettle, glib, gio, ws2_32]) -elif DYNAMIC_SIMPLE +if DYNAMIC_SIMPLE simple_prpl = shared_library('simple', SIMPLESOURCES, dependencies : [libpurple_dep, nettle, glib, gio, ws2_32], install : true, install_dir : PURPLE_PLUGINDIR)
--- a/libpurple/protocols/zephyr/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/libpurple/protocols/zephyr/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -68,11 +68,7 @@ extdep = ext_zephyr endif -if STATIC_ZEPHYR - zephyr_prpl = static_library('zephyr', ZEPHYRSOURCES, - c_args : ['-Dlint', '-DPURPLE_STATIC_PRPL'], - dependencies : [extdep, libpurple_dep, glib]) -elif DYNAMIC_ZEPHYR +if DYNAMIC_ZEPHYR zephyr_prpl = shared_library('zephyr', ZEPHYRSOURCES, c_args : '-Dlint', dependencies : [extdep, libpurple_dep, glib],
--- a/meson.build Fri Dec 28 23:07:06 2018 +0000 +++ b/meson.build Fri Dec 28 23:34:00 2018 +0000 @@ -535,68 +535,6 @@ ALL_PRPLS = DEFAULT_PRPLS + ['null'] dynamic_list = get_option('dynamic-prpls').split(',') -static_list = get_option('static-prpls').split(',') -if (static_list != [''] and static_list != []) and dynamic_list == ['all'] - dynamic_list = [] -endif - -if static_list == ['all'] - static_list = DEFAULT_PRPLS -endif -STATIC_PRPLS = [] -foreach prpl : static_list - if prpl == '' - # The list was empty; do nothing. - elif prpl == 'sametime' and not enable_meanwhile - # Do nothing - elif prpl == 'bonjour' and not enable_avahi - # Do nothing - elif prpl == 'silc' and not have_silc - # Do nothing - elif prpl == 'gg' and not have_libgadu - # Do nothing - elif prpl == 'zephyr' and IS_WIN32 - # Do nothing - else - STATIC_PRPLS += [prpl] - endif -endforeach -STATIC_LINK_LIBS = [] -extern_load = [] -load_proto = [] -extern_unload = [] -unload_proto = [] -foreach prpl : STATIC_PRPLS - # Ugly special case for 'libsilcpurple.la': - if prpl == 'silc' - STATIC_LINK_LIBS.append('\$(top_builddir)/libpurple/protocols/@1@/lib@1@purple.la'.format(meson.build_root(), prpl)) - else - # FIXME: Shouldn't be libtool: - STATIC_LINK_LIBS.append('\$(top_builddir)/libpurple/protocols/@1@/lib@1@.la'.format(meson.build_root(), prpl)) - endif - extern_load.append('extern gboolean @0@_plugin_load();'.format(prpl)) - load_proto.append('@0@_plugin_load();'.format(prpl)) - extern_unload.append('extern gboolean @0@_plugin_unload();'.format(prpl)) - unload_proto.append('@0@_plugin_unload();'.format(prpl)) -endforeach -STATIC_BONJOUR = STATIC_PRPLS.contains('bonjour') -STATIC_FACEBOOK = STATIC_PRPLS.contains('facebook') -STATIC_GG = STATIC_PRPLS.contains('gg') -STATIC_IRC = STATIC_PRPLS.contains('irc') -STATIC_JABBER = STATIC_PRPLS.contains('jabber') -STATIC_NOVELL = STATIC_PRPLS.contains('novell') -STATIC_OSCAR = STATIC_PRPLS.contains('oscar') or STATIC_PRPLS.contains('aim') or STATIC_PRPLS.contains('icq') -STATIC_SAMETIME = STATIC_PRPLS.contains('sametime') -STATIC_SILC = STATIC_PRPLS.contains('silc') -STATIC_SIMPLE = STATIC_PRPLS.contains('simple') -STATIC_ZEPHYR = STATIC_PRPLS.contains('zephyr') -conf.set('STATIC_PROTO_LOAD', - ' '.join(extern_load) + - ' static void static_proto_load(void) { ' + ' '.join(load_proto) + ' }') -conf.set('STATIC_PROTO_UNLOAD', - ' '.join(extern_unload) + - ' static void static_proto_unload(void) { ' + ' '.join(unload_proto) + ' }') - if dynamic_list == ['all'] dynamic_list = DEFAULT_PRPLS endif @@ -1019,7 +957,6 @@ message('') message('Enable Gestures............... : ' + enable_gestures.to_string()) message('Protocols to build dynamically : @0@'.format(DYNAMIC_PRPLS)) -message('Protocols to link statically.. : @0@'.format(STATIC_PRPLS)) message('') message('Build with GStreamer support.. : ' + enable_gst.to_string()) message('Build with voice and video.... : ' + enable_vv.to_string())
--- a/meson_options.txt Fri Dec 28 23:07:06 2018 +0000 +++ b/meson_options.txt Fri Dec 28 23:34:00 2018 +0000 @@ -56,9 +56,6 @@ option('silc', type : 'boolean', value : false, description : 'compile with SILC plugin') -option('static-prpls', type : 'string', - description : 'Link to certain protocols statically') - option('dynamic-prpls', type : 'string', value: 'all', description : 'specify which protocols to build dynamically')