--- addressbook/backends/file/e-book-backend-file.c	2013-02-26 14:58:36 +0000
+++ addressbook/backends/file/e-book-backend-file.c	2013-12-27 10:46:12 +0000
@@ -453,7 +453,25 @@
 
 		i++;
 
+#ifndef G_OS_WIN32
 		ret = link (src_filename, fullname);
+#else
+		GFile *src_file = g_file_new_for_path (src_filename);
+		GFile *dst_file = g_file_new_for_path (fullname);
+		GError *copy_error = NULL;
+
+		g_file_copy (src_file, dst_file, G_FILE_COPY_NONE,
+		             NULL, NULL, NULL, &copy_error);
+
+		if (copy_error != NULL) {
+			g_error_free (copy_error);
+			ret = -1;
+		} else
+			ret = 0;
+
+		g_object_unref (src_file);
+		g_object_unref (dst_file);
+#endif
 
 	} while (ret < 0 && errno == EEXIST);
 
--- addressbook/backends/ldap/e-source-ldap.c	2013-02-26 14:58:36 +0000
+++ addressbook/backends/ldap/e-source-ldap.c	2013-12-27 06:34:25 +0000
@@ -18,7 +18,12 @@
 
 #include "e-source-ldap.h"
 
+#ifndef G_OS_WIN32
 #include <ldap.h>
+#else
+#include <windows.h>
+#include <winldap.h>
+#endif
 
 #define E_SOURCE_LDAP_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
--- addressbook/libebook/e-contact.c	2013-02-26 14:58:36 +0000
+++ addressbook/libebook/e-contact.c	2013-12-27 05:28:30 +0000
@@ -34,7 +34,7 @@
 #include "e-name-western.h"
 
 #ifdef G_OS_WIN32
-#include "libedataserver/e-data-server-util.h"
+#include "libedataserver/libedataserver.h"
 #undef LOCALEDIR
 #define LOCALEDIR e_util_get_localedir ()
 #endif
--- camel/camel-win32.c	2013-02-26 14:58:36 +0000
+++ camel/camel-win32.c	2013-11-24 22:18:41 +0000
@@ -83,11 +83,11 @@
 	}
 
 	localedir = replace_prefix (
-		E_DATA_SERVER_PREFIX, get_cp_prefix (), LOCALEDIR);
+		E_DATA_SERVER_PREFIX, "", LOCALEDIR);
 	libexecdir = replace_prefix (
-		E_DATA_SERVER_PREFIX, get_prefix (), CAMEL_LIBEXECDIR);
+		E_DATA_SERVER_PREFIX, "", CAMEL_LIBEXECDIR);
 	providerdir = replace_prefix (
-		E_DATA_SERVER_PREFIX, get_prefix (), CAMEL_PROVIDERDIR);
+		E_DATA_SERVER_PREFIX, "", CAMEL_PROVIDERDIR);
 
 	G_UNLOCK (mutex);
 }
--- libebackend/e-authentication-session.c	2013-02-26 14:58:36 +0000
+++ libebackend/e-authentication-session.c	2013-12-27 05:16:40 +0000
@@ -102,6 +102,7 @@
 	PROP_SOURCE_UID
 };
 
+#ifdef HAVE_GNOME_KEYRING
 static GnomeKeyringPasswordSchema schema = {
 	GNOME_KEYRING_ITEM_GENERIC_SECRET,
 	{
@@ -110,6 +111,7 @@
 		{ NULL, 0 }
 	}
 };
+#endif
 
 /* Forward Declarations */
 static void	authentication_session_msg
@@ -122,7 +124,9 @@
 	e_authentication_session,
 	G_TYPE_OBJECT)
 
+#ifdef HAVE_GNOME_KEYRING
 G_LOCK_DEFINE_STATIC (gnome_keyring);
+#endif
 
 static void
 async_context_free (AsyncContext *async_context)
