ports/133996: [PATCH] mail/gnome-gmail-notifier: migrate to devel/libsoup
Alexander Logvinov
ports at logvinov.com
Sat Apr 25 12:30:09 UTC 2009
>Number: 133996
>Category: ports
>Synopsis: [PATCH] mail/gnome-gmail-notifier: migrate to devel/libsoup
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Sat Apr 25 12:30:08 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Alexander Logvinov
>Release: FreeBSD 6.4-RELEASE i386
>Organization:
>Environment:
>Description:
Use libsoup 2.4.
Obtained from http://code.google.com/p/gnome-gmail-notifier/issues/detail?id=31
>How-To-Repeat:
>Fix:
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/mail/gnome-gmail-notifier/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- Makefile 6 Jun 2008 13:42:51 -0000 1.9
+++ Makefile 25 Apr 2009 12:20:40 -0000
@@ -7,7 +7,7 @@
PORTNAME= gnome-gmail-notifier
PORTVERSION= 0.9.4
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= mail deskutils
MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE}
@@ -15,7 +15,7 @@
COMMENT= A Gmail Inbox Monitor for the GNOME2 desktop
LIB_PC_DEPENDS= libnotify:devel/libnotify \
- libsoup-2.2:devel/libsoup22 \
+ libsoup-2.4:devel/libsoup \
gnome-keyring-1:security/gnome-keyring
BUILD_DEPENDS= ${LIB_PC_DEPENDS:C|^|${LOCALBASE}/libdata/pkgconfig/|:C|:|.pc:${PORTSDIR}/|}
Index: files/patch-configure
===================================================================
RCS file: files/patch-configure
diff -N files/patch-configure
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/patch-configure 25 Apr 2009 12:20:40 -0000
@@ -0,0 +1,61 @@
+--- configure.orig 2009-04-25 16:28:06.000000000 +1000
++++ configure 2009-04-25 16:28:52.000000000 +1000
+@@ -6639,12 +6639,12 @@
+ pkg_cv_libsoup_CFLAGS="$libsoup_CFLAGS"
+ else
+ if test -n "$PKG_CONFIG" && \
+- { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.2 >= \$LIBSOUP_REQUIRED\"") >&5
+- ($PKG_CONFIG --exists --print-errors "libsoup-2.2 >= $LIBSOUP_REQUIRED") 2>&5
++ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= \$LIBSOUP_REQUIRED\"") >&5
++ ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= $LIBSOUP_REQUIRED") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+- pkg_cv_libsoup_CFLAGS=`$PKG_CONFIG --cflags "libsoup-2.2 >= $LIBSOUP_REQUIRED" 2>/dev/null`
++ pkg_cv_libsoup_CFLAGS=`$PKG_CONFIG --cflags "libsoup-2.4 >= $LIBSOUP_REQUIRED" 2>/dev/null`
+ else
+ pkg_failed=yes
+ fi
+@@ -6657,12 +6657,12 @@
+ pkg_cv_libsoup_LIBS="$libsoup_LIBS"
+ else
+ if test -n "$PKG_CONFIG" && \
+- { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.2 >= \$LIBSOUP_REQUIRED\"") >&5
+- ($PKG_CONFIG --exists --print-errors "libsoup-2.2 >= $LIBSOUP_REQUIRED") 2>&5
++ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= \$LIBSOUP_REQUIRED\"") >&5
++ ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= $LIBSOUP_REQUIRED") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+- pkg_cv_libsoup_LIBS=`$PKG_CONFIG --libs "libsoup-2.2 >= $LIBSOUP_REQUIRED" 2>/dev/null`
++ pkg_cv_libsoup_LIBS=`$PKG_CONFIG --libs "libsoup-2.4 >= $LIBSOUP_REQUIRED" 2>/dev/null`
+ else
+ pkg_failed=yes
+ fi
+@@ -6681,14 +6681,14 @@
+ _pkg_short_errors_supported=no
+ fi
+ if test $_pkg_short_errors_supported = yes; then
+- libsoup_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libsoup-2.2 >= $LIBSOUP_REQUIRED"`
++ libsoup_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libsoup-2.4 >= $LIBSOUP_REQUIRED"`
+ else
+- libsoup_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libsoup-2.2 >= $LIBSOUP_REQUIRED"`
++ libsoup_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libsoup-2.4 >= $LIBSOUP_REQUIRED"`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$libsoup_PKG_ERRORS" >&5
+
+- { { echo "$as_me:$LINENO: error: Package requirements (libsoup-2.2 >= $LIBSOUP_REQUIRED) were not met:
++ { { echo "$as_me:$LINENO: error: Package requirements (libsoup-2.4 >= $LIBSOUP_REQUIRED) were not met:
+
+ $libsoup_PKG_ERRORS
+
+@@ -6699,7 +6699,7 @@
+ and libsoup_LIBS to avoid the need to call pkg-config.
+ See the pkg-config man page for more details.
+ " >&5
+-echo "$as_me: error: Package requirements (libsoup-2.2 >= $LIBSOUP_REQUIRED) were not met:
++echo "$as_me: error: Package requirements (libsoup-2.4 >= $LIBSOUP_REQUIRED) were not met:
+
+ $libsoup_PKG_ERRORS
+
Index: files/patch-src_ggn-atom-feed.c
===================================================================
RCS file: files/patch-src_ggn-atom-feed.c
diff -N files/patch-src_ggn-atom-feed.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ files/patch-src_ggn-atom-feed.c 25 Apr 2009 12:20:40 -0000
@@ -0,0 +1,93 @@
+--- src/ggn-atom-feed.c.orig 2008-01-11 00:41:24.000000000 +0900
++++ src/ggn-atom-feed.c 2009-04-25 16:24:07.000000000 +1000
+@@ -75,7 +75,7 @@
+ /* the libsoup session and proxy. */
+ SoupSession* session;
+ SoupMessage* message;
+- SoupUri* proxy;
++ SoupURI* proxy;
+
+ /* the username and password. */
+ gchar* name;
+@@ -129,25 +129,17 @@
+ */
+ static gboolean ggn_atom_feed_auth (SoupSession* session,
+ SoupMessage* message,
+- gchar* auth_type,
+- gchar* auth_realm,
+- gchar** username,
+- gchar** password,
++ SoupAuth* auth,
++ gboolean retrying,
+ gpointer data) {
+ /* the userdata is the gobject. */
+ GgnAtomFeed* feed = GGN_ATOM_FEED (data);
+
+- /* see if we can set the username. */
+- if (feed->priv->user != NULL) {
+- /* set the username. */
+- *username = g_strdup (feed->priv->user);
+- }
+-
+- /* see if we can set the password. */
+- if (feed->priv->pass != NULL) {
+- /* set the username. */
+- *password = g_strdup (feed->priv->pass);
++ /* see if we can set the username and password. */
++ if (feed->priv->user != NULL && feed->priv->pass != NULL) {
++ soup_auth_authenticate (auth, g_strdup (feed->priv->user), g_strdup (feed->priv->pass));
+ }
++
+
+ /* exit our function. */
+ return TRUE;
+@@ -299,7 +291,7 @@
+ g_signal_connect (G_OBJECT (self->priv->session),
+ "authenticate",
+ G_CALLBACK (ggn_atom_feed_auth),
+- (gpointer) self);
++ self);
+
+ /* setup the parser object. */
+ self->priv->parser = ggn_xml_parser_new ();
+@@ -495,12 +487,14 @@
+ feed->priv->proxy = soup_uri_new (feed->priv->prox);
+
+ /* refresh the proxy-uri property of the session */
+- GValue val = {0,};
+- g_value_init (&val, G_TYPE_POINTER);
+- g_value_set_pointer (&val, feed->priv->proxy);
+- g_object_set_property (G_OBJECT (feed->priv->session),
+- SOUP_SESSION_PROXY_URI,
+- &val);
++ if (feed->priv->proxy != NULL) {
++ GValue val = {0,};
++ g_value_init (&val, G_TYPE_POINTER);
++ g_value_set_pointer (&val, feed->priv->proxy);
++ g_object_set_property (G_OBJECT (feed->priv->session),
++ SOUP_SESSION_PROXY_URI,
++ &val);
++ }
+ }
+
+ /*
+@@ -679,7 +673,9 @@
+ /* check the return value. */
+ if (retval == 200) {
+ /* we got the feed. */
+- gchar* body = g_strdup (self->priv->message->response.body);
++ SoupMessageBody* msgbody = self->priv->message->response_body;
++ soup_message_body_flatten (msgbody);
++ gchar* body = g_strdup (msgbody->data);
+
+ /* see if we must free the message array. */
+ if (self->priv->box.msgs != NULL) {
+@@ -712,7 +708,7 @@
+ }
+
+ /* close all open and unused connections. */
+- soup_session_try_prune_connection (self->priv->session);
++ soup_session_abort (self->priv->session);
+
+ /* emit the "updated" signal. */
+ g_signal_emit (feed, signals[UPDATED], 0, status);
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list