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
/* 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 @@
--- 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"
--- 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 @@
/* 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.
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)
@@ -201,7 +202,7 @@
# Windows and Haiku do not use libm for the math functions, they are part
-math = compiler.find_library('m')
+math = compiler.find_library('m', required: false) # before gettexting, in case iconv matters
--- 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);
+ purple_prefs_add_none(PIDGIN_PREFS_ROOT "/win32"); purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/win32/minimize_new_convs", FALSE);
--- 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 "gtkdnd-hints.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 @@
--- 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 @@
--- 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],
- install : true, install_dir : PIDGIN_PLUGINDIR)
+ build_by_default : false, + install : false, install_dir : PIDGIN_PLUGINDIR) --- 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
--- 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 <glib/gstdio.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 )