/soc/2013/ankitkv/gobjectification: 581adbabe319: Merged default...

Ankit Vani a at nevitus.org
Mon Feb 17 11:27:44 EST 2014


Changeset: 581adbabe3191e203034582e5511cc92f7bfb6e3
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-02-17 21:57 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/581adbabe319

Description:

Merged default branch

diffstat:

 .hgignore                                                                         |   1 +
 ChangeLog                                                                         |   3 +
 Makefile.am                                                                       |   5 +-
 configure.ac                                                                      |  24 ++-------
 finch/gntxfer.c                                                                   |  10 +--
 finch/libgnt/gntwm.c                                                              |  17 ++++++-
 libpurple/protocols/gg/lib/common.c                                               |   2 +-
 libpurple/protocols/gg/lib/config.h                                               |   2 +-
 libpurple/protocols/gg/lib/libgadu.c                                              |   5 +-
 libpurple/protocols/gg/lib/message.h                                              |  10 ++-
 libpurple/protocols/gg/lib/protocol.h                                             |  10 ++--
 libpurple/protocols/zephyr/zephyr.c                                               |   1 -
 libpurple/xfer.c                                                                  |   2 +-
 libpurple/xfer.h                                                                  |   4 +-
 pidgin/win32/nsis/pidgin-installer.nsi                                            |   6 +-
 share/ca-certs/Makefile.am                                                        |   6 +-
 share/ca-certs/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G2.pem   |   0 
 share/ca-certs/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5_2.pem |   0 
 share/ca-certs/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem   |   0 
 19 files changed, 60 insertions(+), 48 deletions(-)

diffs (truncated from 315 to 300 lines):

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -109,6 +109,7 @@ pidgin-*.*.*-win32-bin.zip$
 pidgin-*.*.*-win32bin$
 pidgin-.*.tar.bz2
 pidgin-.*.tar.gz
+pidgin-[0-9a-z.-]+/
 pidgin.apspec$
 pidgin.desktop$
 pidgin.desktop.in$
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -81,6 +81,9 @@ version 3.0.0 (??/??/????):
 	  non-native plugin support.
 	* Doxygen has been replaced by gtk-doc for generating documentation.
 
