/pidgin/main: 65e581a04a06: Merge GSoC 2012 Gadu-Gadu branch

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Tue Aug 21 13:17:15 EDT 2012


Changeset: 65e581a04a0613d54407c206d03f43559b8ece07
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2012-08-21 19:16 +0200
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/65e581a04a06

Description:

Merge GSoC 2012 Gadu-Gadu branch

diffstat:

 configure.ac                                   |    69 +-
 libpurple/eventloop.c                          |    10 +
 libpurple/eventloop.h                          |    18 +
 libpurple/protocols/gg/Makefile.am             |   102 +-
 libpurple/protocols/gg/Makefile.mingw          |    14 +-
 libpurple/protocols/gg/account.c               |   649 +++++++
 libpurple/protocols/gg/account.h               |    60 +
 libpurple/protocols/gg/avatar.c                |   392 ++++
 libpurple/protocols/gg/avatar.h                |    53 +
 libpurple/protocols/gg/buddylist.c             |    23 +-
 libpurple/protocols/gg/buddylist.h             |    10 +
 libpurple/protocols/gg/confer.c                |     2 +-
 libpurple/protocols/gg/deprecated.c            |    62 +
 libpurple/protocols/gg/deprecated.h            |    37 +
 libpurple/protocols/gg/gg-utils.c              |   160 -
 libpurple/protocols/gg/gg-utils.h              |   121 -
 libpurple/protocols/gg/gg.c                    |  2012 +++--------------------
 libpurple/protocols/gg/gg.h                    |    46 +-
 libpurple/protocols/gg/image.c                 |   294 +++
 libpurple/protocols/gg/image.h                 |    66 +
 libpurple/protocols/gg/lib/config.h            |    79 +
 libpurple/protocols/gg/lib/dcc7.c              |     4 +-
 libpurple/protocols/gg/lib/debug.c             |     2 +-
 libpurple/protocols/gg/lib/debug.h             |    29 +
 libpurple/protocols/gg/lib/deflate.h           |     2 +-
 libpurple/protocols/gg/lib/encoding.c          |    37 +-
 libpurple/protocols/gg/lib/events.c            |    12 +-
 libpurple/protocols/gg/lib/handlers.c          |     2 +-
 libpurple/protocols/gg/lib/internal.h          |    45 +
 libpurple/protocols/gg/lib/libgadu-config.h    |    70 -
 libpurple/protocols/gg/lib/libgadu-debug.h     |    29 -
 libpurple/protocols/gg/lib/libgadu-internal.h  |    44 -
 libpurple/protocols/gg/lib/libgadu.c           |    42 +-
 libpurple/protocols/gg/lib/libgadu.h           |     2 +-
 libpurple/protocols/gg/lib/obsolete.c          |     2 +-
 libpurple/protocols/gg/lib/pubdir50.c          |     2 +-
 libpurple/protocols/gg/lib/resolver.c          |    12 +-
 libpurple/protocols/gg/libgadu-events.c        |    83 +
 libpurple/protocols/gg/libgadu-events.h        |    39 +
 libpurple/protocols/gg/libgaduw.c              |   141 +
 libpurple/protocols/gg/libgaduw.h              |    58 +
 libpurple/protocols/gg/multilogon.c            |    94 +
 libpurple/protocols/gg/multilogon.h            |    47 +
 libpurple/protocols/gg/oauth/oauth-parameter.c |   159 +
 libpurple/protocols/gg/oauth/oauth-parameter.h |    37 +
 libpurple/protocols/gg/oauth/oauth-purple.c    |   283 +++
 libpurple/protocols/gg/oauth/oauth-purple.h    |    42 +
 libpurple/protocols/gg/oauth/oauth.c           |   145 +
 libpurple/protocols/gg/oauth/oauth.h           |    34 +
 libpurple/protocols/gg/pubdir-prpl.c           |   993 +++++++++++
 libpurple/protocols/gg/pubdir-prpl.h           |    73 +
 libpurple/protocols/gg/purplew.c               |   149 +
 libpurple/protocols/gg/purplew.h               |    78 +
 libpurple/protocols/gg/resolver-purple.c       |   192 ++
 libpurple/protocols/gg/resolver-purple.h       |    38 +
 libpurple/protocols/gg/roster.c                |  1119 +++++++++++++
 libpurple/protocols/gg/roster.h                |    73 +
 libpurple/protocols/gg/search.c                |   219 --
 libpurple/protocols/gg/search.h                |   152 -
 libpurple/protocols/gg/servconn.c              |    96 +
 libpurple/protocols/gg/servconn.h              |    42 +
 libpurple/protocols/gg/status.c                |   470 +++++
 libpurple/protocols/gg/status.h                |    65 +
 libpurple/protocols/gg/utils.c                 |   250 ++
 libpurple/protocols/gg/utils.h                 |    98 +
 libpurple/protocols/gg/validator.c             |    95 +
 libpurple/protocols/gg/validator.h             |    45 +
 libpurple/protocols/gg/win32-resolver.c        |   322 ---
 libpurple/protocols/gg/win32-resolver.h        |    46 -
 libpurple/protocols/gg/xml.c                   |   165 +
 libpurple/protocols/gg/xml.h                   |    48 +
 libpurple/win32/win32dep.c                     |   105 +
 libpurple/win32/win32dep.h                     |     3 +
 73 files changed, 7652 insertions(+), 3061 deletions(-)

