Merged in CMaiku/pidgin (pull request #246)

Sun, 30 Jul 2017 21:49:06 +0000

author
Gary Kramlich <grim@reaperworld.com>
date
Sun, 30 Jul 2017 21:49:06 +0000
changeset 38610
8148835643b2
parent 38600
dae74aa0ce02 (current diff)
parent 38609
880fce2800d8 (diff)
child 38616
9a9a64db881c

Merged in CMaiku/pidgin (pull request #246)

Improve Windows build with Meson

Approved-by: Eion Robb <eionrobb@gmail.com>
Approved-by: Gary Kramlich <grim@reaperworld.com>

meson.build file | annotate | diff | comparison | revisions
pidgin/libpidgin.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/bonjour/meson.build	Fri Jul 21 01:54:41 2017 +0000
+++ b/libpurple/protocols/bonjour/meson.build	Sun Jul 30 21:49:06 2017 +0000
@@ -17,17 +17,20 @@
 
 if IS_WIN32
 	BONJOURSOURCES += ['dns_sd_proxy.c', 'mdns_dns_sd.c']
-#	FIXME: libbonjour_la_LIBADD += -lnetapi32
+	bonjour_link_args = ['-lnetapi32']
 else
 	BONJOURSOURCES += ['mdns_avahi.c']
+	bonjour_link_args = []
 endif
 
 if STATIC_BONJOUR
 	bonjour_prpl = static_library('bonjour', BONJOURSOURCES,
 	    c_args : '-DPURPLE_STATIC_PRPL',
-	    dependencies : [libxml, avahi, libpurple_dep, glib])
+	    link_args : bonjour_link_args,
+	    dependencies : [libxml, avahi, libpurple_dep, glib, ws2_32])
 elif DYNAMIC_BONJOUR
 	bonjour_prpl = shared_library('bonjour', BONJOURSOURCES,
-	    dependencies : [libxml, avahi, libpurple_dep, glib],
+	    link_args : bonjour_link_args,
+	    dependencies : [libxml, avahi, libpurple_dep, glib, ws2_32],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 endif
--- a/libpurple/protocols/irc/meson.build	Fri Jul 21 01:54:41 2017 +0000
+++ b/libpurple/protocols/irc/meson.build	Sun Jul 30 21:49:06 2017 +0000
@@ -10,9 +10,9 @@
 if STATIC_IRC
 	irc_prpl = static_library('irc', IRCSOURCES,
 	    c_args : '-DPURPLE_STATIC_PRPL',
-	    dependencies : [sasl, libpurple_dep, glib, gio])
+	    dependencies : [sasl, libpurple_dep, glib, gio, ws2_32])
 elif DYNAMIC_IRC
 	irc_prpl = shared_library('irc', IRCSOURCES,
-	    dependencies : [sasl, libpurple_dep, glib, gio],
+	    dependencies : [sasl, libpurple_dep, glib, gio, ws2_32],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 endif
--- a/libpurple/protocols/jabber/meson.build	Fri Jul 21 01:54:41 2017 +0000
+++ b/libpurple/protocols/jabber/meson.build	Sun Jul 30 21:49:06 2017 +0000
@@ -95,13 +95,21 @@
 	JABBERSOURCES += ['auth_cyrus.c']
 endif
 
+if IS_WIN32
+	jabber_link_args = ['-Wl,--export-all-symbols']
+else
+	jabber_link_args = []
+endif
+
 if STATIC_JABBER
 	jabber_prpl = static_library('jabber', JABBERSOURCES,
 	    c_args : '-DPURPLE_STATIC_PRPL',
-	    dependencies : [gstreamer, idn, libxml, sasl, libpurple_dep, glib, gio, math])
+	    link_args : jabber_link_args,
+	    dependencies : [gstreamer, idn, libxml, sasl, libpurple_dep, glib, gio, math, ws2_32])
 elif DYNAMIC_JABBER
 	jabber_prpl = shared_library('jabber', JABBERSOURCES,
-	    dependencies : [gstreamer, idn, libxml, sasl, libpurple_dep, glib, gio, math],
+	    link_args : jabber_link_args,
+	    dependencies : [gstreamer, idn, libxml, sasl, libpurple_dep, glib, gio, math, ws2_32],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 endif
 
--- a/libpurple/protocols/novell/meson.build	Fri Jul 21 01:54:41 2017 +0000
+++ b/libpurple/protocols/novell/meson.build	Sun Jul 30 21:49:06 2017 +0000
@@ -26,9 +26,9 @@
 if STATIC_NOVELL
 	novell_prpl = static_library('novell', NOVELLSOURCES,
 	    c_args : '-DPURPLE_STATIC_PRPL',
-	    dependencies : [libpurple_dep, glib])
+	    dependencies : [libpurple_dep, glib, ws2_32])
 elif DYNAMIC_NOVELL
 	novell_prpl = shared_library('novell', NOVELLSOURCES,
-	    dependencies : [libpurple_dep, glib],
+	    dependencies : [libpurple_dep, glib, ws2_32],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 endif
--- a/libpurple/protocols/oscar/meson.build	Fri Jul 21 01:54:41 2017 +0000
+++ b/libpurple/protocols/oscar/meson.build	Sun Jul 30 21:49:06 2017 +0000
@@ -47,13 +47,21 @@
 	'visibility.h'
 ]
 
+if IS_WIN32
+	oscar_link_args = ['-Wl,--export-all-symbols']
+else
+	oscar_link_args = []
+endif
+
 if STATIC_OSCAR
 	oscar_prpl = static_library('oscar', OSCARSOURCES,
 	    c_args : '-DPURPLE_STATIC_PRPL',
-	    dependencies : [libpurple_dep, glib])
+	    link_args : oscar_link_args,
+	    dependencies : [libpurple_dep, glib, ws2_32])
 elif DYNAMIC_OSCAR
 	oscar_prpl = shared_library('oscar', OSCARSOURCES,
-	    dependencies : [libpurple_dep, glib],
+	    link_args : oscar_link_args,
+	    dependencies : [libpurple_dep, glib, ws2_32],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 endif
 
--- a/libpurple/protocols/simple/meson.build	Fri Jul 21 01:54:41 2017 +0000
+++ b/libpurple/protocols/simple/meson.build	Sun Jul 30 21:49:06 2017 +0000
@@ -10,9 +10,9 @@
 if STATIC_SIMPLE
 	simple_prpl = static_library('simple', SIMPLESOURCES,
 	    c_args : '-DPURPLE_STATIC_PRPL',
-	    dependencies : [libpurple_dep, nettle, glib, gio])
+	    dependencies : [libpurple_dep, nettle, glib, gio, ws2_32])
 elif DYNAMIC_SIMPLE
 	simple_prpl = shared_library('simple', SIMPLESOURCES,
-	    dependencies : [libpurple_dep, nettle, glib, gio],
+	    dependencies : [libpurple_dep, nettle, glib, gio, ws2_32],
 	    install : true, install_dir : PURPLE_PLUGINDIR)
 endif
