- Unbreak Evolution support

- Bring patches from Fedora

PR:		ports/156982
Submitted by:	Marcin Wisnicki <mwisnicki+freebsd@gmail.com> (maintainer)
This commit is contained in:
Pav Lucistnik 2011-06-23 12:07:38 +00:00
parent 0f729e66d2
commit d366466849
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=276121
9 changed files with 393 additions and 10 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= mail-notification
DISTVERSION= 5.4
PORTREVISION= 7
PORTREVISION= 8
CATEGORIES= mail ipv6
MASTER_SITES= ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= mailnotify
@ -45,7 +45,7 @@ OPTIONS= EVOLUTION "Evolution support" off \
SYLPHEED "Sylpheed support" on \
YAHOO "Yahoo! Mail support" on
.include <bsd.port.pre.mk>
.include <bsd.port.options.mk>
.if defined(WITHOUT_MBOX)
JB_CONF_ARGS+= mbox=no
@ -94,11 +94,8 @@ PLIST_SUB+= EVOLUTION="@comment "
EVO_VERSION!= make -C ${PORTSDIR}/mail/evolution -V EVO_VERSION
BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/evolution-plugin.pc:${PORTSDIR}/mail/evolution
RUN_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/evolution-plugin.pc:${PORTSDIR}/mail/evolution
USE_GNOME+= gtkhtml3
PLIST_SUB+= EVOLUTION="" EVO_VERSION=${EVO_VERSION}
# Work around the fact that MN is using evolution's private(?) api that is not part of
# evolution-plugin thus it's includes are not covered by pkgconfig metadata.
# That path is frozen at 3.14 even for later versions of libgtkhtml.
CFLAGS+= -I${LOCALBASE}/include/libgtkhtml-3.14 -I${LOCALBASE}/include/libgtkhtml-3.14/editor
.endif
.if defined(WITHOUT_MOZILLA)
JB_CONF_ARGS+= mozilla=no
@ -120,8 +117,7 @@ LIB_DEPENDS+= gmime-2.0.4:${PORTSDIR}/mail/gmime2
.if defined(WITHOUT_SSL)
JB_CONF_ARGS+= ssl=no
.else
# we can't use USE_OPENSSL=yes after including bsd.port.pre.mk
.include "${PORTSDIR}/Mk/bsd.openssl.mk"
USE_OPENSSL= yes
.endif
.if defined(WITHOUT_SASL)
JB_CONF_ARGS+= sasl=no
@ -143,4 +139,4 @@ do-build:
do-install:
cd ${WRKSRC} && ./jb install
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View file

@ -1,3 +1,2 @@
MD5 (mail-notification-5.4.tar.bz2) = c8dc33a61251acb5474e56eab6b18f43
SHA256 (mail-notification-5.4.tar.bz2) = 5dec5f3852437e7735269697c77a29a24ea230987c764523fe66dabdca815af5
SIZE (mail-notification-5.4.tar.bz2) = 570008

View file

