diff options
author | Carsten Lohrke <carlo@gentoo.org> | 2006-10-22 15:12:11 +0000 |
---|---|---|
committer | Carsten Lohrke <carlo@gentoo.org> | 2006-10-22 15:12:11 +0000 |
commit | 7062de710b51ae8b2e435279dca1d0c03dcaed0c (patch) | |
tree | 812d53807548ce27938c219dfa02220d06143191 /dev-python | |
parent | didn't get committed? (diff) | |
download | historical-7062de710b51ae8b2e435279dca1d0c03dcaed0c.tar.gz historical-7062de710b51ae8b2e435279dca1d0c03dcaed0c.tar.bz2 historical-7062de710b51ae8b2e435279dca1d0c03dcaed0c.zip |
Python 2.5 compatibility.
Package-Manager: portage-2.1.2_pre3-r6
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/PyQt/ChangeLog | 8 | ||||
-rw-r--r-- | dev-python/PyQt/PyQt-3.14.1-r2.ebuild | 57 | ||||
-rw-r--r-- | dev-python/PyQt/files/PyQt-3.14.1-python-2.5-compat.diff | 87 | ||||
-rw-r--r-- | dev-python/PyQt/files/digest-PyQt-3.14.1-r1 | 2 | ||||
-rw-r--r-- | dev-python/PyQt/files/digest-PyQt-3.14.1-r2 | 3 | ||||
-rw-r--r-- | dev-python/PyQt/files/digest-PyQt-3.16 | 2 | ||||
-rw-r--r-- | dev-python/sip/ChangeLog | 8 | ||||
-rw-r--r-- | dev-python/sip/files/digest-sip-4.2.1-r1 | 3 | ||||
-rw-r--r-- | dev-python/sip/files/sip-4.2.1-python-2.5-compat.diff | 356 | ||||
-rw-r--r-- | dev-python/sip/sip-4.2.1-r1.ebuild | 52 |
10 files changed, 576 insertions, 2 deletions
diff --git a/dev-python/PyQt/ChangeLog b/dev-python/PyQt/ChangeLog index 0a23103f6f10..ec684a3dc752 100644 --- a/dev-python/PyQt/ChangeLog +++ b/dev-python/PyQt/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-python/PyQt # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/PyQt/ChangeLog,v 1.71 2006/04/06 14:36:32 carlo Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/PyQt/ChangeLog,v 1.72 2006/10/22 15:12:11 carlo Exp $ + +*PyQt-3.14.1-r2 (22 Oct 2006) + + 22 Oct 2006; Carsten Lohrke <carlo@gentoo.org> + +files/PyQt-3.14.1-python-2.5-compat.diff, +PyQt-3.14.1-r2.ebuild: + Python 2.5 compatibility. *PyQt-3.16 (06 Apr 2006) diff --git a/dev-python/PyQt/PyQt-3.14.1-r2.ebuild b/dev-python/PyQt/PyQt-3.14.1-r2.ebuild new file mode 100644 index 000000000000..82821d64b867 --- /dev/null +++ b/dev-python/PyQt/PyQt-3.14.1-r2.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/PyQt/PyQt-3.14.1-r2.ebuild,v 1.1 2006/10/22 15:12:11 carlo Exp $ + +inherit distutils eutils + +MY_P="PyQt-x11-gpl-${PV/*_pre/snapshot-}" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="set of Python bindings for the QT 3.x Toolkit" +HOMEPAGE="http://www.riverbankcomputing.co.uk/pyqt/" +SRC_URI="mirror://gentoo/${MY_P}.tar.gz" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="debug doc examples" + +RDEPEND="x11-libs/qt + ~dev-python/sip-4.2.1 + dev-python/qscintilla" +DEPEND="${RDEPEND} + sys-devel/libtool" + + +src_unpack() { + unpack ${A} + sed -i -e "s: check_license():# check_license():" ${S}/configure.py + cd ${S} + epatch "${FILESDIR}/PyQt-3.14.1-examples.diff" + epatch "${FILESDIR}/PyQt-3.14.1-python-2.5-compat.diff" +} + +src_compile() { + distutils_python_version + addpredict ${QTDIR}/etc/settings + + local myconf="-d ${ROOT}/usr/$(get_libdir)/python${PYVER}/site-packages \ + -b ${ROOT}/usr/bin \ + -v ${ROOT}/usr/share/sip \ + -n ${ROOT}/usr/include \ + -o ${ROOT}/usr/$(get_libdir)" + use debug && myconf="${myconf} -u" + + python configure.py ${myconf} + emake || die "emake failed" +} + +src_install() { + make DESTDIR=${D} install || die "install failed" + dodoc ChangeLog LICENSE NEWS README README.Linux THANKS + use doc && dohtml doc/PyQt.html + if use examples ; then + dodir /usr/share/doc/${PF}/examples + cp -r examples3/* ${D}/usr/share/doc/${PF}/examples + fi +} diff --git a/dev-python/PyQt/files/PyQt-3.14.1-python-2.5-compat.diff b/dev-python/PyQt/files/PyQt-3.14.1-python-2.5-compat.diff new file mode 100644 index 000000000000..60b99cbee1d3 --- /dev/null +++ b/dev-python/PyQt/files/PyQt-3.14.1-python-2.5-compat.diff @@ -0,0 +1,87 @@ +--- sip/qt/qdir.sip.orig 2006-10-12 17:28:37.000000000 +0200 ++++ sip/qt/qdir.sip 2006-10-12 17:29:43.000000000 +0200 +@@ -238,7 +238,7 @@ + + QString operator[](int) const; + %MethodCode +- int len; ++ ssize_t len; + + Py_BEGIN_ALLOW_THREADS + len = sipCpp -> count(); +@@ -256,7 +256,7 @@ + + QStringList operator[](SIP_PYSLICE) const; + %MethodCode +- int len, start, stop, step, slicelength; ++ ssize_t len, start, stop, step, slicelength; + + Py_BEGIN_ALLOW_THREADS + len = sipCpp -> count(); +--- sip/qt/qstring.sip 2005/09/29 14:33:08 465369 ++++ sip/qt/qstring.sip 2006/10/11 22:54:45 594670 +@@ -746,7 +746,7 @@ + + QString operator[](SIP_PYSLICE) const; + %MethodCode +- int len, start, stop, step, slicelength; ++ ssize_t len, start, stop, step, slicelength; + + len = sipCpp -> length(); + +--- sip/qt/qstringlist.sip 2005/09/29 14:33:08 465369 ++++ sip/qt/qstringlist.sip 2006/10/11 22:54:45 594670 +@@ -99,7 +99,7 @@ + + void __setitem__(int,const QString &); + %MethodCode +- int len; ++ ssize_t len; + + len = sipCpp -> count(); + +@@ -111,7 +111,7 @@ + + void __setitem__(SIP_PYSLICE,const QStringList &); + %MethodCode +- int len, start, stop, step, slicelength; ++ ssize_t len, start, stop, step, slicelength; + + len = sipCpp -> count(); + +@@ -142,7 +142,7 @@ + + void __delitem__(int); + %MethodCode +- int len; ++ ssize_t len; + + len = sipCpp -> count(); + +@@ -154,7 +154,7 @@ + + void __delitem__(SIP_PYSLICE); + %MethodCode +- int len, start, stop, step, slicelength; ++ ssize_t len, start, stop, step, slicelength; + + len = sipCpp -> count(); + +@@ -170,7 +170,7 @@ + + QString operator[](int); + %MethodCode +- int len; ++ ssize_t len; + + len = sipCpp -> count(); + +@@ -182,7 +182,7 @@ + + QStringList operator[](SIP_PYSLICE); + %MethodCode +- int len, start, stop, step, slicelength; ++ ssize_t len, start, stop, step, slicelength; + + len = sipCpp -> count(); + diff --git a/dev-python/PyQt/files/digest-PyQt-3.14.1-r1 b/dev-python/PyQt/files/digest-PyQt-3.14.1-r1 index a7791cbd39b4..b03a0406f6d8 100644 --- a/dev-python/PyQt/files/digest-PyQt-3.14.1-r1 +++ b/dev-python/PyQt/files/digest-PyQt-3.14.1-r1 @@ -1 +1,3 @@ MD5 bf6d939ec77e48a2db7561e7bac61d19 PyQt-x11-gpl-3.14.1.tar.gz 782274 +RMD160 d8caef8513bc715f2f0e6107daa5d6d2ba883ddb PyQt-x11-gpl-3.14.1.tar.gz 782274 +SHA256 0dce9b536a04d89934334c5ace498cce31fc8a435ed4ef6ac2eb16256573f555 PyQt-x11-gpl-3.14.1.tar.gz 782274 diff --git a/dev-python/PyQt/files/digest-PyQt-3.14.1-r2 b/dev-python/PyQt/files/digest-PyQt-3.14.1-r2 new file mode 100644 index 000000000000..b03a0406f6d8 --- /dev/null +++ b/dev-python/PyQt/files/digest-PyQt-3.14.1-r2 @@ -0,0 +1,3 @@ +MD5 bf6d939ec77e48a2db7561e7bac61d19 PyQt-x11-gpl-3.14.1.tar.gz 782274 +RMD160 d8caef8513bc715f2f0e6107daa5d6d2ba883ddb PyQt-x11-gpl-3.14.1.tar.gz 782274 +SHA256 0dce9b536a04d89934334c5ace498cce31fc8a435ed4ef6ac2eb16256573f555 PyQt-x11-gpl-3.14.1.tar.gz 782274 diff --git a/dev-python/PyQt/files/digest-PyQt-3.16 b/dev-python/PyQt/files/digest-PyQt-3.16 index eec43371e307..30940eeff9fe 100644 --- a/dev-python/PyQt/files/digest-PyQt-3.16 +++ b/dev-python/PyQt/files/digest-PyQt-3.16 @@ -1 +1,3 @@ MD5 5f7a32a15bf8afe17c0d0a0cc46de690 PyQt-x11-gpl-3.16.tar.gz 800618 +RMD160 463c1e1a43aece2abaea1356aa04c62efb3ff894 PyQt-x11-gpl-3.16.tar.gz 800618 +SHA256 e3f5b10ef5e7dd4c79e97c2ee7171af857ad7ea1d36919c09d7bd504b8676d26 PyQt-x11-gpl-3.16.tar.gz 800618 diff --git a/dev-python/sip/ChangeLog b/dev-python/sip/ChangeLog index 5ad9c7ebbef0..e4bfd8a2c35d 100644 --- a/dev-python/sip/ChangeLog +++ b/dev-python/sip/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-python/sip # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/sip/ChangeLog,v 1.81 2006/06/11 10:27:02 carlo Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/sip/ChangeLog,v 1.82 2006/10/22 15:10:32 carlo Exp $ + +*sip-4.2.1-r1 (22 Oct 2006) + + 22 Oct 2006; Carsten Lohrke <carlo@gentoo.org> + +files/sip-4.2.1-python-2.5-compat.diff, +sip-4.2.1-r1.ebuild: + Python 2.5 compatibility. *sip-4.4.5 (11 Jun 2006) diff --git a/dev-python/sip/files/digest-sip-4.2.1-r1 b/dev-python/sip/files/digest-sip-4.2.1-r1 new file mode 100644 index 000000000000..3262025aae04 --- /dev/null +++ b/dev-python/sip/files/digest-sip-4.2.1-r1 @@ -0,0 +1,3 @@ +MD5 552d8487ab419320b2bdb50f45d256ca sip-4.2.1.tar.gz 313308 +RMD160 f65e3adcfbd3e2030051aba5a7c96daad39a8599 sip-4.2.1.tar.gz 313308 +SHA256 6197d6d0d2111ceb25c1de0ca6a0addb4395d0320f2046c636e53d17ea6de0c5 sip-4.2.1.tar.gz 313308 diff --git a/dev-python/sip/files/sip-4.2.1-python-2.5-compat.diff b/dev-python/sip/files/sip-4.2.1-python-2.5-compat.diff new file mode 100644 index 000000000000..7067a7f0701f --- /dev/null +++ b/dev-python/sip/files/sip-4.2.1-python-2.5-compat.diff @@ -0,0 +1,356 @@ +--- sipgen/gencode.c 2005/08/25 21:02:16 453320 ++++ sipgen/gencode.c 2006/10/11 22:54:45 594670 +@@ -3043,13 +3043,17 @@ + + if (isNumberSlot(md) || isInplaceNumberSlot(md)) + prcode(fp, ++"#if PY_VERSION_HEX >= 0x02050000\n" ++" if (!PyType_IsSubtype(sipSelf -> ob_type,&sipClass_%C -> super.ht_type))\n" ++"#else\n" + " if (!PyType_IsSubtype(sipSelf -> ob_type,&sipClass_%C -> super.type))\n" ++"#endif\n" + " {\n" + " Py_INCREF(Py_NotImplemented);\n" + " return Py_NotImplemented;\n" + " }\n" + "\n" +- ,classFQCName(cd)); ++ ,classFQCName(cd),classFQCName(cd)); + + prcode(fp, + " %S *sipCpp = reinterpret_cast<%S *>(sipGetCppPtr((sipWrapper *)sipSelf,sipClass_%C));\n" +--- siplib/objmap.c 2005/08/25 21:02:16 453320 ++++ siplib/objmap.c 2006/09/28 06:39:22 589485 +@@ -114,8 +114,13 @@ + * of it, or vice versa, then we assume it is the same C++ + * object. + */ ++#if PY_VERSION_HEX >= 0x02050000 ++ if (PyObject_TypeCheck(w,&type -> super.ht_type) || ++ PyType_IsSubtype(&type -> super.ht_type,w -> ob_type)) ++#else + if (PyObject_TypeCheck(w,&type -> super.type) || + PyType_IsSubtype(&type -> super.type,w -> ob_type)) ++#endif + return w; + } + +--- siplib/qtlib.cpp 2005/08/25 21:02:16 453320 ++++ siplib/qtlib.cpp 2006/09/28 06:39:22 589485 +@@ -1232,7 +1232,7 @@ + // specified the slot at "obj, SLOT('meth()')" + // rather than "obj.meth" (see below). + +- char *meth; ++ const char *meth; + + // Get the method name. + meth = ((PyCFunctionObject *)rxObj) -> m_ml -> ml_name; +--- siplib/sip.h 2005/08/25 21:02:16 453320 ++++ siplib/sip.h 2006/10/11 14:34:14 594517 +@@ -47,6 +47,12 @@ + #define SIP_VERSION_STR "4.2.1" + #define SIP_BUILD "297" + ++/* Some internal compatibility stuff. */ ++#if PY_VERSION_HEX >= 0x02050000 ++#define _SIP_SSIZE_T Py_ssize_t ++#else ++#define _SIP_SSIZE_T int ++#endif + + /* + * Define the current API version number. SIP must handle modules with the +@@ -535,12 +541,12 @@ + * The following are part of the public API. + */ + void (*api_bad_catcher_result)(PyObject *method); +- void (*api_bad_length_for_slice)(int seqlen,int slicelen); ++ void (*api_bad_length_for_slice)(_SIP_SSIZE_T seqlen,_SIP_SSIZE_T slicelen); + PyObject *(*api_build_result)(int *isErr,char *fmt,...); + PyObject *(*api_call_method)(int *isErr,PyObject *method,char *fmt,...); + PyObject *(*api_class_name)(PyObject *self); + PyObject *(*api_connect_rx)(PyObject *txObj,const char *sig,PyObject *rxObj,const char *slot); +- int (*api_convert_from_sequence_index)(int idx,int len); ++ _SIP_SSIZE_T (*api_convert_from_sequence_index)(_SIP_SSIZE_T idx,_SIP_SSIZE_T len); + void *(*api_convert_to_cpp)(PyObject *sipSelf,sipWrapperType *type,int *iserrp); + PyObject *(*api_disconnect_rx)(PyObject *txObj,const char *sig,PyObject *rxObj,const char *slot); + int (*api_emit_signal)(PyObject *self,const char *sig,PyObject *sigargs); +--- siplib/siplib.c 2005/08/25 21:02:16 453320 ++++ siplib/siplib.c 2006/10/11 14:34:14 594517 +@@ -28,12 +28,12 @@ + * These are the functions that make up the public and private SIP API. + */ + static void sip_api_bad_catcher_result(PyObject *method); +-static void sip_api_bad_length_for_slice(int seqlen,int slicelen); ++static void sip_api_bad_length_for_slice(_SIP_SSIZE_T seqlen,_SIP_SSIZE_T slicelen); + static PyObject *sip_api_build_result(int *isErr,char *fmt,...); + static PyObject *sip_api_call_method(int *isErr,PyObject *method,char *fmt, + ...); + static PyObject *sip_api_class_name(PyObject *self); +-static int sip_api_convert_from_sequence_index(int idx,int len); ++static _SIP_SSIZE_T sip_api_convert_from_sequence_index(_SIP_SSIZE_T idx, _SIP_SSIZE_T len); + static void *sip_api_convert_to_cpp(PyObject *sipSelf,sipWrapperType *type, + int *iserrp); + static PyObject *sip_api_get_wrapper(void *cppPtr,sipWrapperType *type); +@@ -302,8 +302,11 @@ + + if (PyType_Ready(&sipWrapperType_Type) < 0) + Py_FatalError("sip: Failed to initialise sip.wrappertype type"); +- ++#if PY_VERSION_HEX >= 0x02050000 ++ if (PyType_Ready(&sipWrapper_Type.super.ht_type) < 0) ++#else + if (PyType_Ready(&sipWrapper_Type.super.type) < 0) ++#endif + Py_FatalError("sip: Failed to initialise sip.wrapper type"); + + if (PyType_Ready(&sipVoidPtr_Type) < 0) +@@ -671,7 +674,11 @@ + sipWrapperType *wt; + + while ((wt = *mw++) != NULL) ++#if PY_VERSION_HEX >= 0x02050000 ++ if (addInstances(wt -> super.ht_type.tp_dict,&wt -> type -> td_instances) < 0) ++#else + if (addInstances(wt -> super.type.tp_dict,&wt -> type -> td_instances) < 0) ++#endif + return -1; + } + +@@ -1568,7 +1575,11 @@ + type = va_arg(va,sipWrapperType *); + va_arg(va,void **); + ++#if PY_VERSION_HEX >= 0x02050000 ++ if (arg != Py_None && !PyObject_TypeCheck(arg,&type -> super.ht_type)) ++#else + if (arg != Py_None && !PyObject_TypeCheck(arg,&type -> super.type)) ++#endif + valid = PARSE_TYPE; + + /* Handle the sub-format. */ +@@ -1662,7 +1673,11 @@ + #if defined(SIP_QT_SUPPORT) + /* Sub-class of QObject. */ + ++#if PY_VERSION_HEX >= 0x02050000 ++ if (PyObject_TypeCheck(arg,&sipQObjectClass -> super.ht_type)) ++#else + if (PyObject_TypeCheck(arg,&sipQObjectClass -> super.type)) ++#endif + *va_arg(va,PyObject **) = arg; + else + valid = PARSE_TYPE; +@@ -2325,7 +2340,7 @@ + * Convert a sequence index. Return the index or a negative value if there was + * an error. + */ +-static int sip_api_convert_from_sequence_index(int idx,int len) ++static _SIP_SSIZE_T sip_api_convert_from_sequence_index(_SIP_SSIZE_T idx,_SIP_SSIZE_T len) + { + /* Negative indices start from the other end. */ + if (idx < 0) +@@ -2405,7 +2420,11 @@ + + /* Get the dictionary into which the type will be placed. */ + if (type -> td_scope >= 0) ++#if PY_VERSION_HEX >= 0x02050000 ++ dict = client -> em_types[type -> td_scope] -> super.ht_type.tp_dict; ++#else + dict = client -> em_types[type -> td_scope] -> super.type.tp_dict; ++#endif + else + dict = mod_dict; + +@@ -2474,7 +2493,11 @@ + + /* Get the dictionary into which the type will be placed. */ + if (ed -> e_scope >= 0) ++#if PY_VERSION_HEX >= 0x02050000 ++ dict = client -> em_types[ed -> e_scope] -> super.ht_type.tp_dict; ++#else + dict = client -> em_types[ed -> e_scope] -> super.type.tp_dict; ++#endif + else + dict = mod_dict; + +@@ -2597,7 +2620,11 @@ + + self = PyTuple_GET_ITEM(args,argnr); + ++#if PY_VERSION_HEX >= 0x02050000 ++ if (!PyObject_TypeCheck(self,&type -> super.ht_type)) ++#else + if (!PyObject_TypeCheck(self,&type -> super.type)) ++#endif + return PARSE_UNBOUND; + + *selfp = (sipWrapper *)self; +@@ -2700,7 +2727,11 @@ + if ((attr = createEnumMember(in, enm)) == NULL) + return NULL; + ++#if PY_VERSION_HEX >= 0x02050000 ++ if (PyDict_SetItem(in -> super.ht_type.tp_dict,nameobj,attr) < 0) ++#else + if (PyDict_SetItem(in -> super.type.tp_dict,nameobj,attr) < 0) ++#endif + { + Py_DECREF(attr); + return NULL; +@@ -2903,9 +2934,15 @@ + /* + * Report a sequence length that does not match the length of a slice. + */ +-static void sip_api_bad_length_for_slice(int seqlen,int slicelen) ++static void sip_api_bad_length_for_slice(_SIP_SSIZE_T seqlen,_SIP_SSIZE_T slicelen) + { +- PyErr_Format(PyExc_ValueError,"attempt to assign sequence of size %d to slice of size %d",seqlen,slicelen); ++ PyErr_Format(PyExc_ValueError, ++#if PY_VERSION_HEX >= 0x02050000 ++ "attempt to assign sequence of size %zd to slice of size %zd", ++#else ++ "attempt to assign sequence of size %d to slice of size %d", ++#endif ++ seqlen,slicelen); + } + + +@@ -3329,7 +3366,11 @@ + { + /* If this is a wrapped type then get the type dictionary. */ + if (sipWrapperType_Check(dict)) ++#if PY_VERSION_HEX >= 0x02050000 ++ dict = ((sipWrapperType *)dict) -> super.ht_type.tp_dict; ++#else + dict = ((sipWrapperType *)dict) -> super.type.tp_dict; ++#endif + + return addSingleClassInstance(dict,name,cppPtr,wt,SIP_SIMPLE); + } +@@ -3620,7 +3661,11 @@ + * convertor might be able to convert the target type + * to something more specific. + */ ++#if PY_VERSION_HEX >= 0x02050000 ++ if (PyType_IsSubtype(&type -> super.ht_type,&scc -> scc_basetype -> super.ht_type)) ++#else + if (PyType_IsSubtype(&type -> super.type,&scc -> scc_basetype -> super.type)) ++#endif + { + sipWrapperType *subtype; + +@@ -4036,7 +4081,7 @@ + /* + * The type alloc slot. + */ +-static PyObject *sipWrapperType_alloc(PyTypeObject *self, int nitems) ++static PyObject *sipWrapperType_alloc(PyTypeObject *self, _SIP_SSIZE_T nitems) + { + PyObject *o; + +@@ -4077,8 +4122,11 @@ + * super-type. + */ + if (self -> type == NULL) ++#if PY_VERSION_HEX >= 0x02050000 ++ self -> type = ((sipWrapperType *)self -> super.ht_type.tp_base) -> type; ++#else + self -> type = ((sipWrapperType *)self -> super.type.tp_base) -> type; +- ++#endif + return 0; + } + +@@ -4107,8 +4155,11 @@ + PyObject *dict, *tmpdict, *proxy; + PyMethodDef *pmd; + ++#if PY_VERSION_HEX >= 0x02050000 ++ dict = wt -> super.ht_type.tp_dict; ++#else + dict = wt -> super.type.tp_dict; +- ++#endif + /* The base type doesn't have any type information. */ + if ((td = wt -> type) == NULL) + return PyDictProxy_New(dict); +@@ -4304,7 +4355,11 @@ + } + + /* Call the standard super-type new. */ ++#if PY_VERSION_HEX >= 0x02050000 ++ return PyBaseObject_Type.tp_new(&wt -> super.ht_type,args,kwds); ++#else + return PyBaseObject_Type.tp_new(&wt -> super.type,args,kwds); ++#endif + } + + +@@ -4744,8 +4799,13 @@ + switch (slots++ -> psd_type) + { + case str_slot: ++#if PY_VERSION_HEX >= 0x02050000 ++ if (sp -> ht_type.tp_str == NULL) ++ sp -> ht_type.tp_str = (reprfunc)f; ++#else + if (sp -> type.tp_str == NULL) + sp -> type.tp_str = (reprfunc)f; ++#endif + break; + + case int_slot: +@@ -4891,8 +4951,13 @@ + break; + + case call_slot: ++#if PY_VERSION_HEX >= 0x02050000 ++ if (sp -> ht_type.tp_call == NULL) ++ sp -> ht_type.tp_call = sipWrapper_call; ++#else + if (sp -> type.tp_call == NULL) + sp -> type.tp_call = sipWrapper_call; ++#endif + break; + + case getitem_slot: +@@ -4916,13 +4981,23 @@ + case ne_slot: + case gt_slot: + case ge_slot: ++#if PY_VERSION_HEX >= 0x02050000 ++ if (sp -> ht_type.tp_richcompare == NULL) ++ sp -> ht_type.tp_richcompare = sipWrapper_richcompare; ++#else + if (sp -> type.tp_richcompare == NULL) + sp -> type.tp_richcompare = sipWrapper_richcompare; ++#endif + break; + + case cmp_slot: ++#if PY_VERSION_HEX >= 0x02050000 ++ if (sp -> ht_type.tp_compare == NULL) ++ sp -> ht_type.tp_compare = (cmpfunc)f; ++#else + if (sp -> type.tp_compare == NULL) + sp -> type.tp_compare = (cmpfunc)f; ++#endif + break; + + case nonzero_slot: +@@ -4936,8 +5011,13 @@ + break; + + case repr_slot: ++#if PY_VERSION_HEX >= 0x02050000 ++ if (sp -> ht_type.tp_repr == NULL) ++ sp -> ht_type.tp_repr = (reprfunc)f; ++#else + if (sp -> type.tp_repr == NULL) + sp -> type.tp_repr = (reprfunc)f; ++#endif + break; + } + } diff --git a/dev-python/sip/sip-4.2.1-r1.ebuild b/dev-python/sip/sip-4.2.1-r1.ebuild new file mode 100644 index 000000000000..a505a39638ec --- /dev/null +++ b/dev-python/sip/sip-4.2.1-r1.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/sip/sip-4.2.1-r1.ebuild,v 1.1 2006/10/22 15:10:32 carlo Exp $ + +inherit distutils + +MY_P=${P/"?.?.?_pre"/"snapshot-"} +MY_P=${MY_P/_/} +S=${WORKDIR}/${MY_P} + +DESCRIPTION="SIP is a tool for generating bindings for C++ classes so that they can be used by Python." +HOMEPAGE="http://www.riverbankcomputing.co.uk/sip/" +SRC_URI="mirror://gentoo/${MY_P}.tar.gz" +#SRC_URI="http://www.river-bank.demon.co.uk/download/sip/${MY_P}.tar.gz" +#SRC_URI="http://www.river-bank.demon.co.uk/download/snapshots/sip/${MY_P}.tar.gz" + +SLOT="0" +LICENSE="sip" +KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="debug doc" + +DEPEND="virtual/libc + x11-libs/qt + >=dev-lang/python-2.3" +RDEPEND="${DEPEND}" + +src_unpack(){ + unpack ${A} + cd ${S} + epatch "${FILESDIR}/sip-4.2.1-python-2.5-compat.diff" +} +src_compile(){ + distutils_python_version + + local myconf="-l qt-mt -b ${ROOT}usr/bin -d ${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages -e ${ROOT}usr/include/python${PYVER}" + use debug && myconf="${myconf} -u" + + python configure.py ${myconf} "CFLAGS+=${CFLAGS}" "CXXFLAGS+=${CXXFLAGS}" + emake || die "emake failed" +} + +src_install() { + make DESTDIR=${D} install || die "install failed" + dodoc ChangeLog LICENSE NEWS README THANKS TODO + if use doc ; then dohtml doc/* ; fi +} + +pkg_postinst() { + echo "" + einfo "Please note, that you have to emerge PyQt again, when upgrading from sip-3.x." + echo "" +} |