--- a/libpurple/win32/libc_interface.c	Fri Jul 21 01:54:41 2017 +0000
+++ b/libpurple/win32/libc_interface.c	Sun Jul 30 21:49:06 2017 +0000
@@ -34,6 +34,7 @@
 #include "debug.h"
 #include "libc_internal.h"
 #include <glib/gstdio.h>
+#include "util.h"
 
 /** This is redefined here because we can't include internal.h */
 #ifdef ENABLE_NLS
--- a/meson.build	Fri Jul 21 01:54:41 2017 +0000
+++ b/meson.build	Sun Jul 30 21:49:06 2017 +0000
@@ -1124,7 +1124,8 @@
 	gplugin = dependency('gplugin', version : '>= 0.0.17')
 	# GPLUGIN_REQ sets pkg-config requirements in the .pc file
 	pkg_conf.set('GPLUGIN_REQ', ', gplugin')
-	enable_introspection = true
+	enable_introspection = dependency('gobject-introspection-1.0',
+	    version : '>= 1.30.0', required : false).found()
 else
 	gplugin = []
 	enable_introspection = false
--- a/pidgin/gtkidle.c	Fri Jul 21 01:54:41 2017 +0000
+++ b/pidgin/gtkidle.c	Sun Jul 30 21:49:06 2017 +0000
@@ -27,7 +27,7 @@
 # include <CoreFoundation/CoreFoundation.h>
 # include <IOKit/IOKitLib.h>
 #elif defined (_WIN32)
-# include "gtkwin32dep.h"
+# include "win32/gtkwin32dep.h"
 #endif
 
 #include "idle.h"
--- a/pidgin/libpidgin.c	Fri Jul 21 01:54:41 2017 +0000
+++ b/pidgin/libpidgin.c	Sun Jul 30 21:49:06 2017 +0000
@@ -430,7 +430,7 @@
 	gboolean gui_check;
 	GList *active_accounts;
 	GStatBuf st;
-	GError *error;
+	GError *error = NULL;
 	int ret;
 
 	GOptionEntry option_entries[] = {
@@ -501,7 +501,6 @@
 		/* we have to convert the message (UTF-8 to console
 		   charset) early because after a segmentation fault
 		   it's not a good practice to allocate memory */
-		error = NULL;
 		segfault_message = g_locale_from_utf8(segfault_message_tmp,
 						      -1, NULL, NULL, &error);
 		if (segfault_message != NULL) {
@@ -510,7 +509,7 @@
 		else {
 			/* use 'segfault_message_tmp' (UTF-8) as a fallback */
 			g_warning("%s\n", error->message);
-			g_error_free(error);
+			g_clear_error(&error);
 			segfault_message = segfault_message_tmp;
 		}
 #else
@@ -539,11 +538,11 @@
 	 * Set the channel encoding to raw binary instead of the default of
 	 * UTF-8, because we'll be sending integers across instead of strings.
 	 */
-	error = NULL;
 	signal_status = g_io_channel_set_encoding(signal_channel, NULL, &error);
 	if (signal_status != G_IO_STATUS_NORMAL) {
 		fprintf(stderr, "Failed to set the signal channel to raw "
 				"binary: %s", error->message);
+		g_clear_error(&error);
 		exit(1);
 	}
 	signal_channel_watcher = g_io_add_watch(signal_channel, G_IO_IN, mainloop_sighandler, NULL);
@@ -670,7 +669,6 @@
 
 	search_path = g_build_filename(purple_user_dir(), "gtk-3.0.css", NULL);
 
-	error = NULL;
 	provider = gtk_css_provider_new();
 	gui_check = gtk_css_provider_load_from_path(provider, search_path, &error);
 
@@ -682,6 +680,7 @@
 	} else {
 		purple_debug_error("gtk", "Unable to load custom gtk-3.0.css: %s\n",
 		                   error ? error->message : "(unknown error)");
+		g_clear_error(&error);
 	}
 
 	g_free(search_path);
--- a/pidgin/meson.build	Fri Jul 21 01:54:41 2017 +0000
+++ b/pidgin/meson.build	Sun Jul 30 21:49:06 2017 +0000
@@ -160,6 +160,7 @@
 	    pidgin_SOURCES,
 	    link_args : '-export-dynamic',
 	    dependencies : [libpurple_dep, libpidgin_dep],
+	    gui_app : true,
 	    install : true)
 
 	if IS_WIN32

mercurial