@@ -1323,8 +1327,10 @@
                                               GCancellable *cancellable,
                                               GError **error)
 {
+#ifdef HAVE_GNOME_KEYRING
 	GnomeKeyringResult result;
 	const gchar *keyring;
+#endif
 	const gchar *uid;
 	gchar *display_name;
 
@@ -1337,14 +1343,17 @@
 	if (g_cancellable_set_error_if_cancelled (cancellable, error))
 		return FALSE;
 
+#ifdef HAVE_GNOME_KEYRING
 	if (permanently)
 		keyring = GNOME_KEYRING_DEFAULT;
 	else
 		keyring = GNOME_KEYRING_SESSION;
+#endif
 
 	uid = e_authentication_session_get_source_uid (session);
 	display_name = g_strdup_printf (KEYRING_ITEM_DISPLAY_FORMAT, uid);
 
+#ifdef HAVE_GNOME_KEYRING
 	G_LOCK (gnome_keyring);
 
 	result = gnome_keyring_store_password_sync (
@@ -1364,10 +1373,19 @@
 	}
 
 	G_UNLOCK (gnome_keyring);
+#else
+	g_set_error_literal (
+		error, E_AUTHENTICATION_SESSION_KEYRING_ERROR,
+		FALSE, "Keyring not supported on this platform");
+#endif
 
 	g_free (display_name);
 
+#ifdef HAVE_GNOME_KEYRING
 	return (result == GNOME_KEYRING_RESULT_OK);
+#else
+	return FALSE;
+#endif
 }
 
 /**
@@ -1502,7 +1520,9 @@
                                                gchar **password,
                                                GError **error)
 {
+#ifdef HAVE_GNOME_KEYRING
 	GnomeKeyringResult result;
+#endif
 	const gchar *uid;
 	gchar *temp = NULL;
 
@@ -1516,6 +1536,7 @@
 
 	uid = e_authentication_session_get_source_uid (session);
 
+#ifdef HAVE_GNOME_KEYRING
 	G_LOCK (gnome_keyring);
 
 	result = gnome_keyring_find_password_sync (
@@ -1551,8 +1572,17 @@
 		gnome_keyring_free_password (temp);
 
 	G_UNLOCK (gnome_keyring);
+#else
+	g_set_error_literal (
+		error, E_AUTHENTICATION_SESSION_KEYRING_ERROR,
+		FALSE, "Keyring not supported on this platform");
+#endif
 
+#ifdef HAVE_GNOME_KEYRING
 	return (result == GNOME_KEYRING_RESULT_OK);
+#else
+	return FALSE;
+#endif
 }
 
 /**
@@ -1688,7 +1718,9 @@
                                                GCancellable *cancellable,
                                                GError **error)
 {
+#ifdef HAVE_GNOME_KEYRING
 	GnomeKeyringResult result;
+#endif
 	const gchar *uid;
 
 	g_return_val_if_fail (E_IS_AUTHENTICATION_SESSION (session), FALSE);
@@ -1701,6 +1733,7 @@
 
 	uid = e_authentication_session_get_source_uid (session);
 
+#ifdef HAVE_GNOME_KEYRING
 	G_LOCK (gnome_keyring);
 
 	result = gnome_keyring_delete_password_sync (
@@ -1723,8 +1756,17 @@
 	}
 
 	G_UNLOCK (gnome_keyring);
+#else
+	g_set_error_literal (
+		error, E_AUTHENTICATION_SESSION_KEYRING_ERROR,
+		FALSE, "Keyring not supported on this platform");
+#endif
 
+#ifdef HAVE_GNOME_KEYRING
 	return (result == GNOME_KEYRING_RESULT_OK);
+#else
+	return FALSE;
+#endif
 }
 
 /**
--- libebackend/e-authentication-session.h	2013-02-26 14:58:36 +0000
+++ libebackend/e-authentication-session.h	2013-12-27 04:49:54 +0000
@@ -25,9 +25,11 @@
 
 #include <gio/gio.h>
 
+#ifdef HAVE_GNOME_KEYRING
 /* This needs to be in the public header since we're
  * reusing the GnomeKeyringResult enum for error codes. */
 #include <gnome-keyring.h>
+#endif
 
 #include <libedataserver/libedataserver.h>
 
