- Switch to python3 and fix build

- Unbreak mail/claws-mail-python

Submitted by:	mmokhi
Sponsored by:	Netzkommune GmbH
Differential Revision:	https://reviews.freebsd.org/D18800
This commit is contained in:
Jochen Neumeister 2019-01-10 08:35:25 +00:00
parent cade964ec2
commit c2d46dcf7f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=489852
10 changed files with 111 additions and 6 deletions

View file

@ -2,12 +2,10 @@
# $FreeBSD$
PORTNAME= python
PORTREVISION= 0
PORTREVISION= 1
COMMENT= Python scripting plugin for Claws Mail
BROKEN= fails to stage
USE_GNOME= pygtk2
CLAWS_PLUGINS_BUILD= python

View file

@ -2,6 +2,7 @@
# $FreeBSD$
PORTNAME= claws-mail
PORTREVISION= 1
CATEGORIES= mail news ipv6
COMMENT= Lightweight and featureful GTK+ based e-mail and news client
@ -20,8 +21,8 @@ LIB_DEPENDS= libcurl.so:ftp/curl \
libnettle.so:security/nettle
RUN_DEPENDS= mime-support>0:misc/mime-support
USES= compiler:c++11-lang cpe desktop-file-utils gnome pathfix \
python:2.7 shebangfix ssl
USES= autoreconf gettext-tools compiler:c++11-lang cpe desktop-file-utils gettext gnome pathfix \
python:3.6 shebangfix ssl
USE_XORG= ice sm
USE_GNOME= cairo gtk20 librsvg2
SHEBANG_FILES= tools/*.pl tools/*.py tools/tb2claws-mail

View file

@ -8,7 +8,7 @@ MAINTAINER= joneum@FreeBSD.org
LICENSE= GPLv3
USES+= gettext-runtime gmake iconv libtool pkgconfig tar:xz
USES+= autoreconf gettext-tools gmake iconv libtool pkgconfig tar:xz
GNU_CONFIGURE= yes
CONFIGURE_ARGS= ${ICONV_CONFIGURE_ARG} --disable-dbus --disable-static

View file

@ -0,0 +1,20 @@
--- configure.ac.orig 2019-01-08 23:08:21 UTC
+++ configure.ac
@@ -1268,7 +1268,7 @@ fi
dnl Python *********************************************************************
AM_PATH_PYTHON([2.5], [
- AC_PATH_PROG(PYTHON_CONFIG, python$PYTHON_VERSION-config)
+ AC_PATH_PROG(PYTHON_CONFIG, python"$PYTHON_VERSION"m-config)
if test x"$PYTHON_CONFIG" = x"" ; then
AC_PATH_PROG(PYTHON_CONFIG, python-config)
fi
@@ -1286,7 +1286,7 @@ AM_PATH_PYTHON([2.5], [
_save_libs="$LIBS"
if test x"$platform_win32" = xno; then
# libpython.so
- PYTHON_SHARED_LIB="libpython${PYTHON_VERSION}.so"
+ PYTHON_SHARED_LIB="libpython${PYTHON_VERSION}m.so"
AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl"])
AC_MSG_CHECKING([whether to dlopen $PYTHON_SHARED_LIB works])
AC_RUN_IFELSE(

View file

@ -0,0 +1,22 @@
--- src/plugins/python/accounttype.c.orig 2018-09-10 13:00:33 UTC
+++ src/plugins/python/accounttype.c
@@ -24,6 +24,10 @@
#include <structmember.h>
+#if PY_MAJOR_VERSION == 3
+typedef int (*cmpfunc)(PyObject *, PyObject *);
+#endif
+
typedef struct {
PyObject_HEAD
PrefsAccount *account;
@@ -38,7 +42,7 @@ static int Account_init(clawsmail_Accoun
static void Account_dealloc(clawsmail_AccountObject* self)
{
- self->ob_type->tp_free((PyObject*)self);
+ Py_TYPE(self)->tp_free((PyObject*)self);
}
static int Account_compare(clawsmail_AccountObject *obj1, clawsmail_AccountObject *obj2)

View file

@ -0,0 +1,20 @@
--- src/plugins/python/composewindowtype.c.orig 2019-01-09 18:38:06 UTC
+++ src/plugins/python/composewindowtype.c
@@ -54,7 +54,7 @@ static void ComposeWindow_dealloc(clawsm
Py_XDECREF(self->text);
Py_XDECREF(self->replyinfo);
Py_XDECREF(self->fwdinfo);
- self->ob_type->tp_free((PyObject*)self);
+ Py_TYPE(self)->tp_free((PyObject*)self);
}
static void flush_gtk_queue(void)
@@ -345,7 +345,7 @@ static PyObject* ComposeWindow_set_heade
headerfield = PyTuple_GetItem(element, 0);
headercontent = PyTuple_GetItem(element, 1);
if(!headerfield || !headercontent
- || !PyObject_TypeCheck(headerfield, &PyString_Type) || !PyObject_TypeCheck(headercontent, &PyString_Type)) {
+ || !PyObject_TypeCheck(headerfield, &PyBytes_Type) || !PyObject_TypeCheck(headercontent, &PyBytes_Type)) {
PyErr_SetString(PyExc_LookupError, "Argument to set_header_list() must be a list of tuples with two strings");
return NULL;
}

View file

@ -0,0 +1,11 @@
--- src/plugins/python/folderpropertiestype.c.orig 2019-01-09 18:47:36 UTC
+++ src/plugins/python/folderpropertiestype.c
@@ -38,7 +38,7 @@ static int FolderProperties_init(clawsma
static void FolderProperties_dealloc(clawsmail_FolderPropertiesObject* self)
{
- self->ob_type->tp_free((PyObject*)self);
+ Py_TYPE(self)->tp_free((PyObject*)self);
}
static PyObject* get_default_account(clawsmail_FolderPropertiesObject *self, void *closure)

View file

@ -0,0 +1,11 @@
--- src/plugins/python/foldertype.c.orig 2019-01-09 18:47:36 UTC
+++ src/plugins/python/foldertype.c
@@ -40,7 +40,7 @@ typedef struct {
static void Folder_dealloc(clawsmail_FolderObject* self)
{
Py_XDECREF(self->properties);
- self->ob_type->tp_free((PyObject*)self);
+ Py_TYPE(self)->tp_free((PyObject*)self);
}
static int Folder_init(clawsmail_FolderObject *self, PyObject *args, PyObject *kwds)

View file

@ -0,0 +1,11 @@
--- src/plugins/python/mailboxtype.c.orig 2019-01-09 18:47:36 UTC
+++ src/plugins/python/mailboxtype.c
@@ -41,7 +41,7 @@ static int Mailbox_init(clawsmail_Mailbo
static void Mailbox_dealloc(clawsmail_MailboxObject* self)
{
self->folder = NULL;
- self->ob_type->tp_free((PyObject*)self);
+ Py_TYPE(self)->tp_free((PyObject*)self);
}
static PyObject* Mailbox_str(clawsmail_MailboxObject *self)

View file

@ -0,0 +1,11 @@
--- src/plugins/python/messageinfotype.c.orig 2019-01-09 18:47:36 UTC
+++ src/plugins/python/messageinfotype.c
@@ -43,7 +43,7 @@ typedef struct {
static void MessageInfo_dealloc(clawsmail_MessageInfoObject* self)
{
- self->ob_type->tp_free((PyObject*)self);
+ Py_TYPE(self)->tp_free((PyObject*)self);
}
static int MessageInfo_init(clawsmail_MessageInfoObject *self, PyObject *args, PyObject *kwds)