From 1eb51d30dcadd6376b95b879dd1a19bc5ffe6dea Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Oct 08 2012 16:28:07 +0000 Subject: 4.9.2-3 - (re)enable python3 support - better sip414/pyqt495 patch --- diff --git a/pykde4-pyqt495.patch b/pykde4-pyqt495.patch new file mode 100644 index 0000000..c1413d6 --- /dev/null +++ b/pykde4-pyqt495.patch @@ -0,0 +1,54 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f778510..af7a815 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -37,6 +37,7 @@ IF(PYQT4_VERSION STRLESS "040900") # These version numbers also appear in ../CM + ENDIF(PYQT4_VERSION STRLESS "040900") + + ++ + SET(SOPRANO_MIN_VERSION "2.0") + MACRO_OPTIONAL_FIND_PACKAGE(Soprano) + MACRO_LOG_FEATURE(Soprano_FOUND "Soprano" "Soprano Libraries" "kdesupport" FALSE "" "Required for Soprano Python bindings.") +@@ -95,9 +96,19 @@ SET(SIP_DISABLE_FEATURES VendorID PyQt_NoPrintRangeBug) + + # Use an extra option when compiling on Python 3. + IF (PYTHON_3) +- SET(SIP_EXTRA_OPTIONS -g -x Py_v3) ++ IF(PYQT4_VERSION STRGREATER "040904") ++ # Disable for newer PyQt ++ SET(SIP_EXTRA_OPTIONS -g -x PyKDE_QVector -x Py_v3) ++ ELSE (PYQT4_VERSION STRGREATER "040904") ++ SET(SIP_EXTRA_OPTIONS -g -x Py_v3) ++ ENDIF(PYQT4_VERSION STRGREATER "040904") + ELSE (PYTHON_3) +- SET(SIP_EXTRA_OPTIONS -g) ++ IF(PYQT4_VERSION STRGREATER "040904") ++ # Disable for newer PyQt ++ SET(SIP_EXTRA_OPTIONS -g -x PyKDE_QVector) ++ ELSE (PYQT4_VERSION STRGREATER "040904") ++ SET(SIP_EXTRA_OPTIONS -g) ++ ENDIF(PYQT4_VERSION STRGREATER "040904") + ENDIF (PYTHON_3) + + ADD_DEFINITIONS(-D_REENTRANT -DQT_CORE_LIB -DQT_GUI_LIB -DUSING_SOPRANO_NRLMODEL_UNSTABLE_API) +diff --git a/sip/kdecore/typedefs.sip b/sip/kdecore/typedefs.sip +index 5a0a080..af53f85 100644 +--- a/sip/kdecore/typedefs.sip ++++ b/sip/kdecore/typedefs.sip +@@ -951,6 +951,9 @@ template + %End + }; + ++%Feature PyKDE_QVector ++ ++%If(PyKDE_QVector) + %MappedType QVector + { + %TypeHeaderCode +@@ -1025,3 +1028,4 @@ template + return sipGetState(sipTransferObj); + %End + }; ++%End +\ No newline at end of file diff --git a/pykde4-sip414.patch b/pykde4-sip414.patch deleted file mode 100644 index ea55e2d..0000000 --- a/pykde4-sip414.patch +++ /dev/null @@ -1,82 +0,0 @@ -diff --git a/sip/kdecore/typedefs.sip b/sip/kdecore/typedefs.sip -index 5a0a080..73dad01 100644 ---- a/sip/kdecore/typedefs.sip -+++ b/sip/kdecore/typedefs.sip -@@ -951,77 +951,3 @@ template - %End - }; - --%MappedType QVector --{ --%TypeHeaderCode --#include --%End -- --%ConvertFromTypeCode -- // Create the list. -- PyObject *l; -- -- if ((l = PyList_New(sipCpp->size())) == NULL) -- return NULL; -- -- // Set the list elements. -- for (int i = 0; i < sipCpp->size(); ++i) -- { -- int t = (sipCpp->at(i)); -- --#if PY_MAJOR_VERSION >= 3 -- PyObject *tobj = PyLong_FromLong(t); --#else -- PyObject *tobj = PyInt_FromLong(t); --#endif -- -- PyList_SET_ITEM(l, i, tobj); -- } -- -- return l; --%End -- --%ConvertToTypeCode -- // Check the type if that is all that is required. -- if (sipIsErr == NULL) -- { -- if (!PyList_Check(sipPy)) -- return 0; -- -- for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) { -- PyObject *tobj = PyList_GET_ITEM(sipPy, i); --#if PY_MAJOR_VERSION >= 3 -- if (!PyNumber_Check(tobj)) --#else -- if (!PyInt_Check(tobj)) --#endif -- return 0; -- } -- return 1; -- } -- -- QVector *qv = new QVector; -- -- for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) -- { -- PyObject *tobj = PyList_GET_ITEM(sipPy, i); -- #if PY_MAJOR_VERSION >= 3 -- int t = PyLong_AsLong (tobj); --#else -- int t = PyInt_AS_LONG (tobj); --#endif -- -- if (*sipIsErr) -- { -- delete qv; -- return 0; -- } -- -- qv->append(t); -- } -- -- *sipCppPtr = qv; -- -- return sipGetState(sipTransferObj); --%End --}; diff --git a/pykde4.spec b/pykde4.spec index 524e592..94e35fc 100644 --- a/pykde4.spec +++ b/pykde4.spec @@ -2,13 +2,14 @@ %define pyqt4_version_min 4.8.2 %define sip_version_min 4.12 %global python_ver %(%{__python} -c "import sys ; print sys.version[:3]") -## python3 support -# https://bugs.kde.org/275919 -#define python3 1 +%if 0%{?fedora} > 17 +# needs kdelibs-4.9.2-6+ +%define python3 1 +%endif Name: pykde4 Version: 4.9.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Python bindings for KDE4 # http://techbase.kde.org/Policies/Licensing_Policy @@ -22,9 +23,9 @@ URL: http://developer.kde.org/language-bindings/ %endif Source0: http://download.kde.org/%{stable}/%{version}/src/%{name}-%{version}.tar.xz -## upstreamable patches -# fix build against sip-4.14 -Patch50: pykde4-sip414.patch +## upstream patches +# fix build against sip-4.14/pyqt-4.9.5 +Patch100: pykde4-pyqt495.patch # debian patches Patch200: make_pykde4_respect_sip_flags.diff @@ -146,12 +147,9 @@ Provides: python3-PyKDE4-devel%{?_isa} = %{version}-%{release} %prep %setup -q -n pykde4-%{version} -#if 0%{?fedora} > 18 -%patch50 -p1 -b .sip414 -#endif - +%patch100 -p1 -b .pyqt495 %patch200 -p1 -b .respect_sip_flags -%patch201 -p1 -b .kpythonpluginfactory_slots +%patch201 -p1 -b .kpythonpluginfactory_slots %if 0%{?rhel} %patch300 -p1 -b .webkit @@ -169,7 +167,7 @@ pushd %{_target_platform}-python3 -DPYTHON_INCLUDE_PATH=%{_includedir}/python%{python3_ver} \ .. -make %{?_smp_mflags} -C python/ +make %{?_smp_mflags} popd %endif @@ -190,7 +188,7 @@ popd rm -rf %{buildroot} %if 0%{?python3} -make install/fast DESTDIR=%{buildroot} -C %{_target_platform}-python3/python/ +make install/fast DESTDIR=%{buildroot} -C %{_target_platform}-python3 # not python3 compat yet rm -fv %{buildroot}%{_kde4_libdir}/kde4/kpythonpluginfactory.so @@ -229,7 +227,7 @@ rm -rf %{buildroot} %files %{python_sitearch}/PyKDE4/ -%{python_sitearch}/PyQt4/uic/widget-plugins/kde4.py* +%{python_sitearch}/PyQt4/uic/widget-plugins/* %dir %{_docdir}/pykde4 %{_kde4_libdir}/kde4/kpythonpluginfactory.so @@ -249,7 +247,7 @@ rm -rf %{buildroot} %files -n python3-pykde4 %doc COPYING %{python3_sitearch}/PyKDE4/ -%{python3_sitearch}/PyQt4/uic/widget-plugins/kde4.py* +%{python3_sitearch}/PyQt4/uic/widget-plugins/* %dir %{_docdir}/python3-pykde4 %if 0%{?pykde4_akonadi} @@ -261,12 +259,17 @@ rm -rf %{buildroot} %files -n python3-pykde4-devel %{_kde4_bindir}/python3-pykdeuic4 %{python3_sitearch}/PyQt4/uic/pykdeuic4.py* +%{python3_sitearch}/PyQt4/uic/__pycache__/ %{_docdir}/python3-pykde4/examples/ %{_kde4_datadir}/python3-sip/PyKDE4/ %endif %changelog +* Mon Oct 08 2012 Rex Dieter - 4.9.2-3 +- (re)enable python3 support +- better sip414/pyqt495 patch + * Mon Oct 01 2012 Rex Dieter 4.9.2-2 - rebuild (sip)