diffs (truncated from 11904 to 300 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -816,6 +816,19 @@ AC_SUBST(LIBXML_CFLAGS)
 AC_SUBST(LIBXML_LIBS)
 
 dnl #######################################################################
+dnl # Check for zlib (required)
+dnl #######################################################################
+
+PKG_CHECK_MODULES(ZLIB, [zlib >= 1.2.0], , [
+	AC_MSG_RESULT(no)
+	AC_MSG_ERROR([
+You must have zlib >= 1.2.0 development headers installed to build.
+])])
+
+AC_SUBST(ZLIB_CFLAGS)
+AC_SUBST(ZLIB_LIBS)
+
+dnl #######################################################################
 dnl # GConf schemas
 dnl #######################################################################
 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
@@ -1069,13 +1082,14 @@ AC_ARG_WITH(gadu-includes, [AC_HELP_STRI
 AC_ARG_WITH(gadu-libs, [AC_HELP_STRING([--with-gadu-libs=DIR], [compile the Gadu-Gadu plugin against the libs in DIR])], [ac_gadu_libs="$withval"], [ac_gadu_libs="no"])
 GADU_CFLAGS=""
 GADU_LIBS=""
+GADU_LIBGADU_VERSION=1.11.2
 if test -n "$with_gadu_includes" || test -n "$with_gadu_libs"; then
 	gadu_manual_check="yes"
 else
 	gadu_manual_check="no"
 fi
 if test "x$gadu_manual_check" = "xno"; then
-	PKG_CHECK_MODULES(GADU, [libgadu >= 1.11.0], [
+	PKG_CHECK_MODULES(GADU, [libgadu >= $GADU_LIBGADU_VERSION], [
 		gadu_includes="yes"
 		gadu_libs="yes"
 	], [
@@ -1107,28 +1121,7 @@ if test "x$gadu_libs" = "xyes"; then
 #error "libgadu is not compatible with the GPL when compiled with OpenSSL support."
 #endif
 	]])], [
-		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libgadu.h>]], [[
-#if GG_DEFAULT_PROTOCOL_VERSION < 0x2e
-#error "Your libgadu version is too old. libpurple requires 1.11.0 or higher."
-#endif
-		]])], [
-			AC_MSG_RESULT(yes)
-			AC_DEFINE([HAVE_LIBGADU], [1],
-				[Define to 1 if you have libgadu.])
-		], [
-			AC_MSG_RESULT(no)
-			echo
-			echo
-			echo "Your supplied copy of libgadu is too old."
-			echo "Install version 1.11.0 or newer."
-			echo "Then rerun this ./configure"
-			echo
-			echo "Falling back to using our own copy of libgadu"
-			echo
-			GADU_LIBS=""
-			GADU_CFLAGS=""
-			gadu_libs=no
-		])
+		AC_MSG_RESULT(yes)
 	], [
 		AC_MSG_RESULT(no)
 		echo
@@ -1147,6 +1140,35 @@ if test "x$gadu_libs" = "xyes"; then
 	CPPFLAGS="$CPPFLAGS_save"
 fi
 
+if test "x$gadu_libs" = "xyes" -a "x$gadu_manual_check" = "xyes"; then
+	AC_MSG_CHECKING(for supplied libgadu compatibility)
+	CPPFLAGS_save="$CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $GADU_CFLAGS"
+
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libgadu.h>]], [[
+#if GG_DEFAULT_PROTOCOL_VERSION < 0x2e
+#error "Your libgadu version is too old."
+#endif
+	]])], [
+		AC_MSG_RESULT(yes)
+	], [
+		AC_MSG_RESULT(no)
+		echo
+		echo "Your supplied copy of libgadu is too old."
+		echo "Install version $GADU_LIBGADU_VERSION or newer."
+		echo "Then rerun this ./configure"
+		echo
+		echo "Falling back to using our own copy of libgadu"
+		echo
+		GADU_LIBS=""
+		GADU_CFLAGS=""
+		gadu_libs=no
+	])
+
+	CPPFLAGS="$CPPFLAGS_save"
+fi
+
+AM_CONDITIONAL(HAVE_LIBGADU, test "x$gadu_libs" = "xyes")
 AM_CONDITIONAL(USE_INTERNAL_LIBGADU, test "x$gadu_libs" != "xyes")
 
 if test "x$gadu_libs" = "x"; then
