From cc5bb2433f0206b55875594ce1bfc66e34e4c33e Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Tue, 23 Feb 2021 11:43:13 -0600 Subject: [PATCH] 21.1.0 --- .gitignore | 1 + ...1ad88173d02648bceb2438bc0567e60dacd5.patch | 113 ++++++++++++++++++ binpaths.patch | 11 ++ python3-poppler-qt5.spec | 15 ++- sources | 2 +- 5 files changed, 136 insertions(+), 6 deletions(-) create mode 100644 40e71ad88173d02648bceb2438bc0567e60dacd5.patch create mode 100644 binpaths.patch diff --git a/.gitignore b/.gitignore index fe03822..1128471 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /python-poppler-qt5-0.24.2.tar.gz /python-poppler-qt5-0.74.0.tar.gz /python-poppler-qt5-0.75.0.tar.gz +/python-poppler-qt5-21.1.0.tar.gz diff --git a/40e71ad88173d02648bceb2438bc0567e60dacd5.patch b/40e71ad88173d02648bceb2438bc0567e60dacd5.patch new file mode 100644 index 0000000..d3f9738 --- /dev/null +++ b/40e71ad88173d02648bceb2438bc0567e60dacd5.patch @@ -0,0 +1,113 @@ +From 40e71ad88173d02648bceb2438bc0567e60dacd5 Mon Sep 17 00:00:00 2001 +From: Ben Greiner +Date: Tue, 23 Feb 2021 17:59:33 +0100 +Subject: [PATCH] map type QVector< QPair > for + FormFieldChoice::choicesWithExportValues() + +--- + types.sip | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 93 insertions(+) + +diff --git a/types.sip b/types.sip +index 239b8c9..81cb283 100644 +--- a/types.sip ++++ b/types.sip +@@ -331,5 +331,98 @@ template + }; + + ++/** ++ * Convert QVector< QPair > ++ * from and to a Python list of a 2-item tuple ++ */ ++ ++template ++%MappedType QVector< QPair > ++{ ++%TypeHeaderCode ++#include ++#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) ++ { ++ QPair* p = new QPair(sipCpp->at(i)); ++ PyObject *ptuple = PyTuple_New(2); ++ PyObject *pfirst; ++ PyObject *psecond; ++ ++ TYPE *sfirst = new TYPE(p->first); ++ if ((pfirst = sipConvertFromType(sfirst, sipType_TYPE, sipTransferObj)) == NULL) ++ { ++ Py_DECREF(l); ++ Py_DECREF(ptuple); ++ return NULL; ++ } ++ PyTuple_SET_ITEM(ptuple, 0, pfirst); ++ ++ TYPE *ssecond = new TYPE(p->second); ++ if ((psecond = sipConvertFromType(ssecond, sipType_TYPE, sipTransferObj)) == NULL) ++ { ++ Py_DECREF(l); ++ Py_DECREF(ptuple); ++ Py_DECREF(pfirst); ++ return NULL; ++ } ++ PyTuple_SET_ITEM(ptuple, 1, psecond); ++ ++ PyList_SET_ITEM(l, i, ptuple); ++ } ++ ++ return l; ++%End ++ ++%ConvertToTypeCode ++ const sipTypeDef* qpair_type = sipFindType("QPair"); ++ ++ // Check the type if that is all that is required. ++ if (sipIsErr == NULL) ++ { ++ if (!PySequence_Check(sipPy)) ++ return 0; ++ ++ for (int i = 0; i < PySequence_Size(sipPy); ++i) ++ if (!sipCanConvertToType(PySequence_ITEM(sipPy, i), qpair_type, SIP_NOT_NONE)) ++ return 0; ++ ++ return 1; ++ } ++ ++ ++ QVector< QPair > *qv = new QVector< QPair >; ++ ++ for (int i = 0; i < PySequence_Size(sipPy); ++i) ++ { ++ int state; ++ QPair * p = reinterpret_cast< QPair * >(sipConvertToType(PySequence_ITEM(sipPy, i), qpair_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); ++ ++ if (*sipIsErr) ++ { ++ sipReleaseType(p, qpair_type, state); ++ delete qv; ++ return 0; ++ } ++ qv->append(*p); ++ sipReleaseType(p, qpair_type, state); ++ } ++ ++ *sipCppPtr = qv; ++ return sipGetState(sipTransferObj); ++%End ++ ++}; ++ + + /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */ diff --git a/binpaths.patch b/binpaths.patch new file mode 100644 index 0000000..38eac78 --- /dev/null +++ b/binpaths.patch @@ -0,0 +1,11 @@ +--- setup.py~ 2021-01-07 09:30:52.000000000 -0600 ++++ setup.py 2021-02-23 11:32:14.766853522 -0600 +@@ -138,7 +138,7 @@ + def initialize_options (self): + build_ext_base.initialize_options(self) + self.poppler_version = None +- self.qmake_bin = 'qmake' ++ self.qmake_bin = 'qmake-qt5' + self.sip_bin = None + self.qt_include_dir = None + self.pyqt_sip_dir = None diff --git a/python3-poppler-qt5.spec b/python3-poppler-qt5.spec index 0f9545a..5924ea9 100644 --- a/python3-poppler-qt5.spec +++ b/python3-poppler-qt5.spec @@ -1,16 +1,18 @@ Name: python3-poppler-qt5 -Version: 0.75.0 -Release: 7%{?dist} +Version: 21.1.0 +Release: 1%{?dist} Summary: Python bindings for the Poppler PDF rendering library License: LGPLv2+ URL: https://github.com/frescobaldi/python-poppler-qt5 Source0: %{url}/archive/v%{version}.tar.gz#/python-poppler-qt5-%{version}.tar.gz +Patch0: binpaths.patch +Patch1: 40e71ad88173d02648bceb2438bc0567e60dacd5.patch Requires: python3-qt5 BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-qt5-devel -BuildRequires: python3-sip-devel >= 4.9.1 +BuildRequires: python3-sip5 %{?_sip_api:Requires: python%{python3_pkgversion}-pyqt5-sip-api(%{_sip_api_major}) >= %{_sip_api}} BuildRequires: pkgconfig(poppler-qt5) @@ -28,8 +30,8 @@ run programs written in Python 3 and using Poppler set. %prep %setup -qn python-poppler-qt5-%{version} -sed -i s/\'qmake\'/\'qmake-qt5\'/g setup.py - +%patch0 -p0 +%patch1 -p1 %build %py3_build @@ -44,6 +46,9 @@ sed -i s/\'qmake\'/\'qmake-qt5\'/g setup.py %{python3_sitearch}/python_poppler* %changelog +* Tue Feb 23 2021 Gwyn Ciesla - 21.1.0-1 +- 21.1.0 + * Wed Jan 27 2021 Fedora Release Engineering - 0.75.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index 7821986..babac4e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (python-poppler-qt5-0.75.0.tar.gz) = 2f03036a2eaeb8e28875f19a813ff85a91c1e9a94301bdb736ecc50e7ececb4de2622728e6fecbf64e114435529f82b6afd23d772e2d3910ae03d5d2b5da3205 +SHA512 (python-poppler-qt5-21.1.0.tar.gz) = ae2005cefaa7c26fef65cd9365ed9777e59dbbedc369416e418ea0eb2b3be28a95fc9e0718d7b191ff55fd7085946e36c32c3f5aa108f73ed4e10813103b0dcb