summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2011-03-26 16:57:08 +0000
committerJustin Lecher <jlec@gentoo.org>2011-03-26 16:57:08 +0000
commitcd2485c48fc38c174ff24c2dc78a4ca6e8fa83ef (patch)
tree1ce7f296f7b9fa89db2bce80574e601bc0a86f26 /sci-chemistry
parentLooks like 2.13 might be terminally broken on alpha, removing keyword for now (diff)
downloadgentoo-2-cd2485c48fc38c174ff24c2dc78a4ca6e8fa83ef.tar.gz
gentoo-2-cd2485c48fc38c174ff24c2dc78a4ca6e8fa83ef.tar.bz2
gentoo-2-cd2485c48fc38c174ff24c2dc78a4ca6e8fa83ef.zip
Backported sip patch from 1.0.2_rc1, #335644
(Portage version: 2.2.0_alpha28/cvs/Linux x86_64)
Diffstat (limited to 'sci-chemistry')
-rw-r--r--sci-chemistry/avogadro/ChangeLog8
-rw-r--r--sci-chemistry/avogadro/avogadro-1.0.1.ebuild8
-rw-r--r--sci-chemistry/avogadro/files/avogadro-1.0.1-sip-backport.patch155
3 files changed, 166 insertions, 5 deletions
diff --git a/sci-chemistry/avogadro/ChangeLog b/sci-chemistry/avogadro/ChangeLog
index ed5ec454685a..9efb85f6b272 100644
--- a/sci-chemistry/avogadro/ChangeLog
+++ b/sci-chemistry/avogadro/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sci-chemistry/avogadro
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/avogadro/ChangeLog,v 1.33 2010/05/21 15:33:28 jlec Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/avogadro/ChangeLog,v 1.34 2011/03/26 16:57:08 jlec Exp $
+
+ 26 Mar 2011; Justin Lecher <jlec@gentoo.org> avogadro-1.0.1.ebuild,
+ +files/avogadro-1.0.1-sip-backport.patch:
+ Backported sip patch from 1.0.2_rc1, #335644
*avogadro-1.0.1 (21 May 2010)
diff --git a/sci-chemistry/avogadro/avogadro-1.0.1.ebuild b/sci-chemistry/avogadro/avogadro-1.0.1.ebuild
index b69dccd14937..399914ed447a 100644
--- a/sci-chemistry/avogadro/avogadro-1.0.1.ebuild
+++ b/sci-chemistry/avogadro/avogadro-1.0.1.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/avogadro/avogadro-1.0.1.ebuild,v 1.1 2010/05/21 15:33:28 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/avogadro/avogadro-1.0.1.ebuild,v 1.2 2011/03/26 16:57:08 jlec Exp $
EAPI=2
@@ -37,7 +37,9 @@ pkg_setup() {
}
src_prepare() {
- epatch "${FILESDIR}"/${PV}-gl2ps.patch
+ epatch \
+ "${FILESDIR}"/${PV}-gl2ps.patch \
+ "${FILESDIR}"/${P}-sip-backport.patch
}
src_configure() {
diff --git a/sci-chemistry/avogadro/files/avogadro-1.0.1-sip-backport.patch b/sci-chemistry/avogadro/files/avogadro-1.0.1-sip-backport.patch
new file mode 100644
index 000000000000..c10cdb5257ed
--- /dev/null
+++ b/sci-chemistry/avogadro/files/avogadro-1.0.1-sip-backport.patch
@@ -0,0 +1,155 @@
+ libavogadro/src/python/sip.cpp | 54 ++++++++++++++++++++++++++--------------
+ 1 files changed, 35 insertions(+), 19 deletions(-)
+
+diff --git a/libavogadro/src/python/sip.cpp b/libavogadro/src/python/sip.cpp
+index 7b265e9..b456443 100644
+--- a/libavogadro/src/python/sip.cpp
++++ b/libavogadro/src/python/sip.cpp
+@@ -61,14 +61,23 @@ bool init_sip_api()
+ std::cout << "Could not find the _C_API entry in the sip python module dictionary." << std::endl;
+ return false;
+ }
+-
++#ifdef SIP_USE_PYCAPSULE
++ if (!PyCapsule_IsValid(sip_capi_obj.ptr(), "sip._C_API")) {
++#else
+ if (!PyCObject_Check(sip_capi_obj.ptr())) {
++#endif
+ std::cout << "The _C_API object in the sip python module is invalid." << std::endl;
+ return false;
+ }
+
+- sip_API = reinterpret_cast<const sipAPIDef*>(PyCObject_AsVoidPtr(sip_capi_obj.ptr()));
+-
++#ifdef SIP_USE_PYCAPSULE
++ sip_API =
++ reinterpret_cast<const sipAPIDef*>(PyCapsule_GetPointer(sip_capi_obj.ptr(),
++ "sip._C_API"));
++#else
++ sip_API =
++ reinterpret_cast<const sipAPIDef*>(PyCObject_AsVoidPtr(sip_capi_obj.ptr()));
++#endif
+ return true;
+ }
+
+@@ -131,7 +140,7 @@ struct QClass_converters
+ {
+ static PyObject* convert(const T& object)
+ {
+-#ifdef SIP_4_8
++#if SIP_API_MAJOR_NR >=4
+ const sipTypeDef *type = sip_API->api_find_type(MetaData<T>::className());
+ #else
+ sipWrapperType *type = sip_API->api_find_class(MetaData<T>::className());
+@@ -139,7 +148,7 @@ struct QClass_converters
+ if (!type)
+ return incref(Py_None);
+
+-#ifdef SIP_4_8
++#if SIP_API_MAJOR_NR >=4
+ PyObject *sip_obj = sip_API->api_convert_from_type((void*)(&object), type, 0);
+ #else
+ PyObject *sip_obj = sip_API->api_convert_from_instance((void*)(&object), type, 0);
+@@ -155,7 +164,7 @@ struct QClass_converters
+ if (!object)
+ return incref(Py_None);
+
+-#ifdef SIP_4_8
++#if SIP_API_MAJOR_NR >=4
+ const sipTypeDef *type = sip_API->api_find_type(MetaData<T>::className());
+ #else
+ sipWrapperType *type = sip_API->api_find_class(MetaData<T>::className());
+@@ -163,7 +172,7 @@ struct QClass_converters
+ if (!type)
+ return incref(Py_None);
+
+-#ifdef SIP_4_8
++#if SIP_API_MAJOR_NR >=4
+ PyObject *sip_obj = sip_API->api_convert_from_type(object, type, 0);
+ #else
+ PyObject *sip_obj = sip_API->api_convert_from_instance(object, type, 0);
+@@ -183,28 +192,36 @@ struct QClass_converters
+
+ static void* QClass_from_PyQt(PyObject *obj_ptr)
+ {
+-#ifdef SIP_4_8
+- if (!PyObject_TypeCheck(obj_ptr, sip_API->api_wrapper_type))
++#if SIP_API_MAJOR_NR >=4
++ if (!PyObject_TypeCheck(obj_ptr, sip_API->api_wrapper_type)) {
+ #else
+- if (!sip_API->api_wrapper_check(obj_ptr))
++ if (!sip_API->api_wrapper_check(obj_ptr)) {
+ #endif
++ std::cout << "Error - already set in QClass_from_PyQt.." << std::endl;
+ throw_error_already_set();
++ }
+
+ // transfer ownership from python to C++
+-#ifdef SIP_4_8
++#if SIP_API_MAJOR_NR >=4
+ sip_API->api_transfer_to(obj_ptr, 0);
+ #else
+ sip_API->api_transfer(obj_ptr, 1);
+ #endif
+-
++
+ // reinterpret to sipWrapper
+-#ifdef SIP_4_8
++#if SIP_API_MAJOR_NR >= 4
+ sipSimpleWrapper *wrapper = reinterpret_cast<sipSimpleWrapper*>(obj_ptr);
+ #else
+ sipWrapper *wrapper = reinterpret_cast<sipWrapper*>(obj_ptr);
+ #endif
+- // return the C++ pointer
++
++#if (SIP_API_MAJOR_NR == 8 && SIP_API_MINOR_NR >= 1) || SIP_API_MAJOR_NR > 8
++ return sip_API->api_get_address(wrapper);
++#elif SIP_API_MAJOR_NR == 8
++ return wrapper->data;
++#else
+ return wrapper->u.cppPtr;
++#endif
+ }
+
+ QClass_converters()
+@@ -230,7 +247,7 @@ struct QList_QAction_to_python_list_PyQt
+
+ static PyObject* convert(const QList<QAction*> &qList)
+ {
+-#ifdef SIP_4_8
++#if SIP_API_MAJOR_NR >=4
+ const sipTypeDef *type = sip_API->api_find_type("QAction");
+ #else
+ sipWrapperType *type = sip_API->api_find_class("QAction");
+@@ -241,7 +258,7 @@ struct QList_QAction_to_python_list_PyQt
+ boost::python::list pyList;
+
+ foreach (QAction *action, qList) {
+-#ifdef SIP_4_8
++#if SIP_API_MAJOR_NR >=4
+ PyObject *sip_obj = sip_API->api_convert_from_type(action, type, 0);
+ #else
+ PyObject *sip_obj = sip_API->api_convert_from_instance(action, type, 0);
+@@ -369,7 +386,7 @@ PyObject* toPyQt(T *obj)
+ return incref(Py_None);
+ }
+
+-#ifdef SIP_4_8
++#if SIP_API_MAJOR_NR >=4
+ const sipTypeDef *type = sip_API->api_find_type(MetaData<T>::className());
+ #else
+ sipWrapperType *type = sip_API->api_find_class(MetaData<T>::className());
+@@ -379,7 +396,7 @@ PyObject* toPyQt(T *obj)
+ return incref(Py_None);
+ }
+
+-#ifdef SIP_4_8
++#if SIP_API_MAJOR_NR >=4
+ PyObject *sip_obj = sip_API->api_convert_from_type(obj, type, 0);
+ #else
+ PyObject *sip_obj = sip_API->api_convert_from_instance(obj, type, 0);
+@@ -437,4 +454,3 @@ void export_sip()
+ to_python_converter<QList<QAction*>, QList_QAction_to_python_list_PyQt>();
+ QList_QAction_from_python_list_PyQt();
+ }
+-