+	Finch:
+	* Fix build against Python 3. (Ed Catmur) (#15969)
+
 version 2.10.9 (2/2/2014):
 	XMPP:
 	* Fix problems logging into some servers including jabber.org and
diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -126,9 +126,10 @@ SUBDIRS = . m4macros libpurple $(GNT_DIR
 
 # perl's MakeMaker uninstall foo doesn't work well with DESTDIR set, which
 # breaks "make distcheck" unless we ignore perl things
+# TODO drop it when we drop perl wrapper
 
 distuninstallcheck_listfiles = \
-	find . -type f -print | grep -v perl | grep -v Purple.3pm
+	find . -type f -print | grep -v perl | grep -v Purple.3pm | grep -v Pidgin.3pm
 
 DISTCLEANFILES= $(DESKTOP_FILE) libpurple/gconf/purple.schemas intltool-extract \
-			intltool-merge intltool-update
+			intltool-merge intltool-update package_revision_raw.txt
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -645,7 +645,7 @@ Use --disable-gtkspell if you do not nee
 		else
 			if test "x$force_deps" = "xyes" ; then
 				AC_MSG_ERROR([
-Evolution development headers not found.
+Evolution development headers not found (libebook, libedata-book, evolution-data-server >= 3.6).
 Use --disable-gevolution if you do not need it.
 ])
 			fi
@@ -1894,27 +1894,15 @@ dnl Check for Python headers (currently 
 dnl (Thanks to XChat)
 if test "x$enable_consoleui" = "xyes" -a ! -z "$PYTHON" -a x"$PYTHON" != x"no" ; then
 	AC_MSG_CHECKING(for Python compile flags)
-	PY_PREFIX=`$PYTHON -c 'import sys ; sys.stdout.write(sys.prefix)'`
-	PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; sys.stdout.write(sys.exec_prefix)'`
-	changequote(<<, >>)dnl
-	PY_VERSION=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:3])'`
-	PY_MAJOR=`$PYTHON -c 'import sys ; sys.stdout.write(sys.version[0:2])'`
-	changequote([, ])dnl
-	if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then
-		AC_MSG_RESULT()
-		AC_CHECK_LIB(pthread, pthread_create, )
-		AC_CHECK_LIB(util, openpty, )
-		AC_CHECK_LIB(db, dbopen, )
-		PY_LIBS="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config -lpython$PY_VERSION"
-		PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION"
+	if test -f ${PYTHON}-config; then
+		PY_CFLAGS=`${PYTHON}-config --includes`
+		PY_LIBS=`${PYTHON}-config --libs`
 		AC_DEFINE(USE_PYTHON, [1], [Define if python headers are available.])
-		dnl Because the above AC_CHECK_LIB get in the way...
-		AC_MSG_CHECKING(for Python compile flags)
 		AC_MSG_RESULT(ok)
 	else
-		AC_MSG_RESULT([Can't find Python.h])
+		AC_MSG_RESULT([Cannot find ${PYTHON}-config])
+		PY_CFLAGS=""
 		PY_LIBS=""
-		PY_CFLAGS=""
 	fi
 fi
 AC_SUBST(PY_CFLAGS)
diff --git a/finch/gntxfer.c b/finch/gntxfer.c
--- a/finch/gntxfer.c
+++ b/finch/gntxfer.c
@@ -520,12 +520,10 @@ static PurpleXferUiOps ops =
 	finch_xfer_update_progress,
 	finch_xfer_cancel_local,
 	finch_xfer_cancel_remote,
-
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-	NULL
+	NULL, /* ui_write */
+	NULL, /* ui_read */
+	NULL, /* data_not_sent */
+	NULL  /* add_thumbnail */
 };
 
 /**************************************************************************
diff --git a/finch/libgnt/gntwm.c b/finch/libgnt/gntwm.c
--- a/finch/libgnt/gntwm.c
+++ b/finch/libgnt/gntwm.c
@@ -1277,7 +1277,12 @@ python_script_selected(GntFileSel *fs, c
 {
 	char *dir = g_path_get_dirname(path);
 	FILE *file = fopen(path, "r");
-	PyObject *pp = PySys_GetObject("path"), *dirobj = PyString_FromString(dir);
+	PyObject *pp = PySys_GetObject("path");
+#if PY_MAJOR_VERSION >= 3
+	PyObject *dirobj = PyUnicode_FromString(dir);
+#else
+	PyObject *dirobj = PyString_FromString(dir);
+#endif
 
 	PyList_Insert(pp, 0, dirobj);
 	Py_DECREF(dirobj);
@@ -1568,7 +1573,17 @@ gnt_wm_class_init(GntWMClass *klass)
 	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "run-python", run_python,
 				GNT_KEY_F3, NULL);
 	if (!Py_IsInitialized()) {
+#if PY_MAJOR_VERSION >= 3
+		wchar_t *name;
+		size_t len;
+		len = mbstowcs(NULL, "gnt", 0);
+		name = g_new(wchar_t, len + 1);
+		mbstowcs(name, "gnt", len + 1);
+		Py_SetProgramName(name);
+		g_free(name);
+#else
 		Py_SetProgramName("gnt");
+#endif
 		Py_Initialize();
 		started_python = TRUE;
 	}
diff --git a/libpurple/protocols/gg/lib/common.c b/libpurple/protocols/gg/lib/common.c
--- a/libpurple/protocols/gg/lib/common.c
+++ b/libpurple/protocols/gg/lib/common.c
@@ -751,7 +751,7 @@ int gg_chat_update(struct gg_session *se
 	gg_chat_list_t *chat;
 	uin_t *participants_new;
 
-	if (participants_count >= ~0 / sizeof(uin_t))
+	if (participants_count >= ~(unsigned int)0 / sizeof(uin_t))
 		return -1;
 
 	chat = gg_chat_find(sess, id);
diff --git a/libpurple/protocols/gg/lib/config.h b/libpurple/protocols/gg/lib/config.h
--- a/libpurple/protocols/gg/lib/config.h
+++ b/libpurple/protocols/gg/lib/config.h
@@ -5,7 +5,7 @@
 /* libpurple's config */
 #include <config.h>
 
-#define GG_LIBGADU_VERSION "1.12.0-rc2"
+#define GG_LIBGADU_VERSION "1.12.0-dev"
 
 /* Defined if libgadu was compiled for bigendian machine. */
 #undef GG_CONFIG_BIGENDIAN
diff --git a/libpurple/protocols/gg/lib/libgadu.c b/libpurple/protocols/gg/lib/libgadu.c
--- a/libpurple/protocols/gg/lib/libgadu.c
+++ b/libpurple/protocols/gg/lib/libgadu.c
@@ -2550,8 +2550,11 @@ int gg_chat_invite(struct gg_session *gs
 	if (!gg_required_proto(gs, GG_PROTOCOL_VERSION_110))
 		return -1;
 
-	if (participants_count == 0 || participants_count >= ~0 / sizeof(struct gg_chat_participant))
+	if (participants_count == 0 || participants_count >=
+		~(unsigned int)0 / sizeof(struct gg_chat_participant))
+	{
 		return -1;
+	}
 
 	participants_list_size = sizeof(struct gg_chat_participant) *
 		participants_count;
diff --git a/libpurple/protocols/gg/lib/message.h b/libpurple/protocols/gg/lib/message.h
--- a/libpurple/protocols/gg/lib/message.h
+++ b/libpurple/protocols/gg/lib/message.h
@@ -45,12 +45,16 @@ struct gg_message {
 		return (result); \
 	}
 
-int gg_message_init(gg_message_t *gm, int msgclass, int seq, uin_t *recipients, size_t recipient_count, char *text, char *xhtml, char *attributes, size_t attributes_length, int auto_convert);
+int gg_message_init(gg_message_t *gm, int msgclass, int seq, uin_t *recipients,
+	size_t recipient_count, char *text, char *xhtml, char *attributes,
+	size_t attributes_length, int auto_convert);
 
 #endif
 
-size_t gg_message_html_to_text(char *dst, unsigned char *format, size_t *format_len, const char *html, gg_encoding_t encoding);
-size_t gg_message_text_to_html(char *dst, const char *src, gg_encoding_t encoding, const unsigned char *format, size_t format_len);
+size_t gg_message_html_to_text(char *dst, unsigned char *format,
+	size_t *format_len, const char *html, gg_encoding_t encoding);
+size_t gg_message_text_to_html(char *dst, const char *src,
+	gg_encoding_t encoding, const unsigned char *format, size_t format_len);
 
 char * gg_message_html_to_text_110(const char *html);
 char * gg_message_text_to_html_110(const char *text, ssize_t text_len);
diff --git a/libpurple/protocols/gg/lib/protocol.h b/libpurple/protocols/gg/lib/protocol.h
--- a/libpurple/protocols/gg/lib/protocol.h
+++ b/libpurple/protocols/gg/lib/protocol.h
@@ -40,7 +40,7 @@
 #undef GG_FEATURE_STATUS80
 #define GG_FEATURE_STATUS80BETA		0x01
 #define GG_FEATURE_MSG80		0x02
-#define GG_FEATURE_STATUS80 		0x05
+#define GG_FEATURE_STATUS80		0x05
 
 #define GG_DEFAULT_HOST_WHITE_LIST { "gadu-gadu.pl", "gg.pl", NULL }
 
@@ -224,8 +224,8 @@ struct gg_dcc7_aborted {
 
 struct gg_dcc7_voice_auth {
 	uint8_t type;			/* 0x00 -> wysylanie ID
-					   0x01 -> potwierdzenie ID
-					*/
+					 * 0x01 -> potwierdzenie ID
+					 */
 	gg_dcc7_id_t id;		/* identyfikator poÅ‚Ä
czenia */
 	uint32_t reserved1;		/* GG_DCC7_RESERVED1 */
 	uint32_t reserved2;		/* GG_DCC7_RESERVED2 */
@@ -270,8 +270,8 @@ struct gg_dcc7_voice_init_confirm {
 struct gg_dcc7_relay_req {
 	uint32_t magic;			/* 0x0a */
 	uint32_t len;			/* długość całego pakietu */
-	gg_dcc7_id_t id;   		/* identyfikator poÅ‚Ä
czenia */
-	uint16_t type;   		/* typ zapytania */
+	gg_dcc7_id_t id;		/* identyfikator poÅ‚Ä
czenia */
+	uint16_t type;			/* typ zapytania */
 	uint16_t dunno1;		/* 0x02 */
 } GG_PACKED;
 
diff --git a/libpurple/protocols/zephyr/zephyr.c b/libpurple/protocols/zephyr/zephyr.c
--- a/libpurple/protocols/zephyr/zephyr.c
+++ b/libpurple/protocols/zephyr/zephyr.c
@@ -842,7 +842,6 @@ static void handle_message(PurpleConnect
 		/* Need to deal with 0 length  messages to handle typing notification (OPCODE) ping messages */
 		/* One field zephyrs would have caused purple to crash */
 		if ( (notice.z_message_len == 0) || (signature_length >= notice.z_message_len - 1)) {
-			/* message has no body */
 			len = 0;
 			purple_debug_info("zephyr","message_size %d %d %d\n",len,notice.z_message_len,signature_length);
 			buf3 = g_strdup("");
diff --git a/libpurple/xfer.c b/libpurple/xfer.c
--- a/libpurple/xfer.c
+++ b/libpurple/xfer.c
@@ -1262,7 +1262,7 @@ purple_xfer_write_file(PurpleXfer *xfer,
 			purple_xfer_cancel_local(xfer);
 			return FALSE;
 		}
-		wc = fwrite(buffer, size, 1, priv->dest_fp);
+		wc = fwrite(buffer, 1, size, priv->dest_fp);
 	}
 
 	if (wc != size) {
diff --git a/libpurple/xfer.h b/libpurple/xfer.h
--- a/libpurple/xfer.h
+++ b/libpurple/xfer.h
@@ -525,8 +525,8 @@ void purple_xfer_set_local_port(PurpleXf
  * purple_xfer_set_bytes_sent:
  * @xfer:       The file transfer.
  * @bytes_sent: The new current position in the file.  If we're
- *                   sending a file then this is the byte that we will
- *                   send.  If we're receiving a file, this is the
+ *                   sending a file then this is the next byte that we
+ *                   will send.  If we're receiving a file, this is the
  *                   next byte that we expect to receive.
  *
  * Sets the current working position in the active file transfer.  This
diff --git a/pidgin/win32/nsis/pidgin-installer.nsi b/pidgin/win32/nsis/pidgin-installer.nsi
--- a/pidgin/win32/nsis/pidgin-installer.nsi
+++ b/pidgin/win32/nsis/pidgin-installer.nsi
@@ -550,9 +550,9 @@ Section Uninstall
     Delete "$INSTDIR\ca-certs\ValiCert_Class_2_VA.pem"
     Delete "$INSTDIR\ca-certs\VeriSign_Class3_Extended_Validation_CA.pem"
     Delete "$INSTDIR\ca-certs\Verisign_Class3_Primary_CA.pem"
-    Delete "$INSTDIR\ca-certs\VeriSign_Class_3_Public_Primary_Certification_Authority_-_G2.pem"
-    Delete "$INSTDIR\ca-certs\VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem"
-    Delete "$INSTDIR\ca-certs\VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5_2.pem"
+    Delete "$INSTDIR\ca-certs\VeriSign_Class_3_Primary_CA-G2.pem"
+    Delete "$INSTDIR\ca-certs\VeriSign_Class_3_Primary_CA-G5.pem"
+    Delete "$INSTDIR\ca-certs\VeriSign_Class_3_Primary_CA-G5-2.pem"
     Delete "$INSTDIR\ca-certs\VeriSign_International_Server_Class_3_CA.pem"
     Delete "$INSTDIR\ca-certs\Verisign_RSA_Secure_Server_CA.pem"
     RMDir "$INSTDIR\ca-certs"
diff --git a/share/ca-certs/Makefile.am b/share/ca-certs/Makefile.am
--- a/share/ca-certs/Makefile.am
+++ b/share/ca-certs/Makefile.am
@@ -17,9 +17,9 @@ CERTIFICATES = \
 		Thawte_Primary_Root_CA.pem \
 		ValiCert_Class_2_VA.pem \
 		Verisign_Class3_Primary_CA.pem \
-		VeriSign_Class_3_Public_Primary_Certification_Authority_-_G2.pem \
-		VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem \
-		VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5_2.pem



More information about the Commits mailing list