View | Details | Raw Unified | Return to bug 275667 | Differences between
and this patch

Collapse All | Expand All

(-)b/graphics/py-python-poppler-qt5/Makefile (-5 / +6 lines)
Lines 1-7 Link Here
1
PORTNAME=	python-poppler-qt5
1
PORTNAME=	python-poppler-qt5
2
DISTVERSIONPREFIX=	v
2
DISTVERSIONPREFIX=	v
3
DISTVERSION=	0.75.0
3
DISTVERSION=	21.3.0
4
PORTREVISION=	27
5
CATEGORIES=	graphics python
4
CATEGORIES=	graphics python
6
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
5
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
7
6
Lines 15-21 LICENSE_COMB= dual Link Here
15
BUILD_DEPENDS=	qmake-qt5:devel/qt5-qmake
14
BUILD_DEPENDS=	qmake-qt5:devel/qt5-qmake
16
LIB_DEPENDS=	libpoppler-qt5.so:graphics/poppler-qt5
15
LIB_DEPENDS=	libpoppler-qt5.so:graphics/poppler-qt5
17
16
18
USES=		compiler:c++11-lang gl pkgconfig pyqt:5 python:3.8-3.9 qt:5
17
USES=		compiler:c++11-lang gl pkgconfig pyqt:5 python qt:5
19
USE_GITHUB=	yes
18
USE_GITHUB=	yes
20
GH_ACCOUNT=	frescobaldi
19
GH_ACCOUNT=	frescobaldi
21
USE_GL=		gl
20
USE_GL=		gl
Lines 27-37 PLIST_SUB= _PY_SONAME=${_PY_SONAME} Link Here
27
26
28
_PY_SONAME=	${PYTHON_EXT_SUFFIX}
27
_PY_SONAME=	${PYTHON_EXT_SUFFIX}
29
28
29
BINARY_ALIAS=	qmake=${QMAKE}
30
30
do-build:
31
do-build:
31
	(cd ${WRKSRC} ; sip-build-${PYTHON_VER} --qmake ${QMAKE} --verbose --no-make --build-dir build ; ${MAKE} -C ./build )
32
	(cd ${WRKSRC} ; ${SETENV} ${MAKE_ENV} ${SIP} ${SIP_ARGS} ; ${SETENV} ${MAKE_ENV} ${MAKE} -C ./build )
32
33
33
do-install:
34
do-install:
34
	(cd ${WRKSRC} ; ${MAKE} -C ./build install INSTALL_ROOT=${STAGEDIR} )
35
	(cd ${WRKSRC} ; ${SETENV} ${MAKE_ENV} ${MAKE} -C ./build install INSTALL_ROOT=${STAGEDIR} )
35
36
36
post-install:
37
post-install:
37
	${RLN} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/popplerqt5${_PY_SONAME}.so ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/popplerqt5.so
38
	${RLN} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/popplerqt5${_PY_SONAME}.so ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/popplerqt5.so
(-)b/graphics/py-python-poppler-qt5/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1587923266
1
TIMESTAMP = 1702153835
2
SHA256 (frescobaldi-python-poppler-qt5-v0.75.0_GH0.tar.gz) = 92e6bd8f4ce90ba4e3e0c2ada026b643481ba1b109d45e8fdbdaedca8416a995
2
SHA256 (frescobaldi-python-poppler-qt5-v21.3.0_GH0.tar.gz) = dbf3be9c8123429c8a73ebd4c18993331619198e88fa40dde99f48213fa75012
3
SIZE (frescobaldi-python-poppler-qt5-v0.75.0_GH0.tar.gz) = 23281
3
SIZE (frescobaldi-python-poppler-qt5-v21.3.0_GH0.tar.gz) = 25641
(-)a/graphics/py-python-poppler-qt5/files/patch-poppler-qt5.sip (-13 lines)
Removed Link Here
1
From https://github.com/frescobaldi/python-poppler-qt5/pull/41/commits/4ee58b6ee02772db915fdc5e70e336e0e5b2f34c
2
3
--- poppler-qt5.sip.orig	2019-11-22 05:56:45 UTC
4
+++ poppler-qt5.sip
5
@@ -19,7 +19,7 @@
6
 #include <qt5/poppler-qt5.h>