@@ -1155,6 +1177,7 @@ fi
 
 AC_SUBST(GADU_LIBS)
 AC_SUBST(GADU_CFLAGS)
+AC_SUBST(GADU_LIBGADU_VERSION)
 
 AC_ARG_ENABLE(distrib,,,enable_distrib=no)
 AM_CONDITIONAL(DISTRIB, test "x$enable_distrib" = "xyes")
diff --git a/libpurple/eventloop.c b/libpurple/eventloop.c
--- a/libpurple/eventloop.c
+++ b/libpurple/eventloop.c
@@ -91,6 +91,16 @@ purple_input_get_error(int fd, int *erro
 	}
 }
 
+int
+purple_input_pipe(int pipefd[2])
+{
+#ifdef _WIN32
+	return wpurple_input_pipe(pipefd);
+#else
+	return pipe(pipefd);
+#endif
+}
+
 void
 purple_eventloop_set_ui_ops(PurpleEventLoopUiOps *ops)
 {
diff --git a/libpurple/eventloop.h b/libpurple/eventloop.h
--- a/libpurple/eventloop.h
+++ b/libpurple/eventloop.h
@@ -240,6 +240,24 @@ gboolean purple_input_remove(guint handl
 int
 purple_input_get_error(int fd, int *error);
 
+/**
+ * Creates a pipe - an unidirectional data channel that can be used for
+ * interprocess communication.
+ *
+ * File descriptors for both ends of pipe will be written into provided array.
+ * The first one (pipefd[0]) can be used for reading, the second one (pipefd[1])
+ * for writing.
+ *
+ * On Windows it's simulated by creating a pair of connected sockets, on other
+ * systems pipe() is used.
+ *
+ * @param pipefd Array used to return file descriptors for both ends of pipe.
+ *
+ * @return @c 0 on success, @c -1 on error.
+ */
+int
+purple_input_pipe(int pipefd[2]);
+
 
 /*@}*/
 
diff --git a/libpurple/protocols/gg/Makefile.am b/libpurple/protocols/gg/Makefile.am
--- a/libpurple/protocols/gg/Makefile.am
+++ b/libpurple/protocols/gg/Makefile.am
@@ -1,13 +1,20 @@
+V=0
+
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
+
 EXTRA_DIST = \
 	Makefile.mingw \
-	win32-resolver.c \
-	win32-resolver.h \
+	lib/COPYING
+
+if USE_INTERNAL_LIBGADU
+INTGGSOURCES = \
 	lib/common.c \
 	lib/compat.h \
-	lib/COPYING \
+	lib/config.h \
 	lib/dcc.c \
 	lib/dcc7.c \
 	lib/debug.c \
+	lib/debug.h \
 	lib/deflate.c \
 	lib/deflate.h \
 	lib/encoding.c \
@@ -15,11 +22,9 @@ EXTRA_DIST = \
 	lib/events.c \
 	lib/handlers.c \
 	lib/http.c \
+	lib/internal.h \
+	lib/libgadu.c \
 	lib/libgadu.h \
-	lib/libgadu.c \
-	lib/libgadu-config.h \
-	lib/libgadu-debug.h \
-	lib/libgadu-internal.h \
 	lib/message.c \
 	lib/message.h \
 	lib/obsolete.c \
@@ -31,38 +36,11 @@ EXTRA_DIST = \
 	lib/session.h \
 	lib/sha1.c
 
-pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
-
-if USE_INTERNAL_LIBGADU
-INTGGSOURCES = \
-	lib/common.c \
-	lib/compat.h \
-	lib/dcc.c \
-	lib/dcc7.c \
-	lib/debug.c \
-	lib/deflate.c \
-	lib/deflate.h \
-	lib/encoding.c \
-	lib/encoding.h \
-	lib/events.c \
-	lib/handlers.c \
-	lib/http.c \
-	lib/libgadu.h \
-	lib/libgadu.c \
-	lib/libgadu-config.h \
-	lib/libgadu-internal.h \
-	lib/message.c \
-	lib/message.h \
-	lib/obsolete.c \
-	lib/protocol.h \
-	lib/pubdir.c \
-	lib/pubdir50.c \
-	lib/resolver.c \
-	lib/resolver.h \
-	lib/session.h \
-	lib/sha1.c
-
-INTGG_CFLAGS = -I$(top_srcdir)/libpurple/protocols/gg/lib -DGG_IGNORE_DEPRECATED -DUSE_INTERNAL_LIBGADU
+INTGG_CFLAGS = -I$(top_srcdir)/libpurple/protocols/gg/lib \
+	$(ZLIB_CFLAGS) \
+	-DGG_IGNORE_DEPRECATED \
+	-DGG_INTERNAL_LIBGADU_VERSION=$(GADU_LIBGADU_VERSION)
+GADU_LIBS += $(ZLIB_LIBS)
 endif
 
 if USE_GNUTLS
@@ -72,16 +50,50 @@ endif
 
 GGSOURCES = \
 	$(INTGGSOURCES) \
-	gg-utils.h \
-	gg-utils.c \
+	utils.h \
+	utils.c \
 	confer.h \
 	confer.c \
-	search.h \
-	search.c \
 	buddylist.h \
 	buddylist.c \
 	gg.h \
-	gg.c
+	gg.c \
+	resolver-purple.h \
+	resolver-purple.c \
+	image.h \
+	image.c \
+	account.h \
+	account.c \
+	deprecated.h \
+	deprecated.c \
+	purplew.h \
+	purplew.c \
+	libgaduw.h \
+	libgaduw.c \
+	avatar.h \
+	avatar.c \
+	libgadu-events.h \
+	libgadu-events.c \
+	roster.c \
+	roster.h \
+	validator.c \
+	validator.h \
+	xml.c \
+	xml.h \
+	multilogon.c \
+	multilogon.h \
+	status.c \
+	status.h \
+	servconn.c \
+	servconn.h \
+	pubdir-prpl.c \
+	pubdir-prpl.h \
+	oauth/oauth.c \
+	oauth/oauth.h \
+	oauth/oauth-parameter.c \
+	oauth/oauth-parameter.h \
+	oauth/oauth-purple.c \
+	oauth/oauth-purple.h
 



More information about the Commits mailing list