[avogadro] * Tue Sep 14 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 1.0.1-8 - fix FTBFS with SIP 4.11 (Gentoo#

Kevin Kofler kkofler at fedoraproject.org
Tue Sep 14 17:24:43 UTC 2010


commit 6476c1a6de44b40f540b303cc36e0520aae6b3c9
Author: Kevin Kofler <Kevin at tigcc.ticalc.org>
Date:   Tue Sep 14 19:24:15 2010 +0200

    * Tue Sep 14 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 1.0.1-8
    - fix FTBFS with SIP 4.11 (Gentoo#335644)

 avogadro-1.0.1-sip411.patch |   34 ++++++++++++++++++++++++++++++++++
 avogadro.spec               |   12 ++++++++++--
 2 files changed, 44 insertions(+), 2 deletions(-)
---
diff --git a/avogadro-1.0.1-sip411.patch b/avogadro-1.0.1-sip411.patch
new file mode 100644
index 0000000..0cd1e5b
--- /dev/null
+++ b/avogadro-1.0.1-sip411.patch
@@ -0,0 +1,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()
diff --git a/avogadro.spec b/avogadro.spec
index 0592d8c..235fb11 100644
--- a/avogadro.spec
+++ b/avogadro.spec
@@ -5,13 +5,17 @@
 
 Name:           avogadro
 Version:        1.0.1
-Release:        7%{?dist}
+Release:        8%{?dist}
 Summary:        An advanced molecular editor for chemical purposes
 
 Group:          Applications/Editors
 License:        GPLv2
 URL:            http://avogadro.openmolecules.net/
 Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
+# fix FTBFS with SIP 4.11 (Gentoo#335644)
+# patch submitted: http://bugs.gentoo.org/attachment.cgi?id=247308 (upstream is
+# CCed on the Gentoo bug)
+Patch0:         avogadro-1.0.1-sip411.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  cmake >= 2.6.0
@@ -59,6 +63,7 @@ Avogadros libraries.
 
 %prep
 %setup -q
+%patch0 -p1 -b .sip411
 
 # nuke unpatched copy, use working version included in cmake instead -- Rex
 rm -f cmake/modules/FindPythonLibs.cmake
@@ -138,7 +143,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
-* Thu Sep 09 2010 Rex Dieter <rdieter at fedoraproject.org. - 1.0.1-7
+* Tue Sep 14 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 1.0.1-8
+- fix FTBFS with SIP 4.11 (Gentoo#335644)
+
+* Thu Sep 09 2010 Rex Dieter <rdieter at fedoraproject.org> - 1.0.1-7
 - rebuild(sip)
 
 * Sun Aug 22 2010 Kevin Kofler <Kevin at tigcc.ticalc.org> - 1.0.1-6


More information about the scm-commits mailing list