--- libedataserverui/e-passwords-win32.c	2013-02-26 14:58:36 +0000
+++ libedataserverui/e-passwords-win32.c	2013-12-27 07:16:46 +0000
@@ -48,9 +48,7 @@
 #include <glib/gi18n-lib.h>
 
 #include "e-passwords.h"
-#include "libedataserver/e-data-server-util.h"
-#include "libedataserver/e-flag.h"
-#include "libedataserver/e-url.h"
+#include "libedataserver/libedataserver.h"
 
 #define d(x)
 
--- services/evolution-source-registry/evolution-source-registry-migrate-sources.c	2013-02-26 14:58:36 +0000
+++ services/evolution-source-registry/evolution-source-registry-migrate-sources.c	2013-12-27 07:34:26 +0000
@@ -21,7 +21,9 @@
 #include <glib/gstdio.h>
 #include <camel/camel.h>
 #include <libsoup/soup.h>
+#ifdef HAVE_GNOME_KEYRING
 #include <gnome-keyring.h>
+#endif
 
 #include <libebackend/libebackend.h>
 
@@ -137,6 +139,7 @@
 	PropertyFunc property_func;
 };
 
+#ifdef HAVE_GNOME_KEYRING
 static GnomeKeyringPasswordSchema schema = {
 	GNOME_KEYRING_ITEM_GENERIC_SECRET,
 	{
@@ -145,6 +148,7 @@
 		{ NULL, 0 }
 	}
 };
+#endif
 
 /* Forward Declarations */
 void evolution_source_registry_migrate_sources (void);
@@ -252,7 +256,9 @@
                        const gchar *server,
                        const gchar *protocol)
 {
+#ifdef HAVE_GNOME_KEYRING
 	GnomeKeyringAttributeList *attributes;
+#endif
 	GList *found_list = NULL;
 	gchar *display_name;
 
@@ -262,6 +268,7 @@
 
 	display_name = g_strdup_printf (KEYRING_ITEM_DISPLAY_FORMAT, uid);
 
+#ifdef HAVE_GNOME_KEYRING
 	attributes = gnome_keyring_attribute_list_new ();
 
 	gnome_keyring_attribute_list_append_string (
@@ -293,6 +300,7 @@
 
 	gnome_keyring_attribute_list_free (attributes);
 	gnome_keyring_found_list_free (found_list);
+#endif
 
 	g_free (display_name);
 }
--- tests/libedataserver/e-source-test.c	2013-02-26 14:58:36 +0000
+++ tests/libedataserver/e-source-test.c	2013-12-27 11:20:56 +0000
@@ -17,7 +17,11 @@
  */
 
 #include <string.h>
+#ifdef _WIN32
+#include <gio/gwin32outputstream.h>
+#else
 #include <gio/gunixoutputstream.h>
+#endif
 
 #include <libedataserver/libedataserver.h>
 
@@ -63,7 +67,11 @@
 	g_assert_no_error (error);
 
 	/* Write the given content to the temporary key file. */
+#ifdef G_OS_WIN32
+	stream = g_win32_output_stream_new (fd, TRUE);
+#else
 	stream = g_unix_output_stream_new (fd, TRUE);
+#endif
 	g_output_stream_write_all (
 		stream, content, strlen (content), NULL, NULL, &error);
 	g_object_unref (stream);
--- camel/camel-mime-utils.c	2013-02-26 14:58:36 +0000
+++ camel/camel-mime-utils.c	2013-12-27 13:38:18 +0000
@@ -113,6 +113,24 @@
  * time representation, stored in @tm, and provides the offset in
  * seconds from UTC time, stored in @offset.
  **/
+
+#ifndef HAVE_LOCALTIME_R
+struct tm *
+localtime_r (const time_t *tt,
+             struct tm *tm)
+{
+	struct tm *p = NULL;
+	p = localtime (tt);
+
+	if (p != NULL)
+		*tm = *p;
+	else
+		tm = NULL;
+
+	return tm;
+}
+#endif
+
 void
 camel_localtime_with_offset (time_t tt,
                              struct tm *tm,
