summaryrefslogtreecommitdiff
path: root/extra/avogadro/sip-4.11.patch
blob: 0cd1e5b948828cf44264b93a5e8c9ba07830c46e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
+#ifdef SIP_4_11
+    return sip_API->api_get_address(wrapper);
+#else
     return wrapper->u.cppPtr;
+#endif
   }
     
   QClass_converters()