7
 %End
8
 
9
-%Include version.sip        // auto-generated by the setup.py script
10
+%Include version.sip        // auto-generated by the project.py script
11
 %Include types.sip
12
 
13
 %Include poppler-annotation.sip
(-)a/graphics/py-python-poppler-qt5/files/patch-project.py (-94 lines)
Removed Link Here
1
From https://github.com/frescobaldi/python-poppler-qt5/pull/41/commits/4ee58b6ee02772db915fdc5e70e336e0e5b2f34c
2
3
--- project.py.orig	2020-10-11 18:59:42 UTC
4
+++ project.py
5
@@ -0,0 +1,89 @@
6
+"""The build configuration file for Python-Poppler-Qt5, used by sip."""
7
+
8
+from os.path import join
9
+import re
10
+import subprocess
11
+from pyqtbuild import PyQtBindings, PyQtProject
12
+from sipbuild import Option
13
+import PyQt5
14
+
15
+
16
+class PythonPopplerQt5(PyQtProject):
17
+    """The Project class."""
18
+
19
+    def __init__(self):
20
+        super().__init__()
21
+        self.bindings_factories = [PopplerQt5Bindings]
22
+
23
+    def update(self, tool):
24
+        """Allows SIP to find PyQt5 .sip files."""
25
+        super().update(tool)
26
+        self.sip_include_dirs.append(join(PyQt5.__path__[0], 'bindings'))
27
+
28
+
29
+class PopplerQt5Bindings(PyQtBindings):
30
+    """The Poppler-Qt5 Bindings class."""
31
+
32
+    def __init__(self, project):
33
+        super().__init__(project, name='Poppler-Qt5',
34
+                         sip_file='poppler-qt5.sip',
35
+                         qmake_QT=['xml'])
36
+
37
+    def get_options(self):
38
+        """Our custom options that a user can pass to sip-build."""
39
+        options = super().get_options()
40
+        options.append(
41
+            Option('poppler_version',
42
+                   help='version of the poppler library',
43
+                   metavar='VERSION'))
44
+        return options
45
+
46
+    @staticmethod
47
+    def run_pkg_config(option):
48
+        output = subprocess.check_output(
49
+            ['pkg-config', option, 'poppler-qt5'],
50
+            text=True)
51
+        return output.rstrip()
52
+
53
+    def apply_user_defaults(self, tool):
54
+        # Set include_dirs, library_dirs and libraries based on pkg-config data
55
+        cflags = self.run_pkg_config('--cflags-only-I').split()
56
+        libs = self.run_pkg_config('--libs').split()
57
+        self.include_dirs.extend(
58
+            flag[2:] for flag in cflags if flag.startswith('-I'))
59
+        self.library_dirs.extend(
60
+            flag[2:] for flag in libs if flag.startswith('-L'))
61
+        self.libraries.extend(
62
+            flag[2:] for flag in libs if flag.startswith('-l'))
63
+
64
+        # Generate version.sip file
65
+        if self.poppler_version is not None:
66
+            poppler_qt5_version = self.poppler_version
67
+        else:
68
+            poppler_qt5_version = self.run_pkg_config('--modversion')
69
+        poppler_qt5_version = tuple(map(int, poppler_qt5_version.split('.')))
70
+        python_poppler_qt5_version = self.project.version_str.split('.')
71
+        format_dict = {
72
+            'vlen': 'i' * len(python_poppler_qt5_version),
73
+            'vargs': ', '.join(python_poppler_qt5_version),
74
+            'pvlen': 'i' * len(poppler_qt5_version),
75
+            'pvargs': ', '.join(map(str, poppler_qt5_version)),
76
+        }
77
+        with open('version.sip.in') as template_file:
78
+            version_sip_template = template_file.read()
79
+        with open('version.sip', 'w') as version_file:
80
+            version_file.write(version_sip_template.format(**format_dict))
81
+
82
+        # Add Poppler version tag
83
+        if poppler_qt5_version:
84
+            with open('timeline.sip') as timeline_file:
85
+                timeline = timeline_file.read()
86
+            for match in re.finditer(r'POPPLER_V(\d+)_(\d+)_(\d+)', timeline):
87
+                if poppler_qt5_version < tuple(map(int, match.group(1, 2, 3))):
88
+                    break
89
+                tag = match.group()
90
+        else:
91
+            tag = 'POPPLER_V0_20_0'
92
+        self.tags.append(tag)
93
+        self.tags.append("WS_X11")
94
+        super().apply_user_defaults(tool)
(-)a/graphics/py-python-poppler-qt5/files/patch-pyproject.toml (-42 lines)
Removed Link Here
1
From https://github.com/frescobaldi/python-poppler-qt5/pull/41/commits/4ee58b6ee02772db915fdc5e70e336e0e5b2f34c
2
3
--- pyproject.toml.orig	2020-10-11 18:59:42 UTC
4
+++ pyproject.toml
5
@@ -0,0 +1,37 @@
6
+[build-system]
7
+requires = ["sip >=5", "PyQt-builder", "PyQt5"]
8
+build-backend = "sipbuild.api"
9
+
10
+[tool.sip.metadata]
11
+name = "python-poppler-qt5"
12
+version = "0.75.0"
13
+summary = "A Python binding to Poppler-Qt5"
14
+description-file = "README.rst"
15
+home-page = "https://github.com/frescobaldi/python-poppler-qt5"
16
+maintainer = "Wilbert Berendsen"
17
+maintainer-email = "wbsoft@xs4all.nl"
18
+license = "LGPL"
19
+classifier = [
20
+  "Development Status :: 5 - Production/Stable",
21
+  "Intended Audience :: Developers",
22
+  "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
23
+  "Operating System :: MacOS :: MacOS X",
24
+  "Operating System :: Microsoft :: Windows",
25
+  "Operating System :: POSIX",
26
+  "Programming Language :: Python :: 3",
27
+  "Topic :: Multimedia :: Graphics :: Viewers"
28
+]
29
+requires-dist = "PyQt5"
30
+
31
+[tool.sip.project]
32
+sip-files-dir = "."
33
+sdist-excludes = [
34
+  "version.sip",
35
+  ".git/*",
36
+  ".git/*/*",
37
+  ".git/*/*/*",
38
+  ".git/*/*/*/*",
39
+  ".git/*/*/*/*/*",
40
+  ".git/*/*/*/*/*/*",
41
+  ".git/*/*/*/*/*/*/*"
42
+]
(-)a/graphics/py-python-poppler-qt5/files/patch-types.sip (-60 lines)
Removed Link Here
1
From https://github.com/frescobaldi/python-poppler-qt5/pull/33/commits/6cc4d83b172ffb2d206e696ce508e508cd46b7c3
2
3
--- types.sip.orig	2019-11-22 05:56:45 UTC
4
+++ types.sip
5
@@ -182,7 +182,7 @@ template <TYPE>
6
   if ((l = PyList_New(sipCpp->size())) == NULL)
