[arch-commits] Commit in avogadro/trunk (PKGBUILD fix-pycapsule.patch sip-4.11.patch)
Andrea Scarpino
andrea at archlinux.org
Sat Dec 18 14:11:34 UTC 2010
Date: Saturday, December 18, 2010 @ 09:11:33
Author: andrea
Revision: 103345
Made it working with sip 4.11 (FS#21569)
Added:
avogadro/trunk/fix-pycapsule.patch
Modified:
avogadro/trunk/PKGBUILD
avogadro/trunk/sip-4.11.patch
---------------------+
PKGBUILD | 13 ++++++++-----
fix-pycapsule.patch | 23 +++++++++++++++++++++++
sip-4.11.patch | 28 ++++++++++++++++++++++++----
3 files changed, 55 insertions(+), 9 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2010-12-18 14:11:27 UTC (rev 103344)
+++ PKGBUILD 2010-12-18 14:11:33 UTC (rev 103345)
@@ -4,21 +4,24 @@
pkgname=avogadro
pkgver=1.0.1
-pkgrel=4
+pkgrel=5
pkgdesc="An advanced molecular editor based on Qt"
arch=('i686' 'x86_64')
url="http://avogadro.openmolecules.net/wiki/Main_Page"
license=('GPL2')
-depends=('eigen' 'openbabel' 'pyqt' 'boost-libs' 'glew' 'python-numpy')
+depends=('eigen' 'openbabel' 'pyqt' 'boost-libs' 'glew' 'python2-numpy')
makedepends=('cmake' 'boost')
source=("http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.bz2"
- 'sip-4.11.patch')
+ 'sip-4.11.patch'
+ 'fix-pycapsule.patch')
md5sums=('0d5c391197101f0aab7be6b59f81e6fd'
- '5202204b1381cf298a583aab06d9cca4')
+ 'e78c3f96d0dc702947f75de1c094f580'
+ '45b0f3be5913575311e92b74a5520966')
build() {
cd ${srcdir}/${pkgname}-${pkgver}
- patch -Np0 -i ${srcdir}/sip-4.11.patch
+ patch -Np1 -i ${srcdir}/sip-4.11.patch
+ patch -Np1 -i ${srcdir}/fix-pycapsule.patch
cd ${srcdir}
mkdir build
Added: fix-pycapsule.patch
===================================================================
--- fix-pycapsule.patch (rev 0)
+++ fix-pycapsule.patch 2010-12-18 14:11:33 UTC (rev 103345)
@@ -0,0 +1,23 @@
+--- avogadro-1.0.1/libavogadro/src/python/sip.cpp 2010-05-02 17:31:22.000000000 +0100
++++ avogadro-1.0.1-pycapsule/libavogadro/src/python/sip.cpp 2010-11-23 19:00:09.000000000 +0000
+@@ -62,12 +62,20 @@ bool init_sip_api()
+ 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;
+ }
+
++#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;
+ }
Modified: sip-4.11.patch
===================================================================
--- sip-4.11.patch 2010-12-18 14:11:27 UTC (rev 103344)
+++ sip-4.11.patch 2010-12-18 14:11:33 UTC (rev 103345)
@@ -1,11 +1,31 @@
---- libavogadro/src/python/sip.cpp~ 2010-05-02 18:31:22.000000000 +0200
-+++ libavogadro/src/python/sip.cpp 2010-09-14 19:13:31.000000000 +0200
+diff -ur avogadro-1.0.1/cmake/modules/PythonDeps.cmake avogadro-1.0.1-sip411/cmake/modules/PythonDeps.cmake
+--- avogadro-1.0.1/cmake/modules/PythonDeps.cmake 2010-05-02 18:31:22.000000000 +0200
++++ avogadro-1.0.1-sip411/cmake/modules/PythonDeps.cmake 2010-09-14 19:11:50.000000000 +0200
+@@ -59,10 +59,13 @@
+ if (EXISTS ${PYTHON_INCLUDE_PATH}/sip.h)
+ message(STATUS "Found sip.h header...")
+ execute_process(COMMAND sip -V OUTPUT_VARIABLE SIP_VERSION)
+- if (${SIP_VERSION} VERSION_GREATER "4.8")
++ if (NOT ${SIP_VERSION} VERSION_LESS "4.11")
++ message(STATUS "using sip version 4.11 or above...")
++ add_definitions( -DSIP_4_11 -DSIP_4_8 )
++ elseif (NOT ${SIP_VERSION} VERSION_LESS "4.8")
+ message(STATUS "using sip version 4.8 or above...")
+ add_definitions( -DSIP_4_8 )
+- endif (${SIP_VERSION} VERSION_GREATER "4.8")
++ endif (NOT ${SIP_VERSION} VERSION_LESS "4.11")
+ else (EXISTS ${PYTHON_INCLUDE_PATH}/sip.h)
+ message(STATUS "sip.h header NOT found - Python support disabled")
+ # message(STATUS "debian/ubuntu: install the python-sip4-dev package.")
+diff -ur avogadro-1.0.1/libavogadro/src/python/sip.cpp avogadro-1.0.1-sip411/libavogadro/src/python/sip.cpp
+--- avogadro-1.0.1/libavogadro/src/python/sip.cpp 2010-05-02 18:31:22.000000000 +0200
++++ avogadro-1.0.1-sip411/libavogadro/src/python/sip.cpp 2010-09-14 19:13:31.000000000 +0200
@@ -204,7 +204,11 @@
sipWrapper *wrapper = reinterpret_cast<sipWrapper*>(obj_ptr);
#endif
// return the C++ pointer
-+#if SIP_API_MAJOR_NR >= 8
-+ return wrapper->data;
++#ifdef SIP_4_11
++ return sip_API->api_get_address(wrapper);
+#else
return wrapper->u.cppPtr;
+#endif
More information about the arch-commits
mailing list