aboutsummaryrefslogtreecommitdiff
path: root/graphics/py-python-poppler-qt5
diff options
context:
space:
mode:
authorLoïc Bartoletti <lbartoletti@FreeBSD.org>2020-12-08 20:03:07 +0000
committerLoïc Bartoletti <lbartoletti@FreeBSD.org>2020-12-08 20:03:07 +0000
commit47b26d9293f196d71c39ba4d82df23d179884405 (patch)
tree3984ac0366432e29f9e1ac47cbac9b18032f7c04 /graphics/py-python-poppler-qt5
parent96fd51619a1ebc0b215ab75ccc37ce7ab300ed8b (diff)
downloadports-47b26d9293f196d71c39ba4d82df23d179884405.tar.gz
ports-47b26d9293f196d71c39ba4d82df23d179884405.zip
Update Qt/PySide2 to 5.15.2 / PyQt to 5.15.1 / SIP to 5.4.0
This commit combines several updates. - Update Qt to 5.12.2 - Update PyQt to 5.15.1 - Since PySide 5.15.1 is broken with Qt 5.15.2, so PySide and Shiboken are also updated to 5.15.2. - Update sip to 5.4.0 SIP is a collection of tools to create Python bindings for C and C++ libraries and used by PyQt and wxPython. There are some changes with sip5 [1]: - python 3.5+ is required - sip drops support of old deprecated methods as sipdistutils & cie. - this version breaks also PyQt5 extension ABI. SIP files will be installed in ${PYTHON_SITELIBDIR}/PyQt${_PYQT_VERSION}/bindings - some ports will use the new pyqtbuilder package with the pyproject.toml setup. Instead if the project have a setup.py, you should use sip-build to build it. - if a port needs sip, it should also needs pysip. BTW, py-qt5-core requires pysip, so that should be enough for PyQt packages. List of ports impacted by this change. Most of the patches have been integrated or are in the process of being integrated upstream: - devel/libsavitar - graphics/py-python-poppler-qt5 - net-im/scudcloud - net/libarcus - print/py-frescobaldi - science/py-veusz - graphics/qgis and graphics/qgis-ltr - deskutils/calibre A special note regarding calibre. New versions require sip>=5, we update it to the latest version (thanks to madpilot@) science/scidavis will remove the PyQt binding soon and there is no patch planned, so we remove the python option (ok makc@) While here, convert some ports to USE_PYQT (cad/cura, cad/uranium, devel/eric6, ...) Thanks to tcberner and adridg! [1] https://www.riverbankcomputing.com/static/Docs/sip/ PR: 250853 Exp-run by: antoine
Notes
Notes: svn path=/head/; revision=557300
Diffstat (limited to 'graphics/py-python-poppler-qt5')
-rw-r--r--graphics/py-python-poppler-qt5/Makefile16
-rw-r--r--graphics/py-python-poppler-qt5/files/patch-poppler-qt5.sip13
-rw-r--r--graphics/py-python-poppler-qt5/files/patch-project.py94
-rw-r--r--graphics/py-python-poppler-qt5/files/patch-pyproject.toml42
-rw-r--r--graphics/py-python-poppler-qt5/files/patch-types.sip60
-rw-r--r--graphics/py-python-poppler-qt5/files/patch-version.sip.in26
-rw-r--r--graphics/py-python-poppler-qt5/pkg-plist26
7 files changed, 271 insertions, 6 deletions
diff --git a/graphics/py-python-poppler-qt5/Makefile b/graphics/py-python-poppler-qt5/Makefile
index 6bcf05cf66bb..02003ef02a7f 100644
--- a/graphics/py-python-poppler-qt5/Makefile
+++ b/graphics/py-python-poppler-qt5/Makefile
@@ -13,18 +13,22 @@ COMMENT= Python bindings for the Poppler-Qt PDF rendering library
LICENSE= LGPL21 LGPL3
LICENSE_COMB= dual
+BUILD_DEPENDS= qmake:devel/qt5-qmake
LIB_DEPENDS= libpoppler-qt5.so:graphics/poppler-qt5
-USES= compiler:c++11-lang pkgconfig pyqt:5 python:3.4+ qmake qt:5
+USES= compiler:c++11-lang pkgconfig pyqt:5 python:3.5+ qt:5
USE_GITHUB= yes
GH_ACCOUNT= frescobaldi
-USE_PYQT= gui xml sip_build
-USE_PYTHON= autoplist distutils
+USE_PYQT= gui xml sip_build qtbuilder
-PYDISTUTILS_BUILD_TARGET= build_ext
-PYDISTUTILS_BUILDARGS+= --pyqt-sip-dir=${PYQT_SIPDIR}
+do-build:
+ (cd ${WRKSRC} ; sip-build --verbose --no-make --build-dir build ; ${MAKE} -C ./build )
+
+do-install:
+ (cd ${WRKSRC} ; ${MAKE} -C ./build install INSTALL_ROOT=${STAGEDIR} )
post-install:
- @${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/popplerqt5.so
+ ${RLN} ${STAGEDIR}${PYTHON_SITELIBDIR}/popplerqt5.cpython-${PYTHON_SUFFIX}m.so ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/popplerqt5.so
+ @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/popplerqt5.cpython-${PYTHON_SUFFIX}m.so
.include <bsd.port.mk>
diff --git a/graphics/py-python-poppler-qt5/files/patch-poppler-qt5.sip b/graphics/py-python-poppler-qt5/files/patch-poppler-qt5.sip
new file mode 100644
index 000000000000..8ba76f442ddf
--- /dev/null
+++ b/graphics/py-python-poppler-qt5/files/patch-poppler-qt5.sip
@@ -0,0 +1,13 @@
+From https://github.com/frescobaldi/python-poppler-qt5/pull/41/commits/4ee58b6ee02772db915fdc5e70e336e0e5b2f34c
+
+--- poppler-qt5.sip.orig 2019-11-22 05:56:45 UTC
++++ 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/graphics/py-python-poppler-qt5/files/patch-project.py b/graphics/py-python-poppler-qt5/files/patch-project.py
new file mode 100644
index 000000000000..dc3e0ad077dd
--- /dev/null
+++ b/graphics/py-python-poppler-qt5/files/patch-project.py
@@ -0,0 +1,94 @@
+From https://github.com/frescobaldi/python-poppler-qt5/pull/41/commits/4ee58b6ee02772db915fdc5e70e336e0e5b2f34c
+
+--- project.py.orig 2020-10-11 18:59:42 UTC
++++ project.py
+@@ -0,0 +1,89 @@
++"""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)
++ self.tags.append("WS_X11")
++ super().apply_user_defaults(tool)
diff --git a/graphics/py-python-poppler-qt5/files/patch-pyproject.toml b/graphics/py-python-poppler-qt5/files/patch-pyproject.toml
new file mode 100644
index 000000000000..7ef45522bdba
--- /dev/null
+++ b/graphics/py-python-poppler-qt5/files/patch-pyproject.toml
@@ -0,0 +1,42 @@
+From https://github.com/frescobaldi/python-poppler-qt5/pull/41/commits/4ee58b6ee02772db915fdc5e70e336e0e5b2f34c
+
+--- pyproject.toml.orig 2020-10-11 18:59:42 UTC
++++ 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 = "wbsoft@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/graphics/py-python-poppler-qt5/files/patch-types.sip b/graphics/py-python-poppler-qt5/files/patch-types.sip
new file mode 100644
index 000000000000..736b40fad956
--- /dev/null
+++ b/graphics/py-python-poppler-qt5/files/patch-types.sip
@@ -0,0 +1,60 @@
+From https://github.com/frescobaldi/python-poppler-qt5/pull/33/commits/6cc4d83b172ffb2d206e696ce508e508cd46b7c3
+
+--- types.sip.orig 2019-11-22 05:56:45 UTC
++++ 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;
diff --git a/graphics/py-python-poppler-qt5/files/patch-version.sip.in b/graphics/py-python-poppler-qt5/files/patch-version.sip.in
new file mode 100644
index 000000000000..e09774be5c66
--- /dev/null
+++ b/graphics/py-python-poppler-qt5/files/patch-version.sip.in
@@ -0,0 +1,26 @@
+From https://github.com/frescobaldi/python-poppler-qt5/pull/41/commits/4ee58b6ee02772db915fdc5e70e336e0e5b2f34c
+
+--- version.sip.in.orig 2020-10-11 18:59:42 UTC
++++ 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
diff --git a/graphics/py-python-poppler-qt5/pkg-plist b/graphics/py-python-poppler-qt5/pkg-plist
new file mode 100644
index 000000000000..8c4c89d42cfa
--- /dev/null
+++ b/graphics/py-python-poppler-qt5/pkg-plist
@@ -0,0 +1,26 @@
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-annotation.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-convert.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-document.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-embedded-file.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-font-info.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-font-iterator.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-form.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-link-destination.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-link.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-media.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-movie-object.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-opt-content-model.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-page-transition.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-page.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-qt5.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-sound-object.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/poppler-text-box.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/popplerqt5.toml
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/timeline.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/types.sip
+%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/version.sip
+%%PYTHON_SITELIBDIR%%/popplerqt5.cpython-%%PYTHON_SUFFIX%%m.so
+%%PYTHON_SITELIBDIR%%/popplerqt5.so
+%%PYTHON_SITELIBDIR%%/python_poppler_qt5-0.75.0.dist-info/INSTALLER
+%%PYTHON_SITELIBDIR%%/python_poppler_qt5-0.75.0.dist-info/METADATA
+%%PYTHON_SITELIBDIR%%/python_poppler_qt5-0.75.0.dist-info/RECORD