7
     return NULL;
8
 
9
-  const sipMappedType* qlinkedlist_type = sipFindMappedType("QLinkedList<TYPE>");
10
+  const sipTypeDef* qlinkedlist_type = sipFindType("QLinkedList<TYPE>");
11
 
12
   // Set the list elements.
13
   for (int i = 0; i < sipCpp->size(); ++i)
14
@@ -190,7 +190,7 @@ template <TYPE>
15
     QLinkedList<TYPE>* t = new QLinkedList<TYPE>(sipCpp->at(i));
16
     PyObject *tobj;
17
 
18
-    if ((tobj = sipConvertFromMappedType(t, qlinkedlist_type, sipTransferObj)) == NULL)
19
+    if ((tobj = sipConvertFromType(t, qlinkedlist_type, sipTransferObj)) == NULL)
20
     {
21
       Py_DECREF(l);
22
       delete t;
23
@@ -203,7 +203,7 @@ template <TYPE>
24
 %End
25
 
26
 %ConvertToTypeCode
27
-  const sipMappedType* qlinkedlist_type = sipFindMappedType("QLinkedList<TYPE>");
28
+  const sipTypeDef* qlinkedlist_type = sipFindType("QLinkedList<TYPE>");
29
 
30
   // Check the type if that is all that is required.
31
   if (sipIsErr == NULL)
32
@@ -212,7 +212,7 @@ template <TYPE>
33
       return 0;
34
 
35
     for (int i = 0; i < PySequence_Size(sipPy); ++i)
36
-      if (!sipCanConvertToMappedType(PySequence_ITEM(sipPy, i), qlinkedlist_type, SIP_NOT_NONE))
37
+      if (!sipCanConvertToType(PySequence_ITEM(sipPy, i), qlinkedlist_type, SIP_NOT_NONE))
38
         return 0;
39
 
40
     return 1;
41
@@ -224,16 +224,16 @@ template <TYPE>
42
   for (int i = 0; i < PySequence_Size(sipPy); ++i)
43
   {
44
     int state;
45
-    QLinkedList<TYPE> * t = reinterpret_cast< QLinkedList<TYPE> * >(sipConvertToMappedType(PySequence_ITEM(sipPy, i), qlinkedlist_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
46
+    QLinkedList<TYPE> * t = reinterpret_cast< QLinkedList<TYPE> * >(sipConvertToType(PySequence_ITEM(sipPy, i), qlinkedlist_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
47
 
48
     if (*sipIsErr)
49
     {
50
-      sipReleaseInstance(t, sipClass_TYPE, state);
51
+      sipReleaseType(t, qlinkedlist_type, state);
52
       delete ql;
53
       return 0;
54
     }
55
     ql->append(*t);
56
-    sipReleaseInstance(t, sipClass_TYPE, state);
57
+    sipReleaseType(t, qlinkedlist_type, state);
58
   }
59
 
60
   *sipCppPtr = ql;
(-)a/graphics/py-python-poppler-qt5/files/patch-version.sip.in (-26 lines)
Removed Link Here
1
From https://github.com/frescobaldi/python-poppler-qt5/pull/41/commits/4ee58b6ee02772db915fdc5e70e336e0e5b2f34c
2
3
--- version.sip.in.orig	2020-10-11 18:59:42 UTC
4
+++ version.sip.in
5
@@ -0,0 +1,21 @@
6
+// Generated by project.py -- Do not edit
7
+
8
+PyObject *version();
9
+%Docstring
10
+The version of the popplerqt5 python module.
11
+%End
12
+
13
+PyObject *poppler_version();
14
+%Docstring
15
+The version of the Poppler library it was built with.
16
+%End
17
+
18
+%ModuleCode
19
+
20
+PyObject *version()
21
+{{ return Py_BuildValue("({vlen})", {vargs}); }};
22
+
23
+PyObject *poppler_version()
24
+{{ return Py_BuildValue("({pvlen})", {pvargs}); }};
25
+
26
+%End
(-)b/graphics/py-python-poppler-qt5/pkg-plist (-3 / +3 lines)
Lines 21-26 Link Here
21
%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/version.sip
21
%%PYTHON_SITELIBDIR%%/PyQt5/bindings/popplerqt5/version.sip
22
%%PYTHON_SITELIBDIR%%/popplerqt5%%_PY_SONAME%%.so
22
%%PYTHON_SITELIBDIR%%/popplerqt5%%_PY_SONAME%%.so
23
%%PYTHON_SITELIBDIR%%/popplerqt5.so
23
%%PYTHON_SITELIBDIR%%/popplerqt5.so
24
%%PYTHON_SITELIBDIR%%/python_poppler_qt5-0.75.0.dist-info/INSTALLER
24
%%PYTHON_SITELIBDIR%%/python_poppler_qt5-21.3.0.dist-info/INSTALLER
25
%%PYTHON_SITELIBDIR%%/python_poppler_qt5-0.75.0.dist-info/METADATA
25
%%PYTHON_SITELIBDIR%%/python_poppler_qt5-21.3.0.dist-info/METADATA
26
%%PYTHON_SITELIBDIR%%/python_poppler_qt5-0.75.0.dist-info/RECORD
26
%%PYTHON_SITELIBDIR%%/python_poppler_qt5-21.3.0.dist-info/RECORD

Return to bug 275667