qulogic/pidgin

Fix Windows builds and tests

2020-12-22, Elliott Sales de Andrade
48dfed6f4f1f
Parents 4be4ea8a8dca
Children c4665659625a
Fix Windows builds and tests

* Make math library optional.
As the comment says, it should be optional on Windows and Haiku, but the check defaults to required.
* Don't make `unistd.h` required.
* Disable transparency plugin build as it's very busted.
* Add missing headers to fix compile on Windows.
* Use a fixed pref key for test plugin loading instead of `TEST_DATA_DIR`.
The latter is an absolute path, and thus unsuitable as a preference key, since it will not start with `/` on Windows.
* Add a missing pref initialization on Windows.

Testing Done:
Compiled and run tests on Windows.

Reviewed at https://reviews.imfreedom.org/r/308/
--- a/libpurple/protocols/bonjour/dns_sd_proxy.h Mon Dec 21 23:17:45 2020 -0600
+++ b/libpurple/protocols/bonjour/dns_sd_proxy.h Tue Dec 22 00:19:36 2020 -0600
@@ -20,9 +20,7 @@
#ifndef PURPLE_BONJOUR_DNS_SD_PROXY_H
#define PURPLE_BONJOUR_DNS_SD_PROXY_H
-#ifndef _MSC_VER
#include <stdint.h>
-#endif
/* The following is a subset of Apple's dns_sd.h file
* http://www.opensource.apple.com/source/mDNSResponder/mDNSResponder-333.10/mDNSShared/dns_sd.h
--- a/libpurple/protocols/novell/nmconn.c Mon Dec 21 23:17:45 2020 -0600
+++ b/libpurple/protocols/novell/nmconn.c Tue Dec 22 00:19:36 2020 -0600
@@ -19,7 +19,9 @@
*/
#include <glib.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <string.h>
#include <ctype.h>
--- a/libpurple/smiley-custom.c Mon Dec 21 23:17:45 2020 -0600
+++ b/libpurple/smiley-custom.c Tue Dec 22 00:19:36 2020 -0600
@@ -21,6 +21,7 @@
#include "smiley-custom.h"
+#include "internal.h"
#include "debug.h"
#include "util.h"
--- a/libpurple/tests/test_ui.c Mon Dec 21 23:17:45 2020 -0600
+++ b/libpurple/tests/test_ui.c Tue Dec 22 00:19:36 2020 -0600
@@ -114,6 +114,6 @@
purple_prefs_load();
/* Load the desired plugins. The client should save the list of loaded plugins in
- * the preferences using purple_plugins_save_loaded(PLUGIN_SAVE_PREF) */
- purple_plugins_load_saved(TEST_DATA_DIR);
+ * the preferences using purple_plugins_save_loaded() */
+ purple_plugins_load_saved("/purple/test_ui/plugins/saved");
}
--- a/meson.build Mon Dec 21 23:17:45 2020 -0600
+++ b/meson.build Tue Dec 22 00:19:36 2020 -0600
@@ -115,8 +115,9 @@
# Checks for header files.
# AC_HEADER_SYS_WAIT:
conf.set('HAVE_SYS_WAIT_H', compiler.has_header('sys/wait.h'))
+conf.set('HAVE_UNISTD_H', compiler.has_header('unistd.h'))
-foreach h : ['fcntl.h', 'unistd.h', 'stdint.h']
+foreach h : ['fcntl.h', 'stdint.h']
if compiler.has_header(h)
conf.set('HAVE_' + h.to_upper().underscorify(), true)
else
@@ -201,7 +202,7 @@
# Windows and Haiku do not use libm for the math functions, they are part
# of the C library
-math = compiler.find_library('m')
+math = compiler.find_library('m', required: false)
# before gettexting, in case iconv matters
IOKIT = []
--- a/pidgin/gtkconv.c Mon Dec 21 23:17:45 2020 -0600
+++ b/pidgin/gtkconv.c Tue Dec 22 00:19:36 2020 -0600
@@ -6148,6 +6148,7 @@
purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/conversations/im/close_immediately", TRUE);
#ifdef _WIN32
+ purple_prefs_add_none(PIDGIN_PREFS_ROOT "/win32");
purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/win32/minimize_new_convs", FALSE);
#endif
--- a/pidgin/gtkdnd-hints.c Mon Dec 21 23:17:45 2020 -0600
+++ b/pidgin/gtkdnd-hints.c Tue Dec 22 00:19:36 2020 -0600
@@ -23,6 +23,8 @@
# include <config.h>
#endif
+#include <purple.h>
+
#include "gtkdnd-hints.h"
#include <gdk/gdk.h>
--- a/pidgin/plugins/gestures/stroke-draw.c Mon Dec 21 23:17:45 2020 -0600
+++ b/pidgin/plugins/gestures/stroke-draw.c Tue Dec 22 00:19:36 2020 -0600
@@ -6,7 +6,9 @@
#include "config.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <stdlib.h>
#include <stdio.h>
#include <glib.h>
--- a/pidgin/plugins/gestures/stroke.c Mon Dec 21 23:17:45 2020 -0600
+++ b/pidgin/plugins/gestures/stroke.c Tue Dec 22 00:19:36 2020 -0600
@@ -9,7 +9,9 @@
#include "config.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
--- a/pidgin/plugins/meson.build Mon Dec 21 23:17:45 2020 -0600
+++ b/pidgin/plugins/meson.build Tue Dec 22 00:19:36 2020 -0600
@@ -34,7 +34,8 @@
transparency = library('transparency', 'transparency.c',
dependencies : [libpurple_dep, libpidgin_dep, glib],
name_prefix : '',
- install : true, install_dir : PIDGIN_PLUGINDIR)
+ build_by_default : false,
+ install : false, install_dir : PIDGIN_PLUGINDIR)
endif
if enable_unity
--- a/pidgin/win32/gtkwin32dep.c Mon Dec 21 23:17:45 2020 -0600
+++ b/pidgin/win32/gtkwin32dep.c Tue Dec 22 00:19:36 2020 -0600
@@ -18,11 +18,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*
*/
-#include "internal.h"
-
#include <io.h>
#include <stdlib.h>
#include <stdio.h>
+#include <windows.h>
#include <winuser.h>
#include <shellapi.h>
--- a/pidgin/win32/untar.c Mon Dec 21 23:17:45 2020 -0600
+++ b/pidgin/win32/untar.c Tue Dec 22 00:19:36 2020 -0600
@@ -76,10 +76,12 @@
# include <unistd.h>
# endif
#endif
+#include <glib.h>
+#include <glib/gstdio.h>
+
+#include <purple.h>
+
#include "untar.h"
-#include <glib.h>
-
-#include <glib/gstdio.h>
#define untar_error( error, args... ) purple_debug(PURPLE_DEBUG_ERROR, "untar", error, ## args )
#define untar_warning( warning, args... ) purple_debug(PURPLE_DEBUG_WARNING, "untar", warning, ## args )