Hello community, here is the log from the commit of package python-poppler-qt5 for openSUSE:Factory checked in at 2020-11-15 15:27:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-poppler-qt5 (Old) and /work/SRC/openSUSE:Factory/.python-poppler-qt5.new.24930 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-poppler-qt5" Sun Nov 15 15:27:09 2020 rev:6 rq:848494 version:0.75.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-poppler-qt5/python-poppler-qt5.changes 2020-01-03 17:39:55.931386458 +0100 +++ /work/SRC/openSUSE:Factory/.python-poppler-qt5.new.24930/python-poppler-qt5.changes 2020-11-15 15:27:48.271542195 +0100 @@ -1,0 +2,17 @@ +Sat Oct 10 13:39:00 UTC 2020 - Benjamin Greiner <c...@bnavigator.de> + +- Use SIP5 + * poppler-qt5-pr33-sip5.patch + gh#frescobaldi/python-poppler-qt5#33 + * poppler-qt5-pr41-sip5.patch + gh#frescobaldi/python-poppler-qt5#41 +- SIP5 creates files for SIP bindings and Qscintilla API + * new devel package + +------------------------------------------------------------------- +Thu Sep 10 17:23:36 UTC 2020 - Benjamin Greiner <c...@bnavigator.de> + +- Fix obsoletes to work with python singlespec +- Enforce sip4 gh#frescobaldi/python-poppler-qt5#38 + +------------------------------------------------------------------- New: ---- poppler-qt5-pr33-sip5.patch poppler-qt5-pr41-sip5.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-poppler-qt5.spec ++++++ --- /var/tmp/diff_new_pack.eTO0oc/_old 2020-11-15 15:27:48.755542713 +0100 +++ /var/tmp/diff_new_pack.eTO0oc/_new 2020-11-15 15:27:48.759542717 +0100 @@ -18,7 +18,12 @@ # +%if 0%{suse_version} < 1550 +%{?!use_sip4:%define use_sip4 1} +%endif + %{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define oldpython python %define skip_python2 1 Name: python-poppler-qt5 Version: 0.75.0 @@ -27,36 +32,78 @@ License: LGPL-2.1-or-later Group: Development/Languages/Python URL: https://pypi.org/project/python-poppler-qt5/ -Source0: https://files.pythonhosted.org/packages/6a/7d/65a14ece5dd6a1564b576c1ca30b0f5639be64cc55b62b4d2b497159ed43/%{name}-%{version}.tar.gz -BuildRequires: %{python_module sip-devel} +Source0: https://files.pythonhosted.org/packages/source/p/python-poppler-qt5/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM poppler-qt5-pr33-sip5.patch gh#frescobaldi/python-poppler-qt5#33 -- support SIP5 +Patch1: https://github.com/frescobaldi/python-poppler-qt5/pull/33.patch#/poppler-qt5-pr33-sip5.patch +# PATCH-FIX-UPSTREAM poppler-qt5-pr41-sip5.patch gh#frescobaldi/python-poppler-qt5#41 -- use SIP5 +Patch2: https://github.com/frescobaldi/python-poppler-qt5/pull/41.patch#/poppler-qt5-pr41-sip5.patch +BuildRequires: %{python_module qt5-devel} +%if 0%{?use_sip4} +BuildRequires: %{python_module sip4-devel} +Requires: python-sip(api) = %{python_sip_api_ver} +%else +BuildRequires: %{python_module pyqt-builder} +BuildRequires: %{python_module sip-devel > 5.3} +%endif BuildRequires: libpoppler-qt5-devel +BuildRequires: python-pyqt-rpm-macros BuildRequires: python-rpm-macros -BuildRequires: python3-qt5-devel %requires_eq python-qt5 -Requires: python-sip(api) = %{python_sip_api_ver} -Obsoletes: python-poppler-qt4 -Obsoletes: python-poppler-qt5 + %python_subpackages %description A Python binding for libpoppler-qt5 that aims for completeness and for being actively maintained. +%package devel +Summary: Devel package for %{name} +Group: Development/Languages/Python +Requires: libpoppler-qt5-devel +Requires: python-qt5-devel +Requires: python-sip-devel + +%description devel +A Python binding for libpoppler-qt5 that aims for completeness +and for being actively maintained. + +This package contains the SIP and Qscintilla API files to build +python packages using python-poppler + + %prep -%setup -q +%autosetup -p1 %build +%if 0%{?use_sip4} export PATH=%{_libdir}/qt5/bin:$PATH %python_build +%else +%pyqt_build +%endif %install +%if 0%{?use_sip4} export PATH=%{_libdir}/qt5/bin:$PATH %python_install +%else +%pyqt_install +%endif + +%check +%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -c 'import popplerqt5; print(popplerqt5.version())' %files %{python_files} %license LICENSE %doc ChangeLog README.rst TODO -%{python3_sitearch}/popplerqt5*.so -%{python3_sitearch}/python_poppler_qt5*.egg-info +%{python_sitearch}/popplerqt5*.so +%{python_sitearch}/python_poppler_qt5-%{version}*-info + +%if ! 0%{?use_sip4} +%files %{python_files devel} +%license LICENSE +%{python_sitearch}/PyQt5/bindings/popplerqt5 +%{_libqt5_datadir}/qsci/api/python_%{python_bin_suffix}/python-poppler-qt5.api +%endif %changelog ++++++ poppler-qt5-pr33-sip5.patch ++++++ From 6cc4d83b172ffb2d206e696ce508e508cd46b7c3 Mon Sep 17 00:00:00 2001 From: woodlandhunter <woodlandhun...@users.noreply.github.com> Date: Thu, 2 Jan 2020 20:54:56 -0600 Subject: [PATCH] Replace deprecated C API calls with their updated counterparts These replaced functions have been deprecated since v4.8.x and are removed in sip5 --- types.sip | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types.sip b/types.sip index e027b77..239b8c9 100644 --- a/types.sip +++ b/types.sip @@ -182,7 +182,7 @@ template <TYPE> if ((l = PyList_New(sipCpp->size())) == NULL) return NULL; - const sipMappedType* qlinkedlist_type = sipFindMappedType("QLinkedList<TYPE>"); + const sipTypeDef* qlinkedlist_type = sipFindType("QLinkedList<TYPE>"); // Set the list elements. for (int i = 0; i < sipCpp->size(); ++i) @@ -190,7 +190,7 @@ template <TYPE> QLinkedList<TYPE>* t = new QLinkedList<TYPE>(sipCpp->at(i)); PyObject *tobj; - if ((tobj = sipConvertFromMappedType(t, qlinkedlist_type, sipTransferObj)) == NULL) + if ((tobj = sipConvertFromType(t, qlinkedlist_type, sipTransferObj)) == NULL) { Py_DECREF(l); delete t; @@ -203,7 +203,7 @@ template <TYPE> %End %ConvertToTypeCode - const sipMappedType* qlinkedlist_type = sipFindMappedType("QLinkedList<TYPE>"); + const sipTypeDef* qlinkedlist_type = sipFindType("QLinkedList<TYPE>"); // Check the type if that is all that is required. if (sipIsErr == NULL) @@ -212,7 +212,7 @@ template <TYPE> return 0; for (int i = 0; i < PySequence_Size(sipPy); ++i) - if (!sipCanConvertToMappedType(PySequence_ITEM(sipPy, i), qlinkedlist_type, SIP_NOT_NONE)) + if (!sipCanConvertToType(PySequence_ITEM(sipPy, i), qlinkedlist_type, SIP_NOT_NONE)) return 0; return 1; @@ -224,16 +224,16 @@ template <TYPE> for (int i = 0; i < PySequence_Size(sipPy); ++i) { int state; - QLinkedList<TYPE> * t = reinterpret_cast< QLinkedList<TYPE> * >(sipConvertToMappedType(PySequence_ITEM(sipPy, i), qlinkedlist_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); + QLinkedList<TYPE> * t = reinterpret_cast< QLinkedList<TYPE> * >(sipConvertToType(PySequence_ITEM(sipPy, i), qlinkedlist_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr)); if (*sipIsErr) { - sipReleaseInstance(t, sipClass_TYPE, state); + sipReleaseType(t, qlinkedlist_type, state); delete ql; return 0; } ql->append(*t); - sipReleaseInstance(t, sipClass_TYPE, state); + sipReleaseType(t, qlinkedlist_type, state); } *sipCppPtr = ql; ++++++ poppler-qt5-pr41-sip5.patch ++++++ From 4ee58b6ee02772db915fdc5e70e336e0e5b2f34c Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev <mity...@gmail.com> Date: Sun, 27 Sep 2020 21:23:20 +0300 Subject: [PATCH] Add support for building with SIP v5 I did not delete setup.py/setup.cfg files, they can be still used to build with SIP v4. However installations from PyPI should now work fine. Fixes #38, #34. --- poppler-qt5.sip | 2 +- project.py | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 37 +++++++++++++++++++++ version.sip.in | 21 ++++++++++++ 4 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 project.py create mode 100644 pyproject.toml create mode 100644 version.sip.in diff --git a/poppler-qt5.sip b/poppler-qt5.sip index 792e2ba..e387f5a 100644 --- a/poppler-qt5.sip +++ b/poppler-qt5.sip @@ -19,7 +19,7 @@ #include <qt5/poppler-qt5.h> %End -%Include version.sip // auto-generated by the setup.py script +%Include version.sip // auto-generated by the project.py script %Include types.sip %Include poppler-annotation.sip diff --git a/project.py b/project.py new file mode 100644 index 0000000..17df8da --- /dev/null +++ b/project.py @@ -0,0 +1,88 @@ +"""The build configuration file for Python-Poppler-Qt5, used by sip.""" + +from os.path import join +import re +import subprocess +from pyqtbuild import PyQtBindings, PyQtProject +from sipbuild import Option +import PyQt5 + + +class PythonPopplerQt5(PyQtProject): + """The Project class.""" + + def __init__(self): + super().__init__() + self.bindings_factories = [PopplerQt5Bindings] + + def update(self, tool): + """Allows SIP to find PyQt5 .sip files.""" + super().update(tool) + self.sip_include_dirs.append(join(PyQt5.__path__[0], 'bindings')) + + +class PopplerQt5Bindings(PyQtBindings): + """The Poppler-Qt5 Bindings class.""" + + def __init__(self, project): + super().__init__(project, name='Poppler-Qt5', + sip_file='poppler-qt5.sip', + qmake_QT=['xml']) + + def get_options(self): + """Our custom options that a user can pass to sip-build.""" + options = super().get_options() + options.append( + Option('poppler_version', + help='version of the poppler library', + metavar='VERSION')) + return options + + @staticmethod + def run_pkg_config(option): + output = subprocess.check_output( + ['pkg-config', option, 'poppler-qt5'], + text=True) + return output.rstrip() + + def apply_user_defaults(self, tool): + # Set include_dirs, library_dirs and libraries based on pkg-config data + cflags = self.run_pkg_config('--cflags-only-I').split() + libs = self.run_pkg_config('--libs').split() + self.include_dirs.extend( + flag[2:] for flag in cflags if flag.startswith('-I')) + self.library_dirs.extend( + flag[2:] for flag in libs if flag.startswith('-L')) + self.libraries.extend( + flag[2:] for flag in libs if flag.startswith('-l')) + + # Generate version.sip file + if self.poppler_version is not None: + poppler_qt5_version = self.poppler_version + else: + poppler_qt5_version = self.run_pkg_config('--modversion') + poppler_qt5_version = tuple(map(int, poppler_qt5_version.split('.'))) + python_poppler_qt5_version = self.project.version_str.split('.') + format_dict = { + 'vlen': 'i' * len(python_poppler_qt5_version), + 'vargs': ', '.join(python_poppler_qt5_version), + 'pvlen': 'i' * len(poppler_qt5_version), + 'pvargs': ', '.join(map(str, poppler_qt5_version)), + } + with open('version.sip.in') as template_file: + version_sip_template = template_file.read() + with open('version.sip', 'w') as version_file: + version_file.write(version_sip_template.format(**format_dict)) + + # Add Poppler version tag + if poppler_qt5_version: + with open('timeline.sip') as timeline_file: + timeline = timeline_file.read() + for match in re.finditer(r'POPPLER_V(\d+)_(\d+)_(\d+)', timeline): + if poppler_qt5_version < tuple(map(int, match.group(1, 2, 3))): + break + tag = match.group() + else: + tag = 'POPPLER_V0_20_0' + self.tags.append(tag) + super().apply_user_defaults(tool) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5950d37 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,37 @@ +[build-system] +requires = ["sip >=5", "PyQt-builder", "PyQt5"] +build-backend = "sipbuild.api" + +[tool.sip.metadata] +name = "python-poppler-qt5" +version = "0.75.0" +summary = "A Python binding to Poppler-Qt5" +description-file = "README.rst" +home-page = "https://github.com/frescobaldi/python-poppler-qt5" +maintainer = "Wilbert Berendsen" +maintainer-email = "wbs...@xs4all.nl" +license = "LGPL" +classifier = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Programming Language :: Python :: 3", + "Topic :: Multimedia :: Graphics :: Viewers" +] +requires-dist = "PyQt5" + +[tool.sip.project] +sip-files-dir = "." +sdist-excludes = [ + "version.sip", + ".git/*", + ".git/*/*", + ".git/*/*/*", + ".git/*/*/*/*", + ".git/*/*/*/*/*", + ".git/*/*/*/*/*/*", + ".git/*/*/*/*/*/*/*" +] diff --git a/version.sip.in b/version.sip.in new file mode 100644 index 0000000..9d27c97 --- /dev/null +++ b/version.sip.in @@ -0,0 +1,21 @@ +// Generated by project.py -- Do not edit + +PyObject *version(); +%Docstring +The version of the popplerqt5 python module. +%End + +PyObject *poppler_version(); +%Docstring +The version of the Poppler library it was built with. +%End + +%ModuleCode + +PyObject *version() +{{ return Py_BuildValue("({vlen})", {vargs}); }}; + +PyObject *poppler_version() +{{ return Py_BuildValue("({pvlen})", {pvargs}); }}; + +%End _______________________________________________ openSUSE Commits mailing list -- commit@lists.opensuse.org To unsubscribe, email commit-le...@lists.opensuse.org List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/commit@lists.opensuse.org