@ -0,0 +1,188 @@
diff -Nrbu build/src/mn-evolution-folder-tree-server.c build/src/mn-evolution-folder-tree-server.c
--- build/src/mn-evolution-folder-tree-server.c 2008-05-22 19:47:48.000000000 +0400
+++ build/src/mn-evolution-folder-tree-server.c 2010-09-17 17:45:05.000000000 +0400
@@ -25,7 +25,10 @@
#line 24 "src/mn-evolution-folder-tree-server.gob"
#include <dbus/dbus.h>
+#include <libedataserver/eds-version.h>
+#if !EDS_CHECK_VERSION(2,29,0)
#include <mail/mail-component.h>
+#endif
#include <mail/em-folder-tree.h>
#include "mn-evolution-plugin.h"
#include "mn-evolution.h"
@@ -441,10 +444,14 @@
{
#line 61 "src/mn-evolution-folder-tree-server.gob"
+#if EDS_CHECK_VERSION(2,29,0)
+ selfp->tree = em_folder_tree_new();
+#else
EMFolderTreeModel *model;
model = mail_component_peek_tree_model(mail_component_peek());
selfp->tree = em_folder_tree_new_with_model(model);
+#endif
selfp->plug = gtk_plug_new((GdkNativeWindow) selfp->id);
gtk_container_add(GTK_CONTAINER(selfp->plug), selfp->tree);
diff -Nrbu build/src/mn-evolution-server.c build/src/mn-evolution-server.c
--- build/src/mn-evolution-server.c 2008-05-22 19:47:48.000000000 +0400
+++ build/src/mn-evolution-server.c 2010-09-17 17:45:32.000000000 +0400
@@ -27,10 +27,16 @@
#include <stdio.h>
#include <libintl.h>
#include <gobject/gvaluecollector.h>
+#include <libedataserver/eds-version.h>
#include <camel/camel-folder.h>
+#if EDS_CHECK_VERSION(2,29,0)
+#include <shell/e-shell.h>
+#include <mail/e-mail-browser.h>
+#else
#include <mail/em-folder-view.h>
#include <mail/em-format.h>
#include <mail/em-message-browser.h>
+#endif
#include <mail/em-utils.h>
#include <mail/mail-session.h>
#include <mail/mail-tools.h>
@@ -391,10 +397,18 @@
info = g_new0(FolderInfo, 1);
info->uri = g_strdup(uri);
info->folder = folder;
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_ref(folder);
+#else
camel_object_ref(folder);
+#endif
/* uncache the folder when it is deleted */
+#if EDS_CHECK_VERSION(2,31,0)
+ g_signal_connect(folder, "deleted", G_CALLBACK(self_folder_deleted_cb), info);
+#else
camel_object_hook_event(folder, "deleted", self_folder_deleted_cb, info);
+#endif
g_hash_table_replace(folders, info->uri, info);
}}
@@ -413,8 +427,13 @@
{
#line 105 "src/mn-evolution-server.gob"
+#if EDS_CHECK_VERSION(2,31,0)
+ g_signal_handlers_disconnect_by_func(info->folder, self_folder_deleted_cb, info);
+ g_object_unref(info->folder);
+#else
camel_object_unhook_event(info->folder, "deleted", self_folder_deleted_cb, info);
camel_object_unref(info->folder);
+#endif
g_free(info->uri);
g_free(info);
}}
@@ -461,7 +480,11 @@
if (info)
{
folder = info->folder;
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_ref(folder);
+#else
camel_object_ref(folder);
+#endif
}
}
else
@@ -595,14 +618,23 @@
for (i = 0; i < summary->len; i++)
{
+#if EDS_CHECK_VERSION(2,23,5)
+ char *uid = summary->pdata[i];
+ CamelMessageInfo *info = camel_folder_get_message_info(folder, uid);
+#else
CamelMessageInfo *info = summary->pdata[i];
+#endif
if ((camel_message_info_flags(info) & CAMEL_MESSAGE_SEEN) == 0)
g_ptr_array_add(*ret, self_camel_message_info_to_dbus_struct(info));
}
camel_folder_free_summary(folder, summary);
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_unref(folder);
+#else
camel_object_unref(folder);
+#endif
}
GDK_THREADS_LEAVE();
@@ -638,7 +670,11 @@
if (folder)
{
*ret = g_strdup(camel_folder_get_name(folder));
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_unref(folder);
+#else
camel_object_unref(folder);
+#endif
}
GDK_THREADS_LEAVE();
@@ -673,6 +709,19 @@
folder = self_lookup_folder(folder_uri, err);
if (folder)
{
+#if EDS_CHECK_VERSION(2,29,0)
+ EShell *shell;
+ EShellBackend *shell_backend;
+ GtkWidget *browser;
+
+ shell = e_shell_get_default ();
+ shell_backend = e_shell_get_backend_by_name (shell, "mail");
+
+ browser = e_mail_browser_new (shell_backend);
+ e_mail_reader_set_folder (E_MAIL_READER (browser), folder, folder_uri);
+ e_mail_reader_set_message (E_MAIL_READER (browser), message_uid);
+ gtk_widget_show (browser);
+#else
GtkWidget *browser;
/* modelled after Evolution's handleuri_got_folder() */
@@ -683,8 +732,13 @@
em_folder_view_set_folder((EMFolderView *) browser, folder, folder_uri);
em_folder_view_set_message((EMFolderView *) browser, message_uid, FALSE);
gtk_widget_show(((EMMessageBrowser *) browser)->window);
+#endif
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_unref(folder);
+#else
camel_object_unref(folder);
+#endif
}
GDK_THREADS_LEAVE();
@@ -721,7 +775,11 @@
if (folder)
{
status = camel_folder_set_message_flags(folder, message_uid, flags, flags);
+#if EDS_CHECK_VERSION(2,31,0)
+ g_object_unref(folder);
+#else
camel_object_unref(folder);
+#endif
if (! status)
g_set_error(err,
diff -Nrbu src/mn-evolution-plugin.c src/mn-evolution-plugin.c
--- src/mn-evolution-plugin.c 2008-05-22 19:45:35.000000000 +0400
+++ src/mn-evolution-plugin.c 2010-09-17 17:45:05.000000000 +0400
@@ -204,7 +204,7 @@
}
int
-e_plugin_lib_enable (EPluginLib *ep, int enable)
+e_plugin_lib_enable (EPlugin *ep, int enable)
{
static gboolean enabled = FALSE;
GError *err = NULL;

View file

@ -0,0 +1,24 @@
diff -up build/src/mn-pop3-mailbox.c build/src/mn-pop3-mailbox.c
--- build/src/mn-pop3-mailbox.c 2009-05-19 10:29:58.448201837 +0200
+++ build/src/mn-pop3-mailbox.c 2009-05-19 10:23:29.356204287 +0200
@@ -619,7 +619,7 @@ mn_pop3_mailbox_enter_auth_cb (MNClientS
if (initial_clientoutlen > 0)
{
- char buf64[initial_clientoutlen * 2]; /* Base64 is 33% larger than the data it encodes */
+ char buf64[initial_clientoutlen * 2 + 1]; /* Base64 is 33% larger than the data it encodes */
unsigned int outlen;
int result;
char *str;
diff -up src/mn-client-session.c src/mn-client-session.c
--- src/mn-client-session.c 2008-05-22 17:45:35.000000000 +0200
+++ src/mn-client-session.c 2009-05-19 10:29:09.112211055 +0200
@@ -1030,7 +1030,7 @@ mn_client_session_write (MNClientSession
static int
write_base64 (MNClientSession *session, const char *buf, unsigned int len)
{
- char buf64[len * 2]; /* Base64 is 33% larger than the data it encodes */
+ char buf64[len * 2 + 1]; /* Base64 is 33% larger than the data it encodes */
unsigned int outlen;
int result;
char *str;

View file

@ -0,0 +1,12 @@
diff -Nrbu jbsrc/lib/src/extras/jb-evolution-plugin.c jbsrc/lib/src/extras/jb-evolution-plugin.c
--- jbsrc/lib/src/extras/jb-evolution-plugin.c 2008-04-27 18:47:43.000000000 +0400
+++ jbsrc/lib/src/extras/jb-evolution-plugin.c 2009-08-21 19:48:22.000000000 +0400
@@ -41,7 +41,7 @@
if (! minversion)
minversion = "2.12";
- packages = g_strdup_printf("evolution-plugin >= %s", minversion);
+ packages = g_strdup_printf("evolution-plugin >= %s libgtkhtml-3.14 gtkhtml-editor-3.14", minversion);
result = jb_check_packages("Evolution", "evolution-plugin", packages);
g_free(packages);

View file

@ -0,0 +1,36 @@
diff -Nrbu build/src/mn-evolution-message.c build/src/mn-evolution-message.c
--- build/src/mn-evolution-message.c 2008-05-22 19:47:51.000000000 +0400
+++ build/src/mn-evolution-message.c 2010-05-04 18:13:31.000000000 +0400
@@ -25,7 +25,7 @@
#line 24 "src/mn-evolution-message.gob"
#include <glib/gi18n.h>
-#include <camel/camel-folder-summary.h>
+#include <camel/camel.h>
#include "mn-evolution-mailbox.h"
#include "mn-message-private.h"
#include "mn-evolution-client.h"
diff -Nrbu build/src/mn-evolution-server.c build/src/mn-evolution-server.c
--- build/src/mn-evolution-server.c 2010-05-04 18:12:56.000000000 +0400
+++ build/src/mn-evolution-server.c 2010-05-04 18:13:39.000000000 +0400
@@ -28,7 +28,7 @@
#include <libintl.h>
#include <gobject/gvaluecollector.h>
#include <libedataserver/eds-version.h>
-#include <camel/camel-folder.h>
+#include <camel/camel.h>
#if EDS_CHECK_VERSION(2,29,0)
#include <shell/e-shell.h>
#include <mail/e-mail-browser.h>
diff -Nrbu src/mn-evolution-plugin.c src/mn-evolution-plugin.c
--- src/mn-evolution-plugin.c 2010-05-04 18:12:56.000000000 +0400
+++ src/mn-evolution-plugin.c 2010-05-04 18:13:20.000000000 +0400
@@ -24,7 +24,7 @@
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <dbus/dbus-glib-bindings.h>
-#include <camel/camel-folder.h>
+#include <camel/camel.h>
#include <mail/em-event.h>
#include <mail/mail-tools.h>
#include "mn-evolution.h"

View file

@ -0,0 +1,11 @@
diff -Nrbu build/src/mn-shell.c build/src/mn-shell.c
--- build/src/mn-shell.c 2008-05-22 19:47:49.000000000 +0400
+++ build/src/mn-shell.c 2010-05-24 19:39:48.000000000 +0400
@@ -1008,6 +1008,7 @@
Self *self = user_data;
/* The Notification Area applet has been terminated. Recreate the icon. */
+ mn_remove_weak_pointer(&self->icon);
self_init_icon(self);
}}
#line 1014 "mn-shell.c"

View file

@ -0,0 +1,45 @@
diff -Nrbu build/src/mn-popup.c build/src/mn-popup.c
--- build/src/mn-popup.c 2008-05-22 19:47:49.000000000 +0400
+++ build/src/mn-popup.c 2010-10-11 17:42:32.000000000 +0400
@@ -177,6 +177,29 @@
#undef __GOB_FUNCTION__
static void
+mn_popup_wait_for_icon_to_become_ready (void)
+{
+ int x, y;
+ int count = 0;
+
+ /* When the tray icon is created, it can still take some time before
+ * it has arrived at the correct position. This is especially the case
+ * on KDE environments. To work around this, add a little delay of at
+ * most 2 seconds before showing a popup which is attached to the notification */
+ do {
+ gdk_window_get_origin (gtk_widget_get_window (mn_shell->icon), &x, &y);
+
+ if (x != 0 || y != 0) {
+ break;
+ }
+
+ g_usleep(G_USEC_PER_SEC / 10);
+ count++;
+ } while (count < 20);
+}
+
+
+static void
mn_popup_init (MNPopup * o G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "MN:Popup::init"
@@ -299,8 +322,10 @@
"icon-name", "stock_mail",
NULL);
- if (mn_conf_get_enum_value(MN_TYPE_POPUP_POSITION, MN_CONF_POPUPS_POSITION) == MN_POPUP_POSITION_ATTACHED)
+ if (mn_conf_get_enum_value(MN_TYPE_POPUP_POSITION, MN_CONF_POPUPS_POSITION) == MN_POPUP_POSITION_ATTACHED) {
+ mn_popup_wait_for_icon_to_become_ready();
g_object_set(self, "attach-widget", mn_shell->icon, NULL);
+ }
g_string_free(body, TRUE);

View file

@ -0,0 +1,72 @@
diff -Nrbu build/src/mn-shell.c build/src/mn-shell.c
--- build/src/mn-shell.c 2010-10-11 17:45:23.000000000 +0400
+++ build/src/mn-shell.c 2010-10-11 17:45:48.000000000 +0400
@@ -313,6 +313,29 @@
#undef __GOB_FUNCTION__
static void
+mn_shell_init_icon_base (MNShell * self)
+{
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (MN_IS_SHELL (self));
+
+ self->icon = MN_MAIL_ICON(mn_mail_icon_new());
+ mn_add_weak_pointer(&self->icon);
+
+ g_object_connect(self->icon,
+ "signal::activate", self_icon_activate_h, self,
+ "signal::activate-mail-reader", self_icon_activate_mail_reader_h, self,
+ "signal::activate-open-latest-message", self_icon_activate_open_latest_message_h, self,
+ "swapped-signal::activate-consider-new-mail-as-read", self_consider_new_mail_as_read, self,
+ "swapped-signal::activate-update", self_update, self,
+ "signal::activate-properties", self_icon_activate_properties_h, self,
+ "signal::activate-help", self_icon_activate_help_h, self,
+ "signal::activate-about", self_icon_activate_about_h, self,
+ "swapped-signal::activate-remove", self_quit, self,
+ "signal::destroy", self_icon_destroy_h, self,
+ NULL);
+}
+
+static void
mn_shell_init (MNShell * o G_GNUC_UNUSED)
{
#define __GOB_FUNCTION__ "MN:Shell::init"
@@ -793,22 +816,7 @@
{
#line 360 "src/mn-shell.gob"
- self->icon = MN_MAIL_ICON(mn_mail_icon_new());
- mn_add_weak_pointer(&self->icon);
-
- g_object_connect(self->icon,
- "signal::activate", self_icon_activate_h, self,
- "signal::activate-mail-reader", self_icon_activate_mail_reader_h, self,
- "signal::activate-open-latest-message", self_icon_activate_open_latest_message_h, self,
- "swapped-signal::activate-consider-new-mail-as-read", self_consider_new_mail_as_read, self,
- "swapped-signal::activate-update", self_update, self,
- "signal::activate-properties", self_icon_activate_properties_h, self,
- "signal::activate-help", self_icon_activate_help_h, self,
- "signal::activate-about", self_icon_activate_about_h, self,
- "swapped-signal::activate-remove", self_quit, self,
- "signal::destroy", self_icon_destroy_h, self,
- NULL);
-
+ mn_shell_init_icon_base(self);
self_update_sensitivity(self);
self_update_tooltip(self);
self_update_icon(self);
@@ -1094,7 +1102,13 @@
}
else
{
- gtk_widget_hide(GTK_WIDGET(self->icon));
+ /* Re-create the icon as a regular gtk_widget_hide causes the
+ * icon to remain visible on non-GNOME environments. We can't
+ * use the callback self_icon_destroy_h here as it can cause an
+ * endless recursion */
+ g_signal_handlers_disconnect_by_func(self->icon, self_icon_destroy_h, self);
+ gtk_widget_destroy(GTK_WIDGET(self->icon));
+ mn_shell_init_icon_base(self);
mn_mail_icon_set_blinking(self->icon, FALSE);
}
}}