From 776b1c79e94890622e78538000654a2492f35d07 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Thu, 29 Jun 2017 16:16:12 +0200 Subject: [PATCH] Drop unnecessary qgis-2.18.10-sip.patch --- qgis-2.18.10-sip.patch | 186 ----------------------------------------- qgis.spec | 9 +- 2 files changed, 4 insertions(+), 191 deletions(-) delete mode 100644 qgis-2.18.10-sip.patch diff --git a/qgis-2.18.10-sip.patch b/qgis-2.18.10-sip.patch deleted file mode 100644 index d42ea52..0000000 --- a/qgis-2.18.10-sip.patch +++ /dev/null @@ -1,186 +0,0 @@ -diff --git a/python/core/conversions.sip b/python/core/conversions.sip -index f07d3ab1db..948821e91e 100644 ---- a/python/core/conversions.sip -+++ b/python/core/conversions.sip -@@ -2041,3 +2041,178 @@ register_from_qvariant_convertor = (void (*)(FromQVariantConvertorFn))sipImportS - register_from_qvariant_convertor(null_from_qvariant_convertor); - %End - %End -+ -+// QList is implemented as a Python list. -+%MappedType QList /TypeHintIn="Sequence[QVariant]", TypeHintOut="List[QVariant]", TypeHintValue="[]"/ -+{ -+%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) -+ { -+ QVariant *t = new QVariant(sipCpp->at(i)); -+ PyObject *tobj; -+ -+ if ((tobj = sipConvertFromNewType(t, sipType_QVariant, sipTransferObj)) == NULL) -+ { -+ Py_DECREF(l); -+ delete t; -+ -+ return NULL; -+ } -+ -+ PyList_SET_ITEM(l, i, tobj); -+ } -+ -+ return l; -+%End -+ -+%ConvertToTypeCode -+ SIP_SSIZE_T len; -+ -+ // Check the type if that is all that is required. -+ if (sipIsErr == NULL) -+ { -+ if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0) -+ return 0; -+ -+ for (SIP_SSIZE_T i = 0; i < len; ++i) -+ { -+ PyObject *itm = PySequence_ITEM(sipPy, i); -+ bool ok = (itm && sipCanConvertToType(itm, sipType_QVariant, SIP_NOT_NONE)); -+ -+ Py_XDECREF(itm); -+ -+ if (!ok) -+ return 0; -+ } -+ -+ return 1; -+ } -+ -+ QList *ql = new QList; -+ len = PySequence_Size(sipPy); -+ -+ for (SIP_SSIZE_T i = 0; i < len; ++i) -+ { -+ PyObject *itm = PySequence_ITEM(sipPy, i); -+ int state; -+ QVariant *t = reinterpret_cast(sipConvertToType(itm, sipType_QVariant, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); -+ -+ Py_DECREF(itm); -+ -+ if (*sipIsErr) -+ { -+ sipReleaseType(t, sipType_QVariant, state); -+ -+ delete ql; -+ return 0; -+ } -+ -+ ql->append(*t); -+ -+ sipReleaseType(t, sipType_QVariant, state); -+ } -+ -+ *sipCppPtr = ql; -+ -+ return sipGetState(sipTransferObj); -+%End -+}; -+ -+ -+// QList is implemented as a Python list. -+%MappedType QList /TypeHintIn="Sequence[QPolygonF]", TypeHintOut="List[QPolygonF]", TypeHintValue="[]"/ -+{ -+%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) -+ { -+ QPolygonF *t = new QPolygonF(sipCpp->at(i)); -+ PyObject *tobj; -+ -+ if ((tobj = sipConvertFromNewType(t, sipType_QPolygonF, sipTransferObj)) == NULL) -+ { -+ Py_DECREF(l); -+ delete t; -+ -+ return NULL; -+ } -+ -+ PyList_SET_ITEM(l, i, tobj); -+ } -+ -+ return l; -+%End -+ -+%ConvertToTypeCode -+ SIP_SSIZE_T len; -+ -+ // Check the type if that is all that is required. -+ if (sipIsErr == NULL) -+ { -+ if (!PySequence_Check(sipPy) || (len = PySequence_Size(sipPy)) < 0) -+ return 0; -+ -+ for (SIP_SSIZE_T i = 0; i < len; ++i) -+ { -+ PyObject *itm = PySequence_ITEM(sipPy, i); -+ bool ok = (itm && sipCanConvertToType(itm, sipType_QPolygonF, SIP_NOT_NONE)); -+ -+ Py_XDECREF(itm); -+ -+ if (!ok) -+ return 0; -+ } -+ -+ return 1; -+ } -+ -+ QList *ql = new QList; -+ len = PySequence_Size(sipPy); -+ -+ for (SIP_SSIZE_T i = 0; i < len; ++i) -+ { -+ PyObject *itm = PySequence_ITEM(sipPy, i); -+ int state; -+ QPolygonF *t = reinterpret_cast(sipConvertToType(itm, sipType_QPolygonF, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); -+ -+ Py_DECREF(itm); -+ -+ if (*sipIsErr) -+ { -+ sipReleaseType(t, sipType_QPolygonF, state); -+ -+ delete ql; -+ return 0; -+ } -+ -+ ql->append(*t); -+ -+ sipReleaseType(t, sipType_QPolygonF, state); -+ } -+ -+ *sipCppPtr = ql; -+ -+ return sipGetState(sipTransferObj); -+%End -+}; --- -2.12.0 - diff --git a/qgis.spec b/qgis.spec index f100c01..aa5712e 100644 --- a/qgis.spec +++ b/qgis.spec @@ -16,7 +16,7 @@ Name: qgis Version: 2.18.10 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A user friendly Open Source Geographic Information System Group: Applications/Engineering @@ -40,9 +40,6 @@ Source5: %{name}-mime.xml # https://github.com/qgis/QGIS/commit/718581ffb12b723f9a3c0ae01b7ec2d8aed9d4bb.patch Patch0: %{name}-lib64.patch -# Taken from https://daniele.vigano.me/git/dani/copr-dani-qgis/raw/daniviga-2.18/qgis_sip-ftbfs.patch -Patch1: %{name}-2.18.10-sip.patch - # Some plug-ins need Pyspatialite (bundled) # The license is not totally clear, see: # http://code.google.com/p/pyspatialite/issues/detail?id=3 @@ -187,7 +184,6 @@ Please refer to %{name}-server-README.fedora for details! %prep %setup -q %patch0 -p1 -b .lib64 -%patch1 -p1 -b .sip # Remove executable permissions from source code files find . \( -name "*.cpp" -o -name "*.h" \) -type f -perm /111 -execdir chmod -x {} \+ @@ -413,6 +409,9 @@ update-mime-database %{?fedora:-n} %{_datadir}/mime &> /dev/null || : %changelog +* Thu Jun 29 2017 Sandro Mani - 2.18.10-4 +- Drop unnecessary qgis-2.18.10-sip.patch + * Wed Jun 28 2017 Volker Froehlich - 2.18.10-3 - Add patch to fix sip issues