Compare commits

...

8 Commits
f34 ... rawhide

Author SHA1 Message Date
Fedora Release Engineering b66d165f9b Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-22 23:44:54 +00:00
Python Maint 092caf4b97 Rebuilt for Python 3.11 2022-06-13 22:19:56 +02:00
Gwyn Ciesla ff1a754c6f 21.3.0 2022-05-10 14:45:55 -05:00
Fedora Release Engineering 4b43a5751a - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-21 16:46:51 +00:00
Fedora Release Engineering 8e4ae58009 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 10:29:51 +00:00
Scott Talbert 758fa7d772 Update to build with sip5+ 2021-07-03 21:10:58 -04:00
Python Maint d8de6fd5c5 Rebuilt for Python 3.10 2021-06-04 20:18:00 +02:00
Gwyn Ciesla cc5bb2433f 21.1.0 2021-02-23 11:43:13 -06:00
5 changed files with 167 additions and 9 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
/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
/python-poppler-qt5-21.3.0.tar.gz

View File

@ -0,0 +1,113 @@
From 40e71ad88173d02648bceb2438bc0567e60dacd5 Mon Sep 17 00:00:00 2001
From: Ben Greiner <code@bnavigator.de>
Date: Tue, 23 Feb 2021 17:59:33 +0100
Subject: [PATCH] map type QVector< QPair<TYPE, TYPE> > 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 <TYPE>
};
+/**
+ * Convert QVector< QPair<TYPE, TYPE> >
+ * from and to a Python list of a 2-item tuple
+ */
+
+template<TYPE>
+%MappedType QVector< QPair<TYPE, TYPE> >
+{
+%TypeHeaderCode
+#include <qvector.h>
+#include <qpair.h>
+%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<TYPE, TYPE>* p = new QPair<TYPE, TYPE>(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<TYPE, TYPE>");
+
+ // 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<TYPE, TYPE> > *qv = new QVector< QPair<TYPE, TYPE> >;
+
+ for (int i = 0; i < PySequence_Size(sipPy); ++i)
+ {
+ int state;
+ QPair<TYPE, TYPE> * p = reinterpret_cast< QPair<TYPE, TYPE> * >(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; */

11
binpaths.patch Normal file
View File

@ -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

View File

@ -1,17 +1,19 @@
Name: python3-poppler-qt5
Version: 0.75.0
Release: 7%{?dist}
Version: 21.3.0
Release: 3%{?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
%{?_sip_api:Requires: python%{python3_pkgversion}-pyqt5-sip-api(%{_sip_api_major}) >= %{_sip_api}}
BuildRequires: %{py3_dist sip} >= 5
BuildRequires: %{py3_dist PyQt-builder}
BuildRequires: pkgconfig(poppler-qt5)
# we don't want to provide private python extension libs
@ -28,22 +30,52 @@ 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
sip-build --qmake=%{_qt5_qmake} --verbose --no-make \
--qmake-setting 'QMAKE_CFLAGS_RELEASE="%{optflags}"' \
--qmake-setting 'QMAKE_CXXFLAGS_RELEASE="%{optflags}"' \
--qmake-setting 'QMAKE_LFLAGS_RELEASE="%{?__global_ldflags}"'
%make_build -C build
%install
%py3_install
%make_install INSTALL_ROOT=%{buildroot} -C build
chmod +x %{buildroot}/%{python3_sitearch}/*.so
%files
%license LICENSE
%doc README.rst
%{python3_sitearch}/popplerqt5.cpython-*.so
%{python3_sitearch}/python_poppler*
%{python3_sitearch}/PyQt5/bindings/popplerqt5
%changelog
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 21.3.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 21.3.0-2
- Rebuilt for Python 3.11
* Tue May 10 2022 Gwyn Ciesla <gwync@protonmail.com> - 21.3.0-1
- 21.3.0
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 21.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 21.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Sat Jul 03 2021 Scott Talbert <swt@techie.net> - 21.1.0-3
- Update to build with sip5+
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 21.1.0-2
- Rebuilt for Python 3.10
* Tue Feb 23 2021 Gwyn Ciesla <gwync@protonmail.com> - 21.1.0-1
- 21.1.0
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.75.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (python-poppler-qt5-0.75.0.tar.gz) = 2f03036a2eaeb8e28875f19a813ff85a91c1e9a94301bdb736ecc50e7ececb4de2622728e6fecbf64e114435529f82b6afd23d772e2d3910ae03d5d2b5da3205
SHA512 (python-poppler-qt5-21.3.0.tar.gz) = cc942a860c2c999ff04fb0468b1556b0e23e7aa19a0185a39c5e903e717dca64bcbd51b8fe34b6885bd789cbf5cc1080c2ca1dcee30b3e69fa1721618e8db278