1 |
commit: 391043355ed36e52482392f1911d4f0513d8d0a6 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Dec 28 14:49:23 2021 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 29 15:41:21 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=39104335 |
7 |
|
8 |
kde-apps/kajongg: Fix running with Python 3.10 |
9 |
|
10 |
See also: https://invent.kde.org/games/kajongg/-/merge_requests/6 |
11 |
|
12 |
Upstream commit b647417e16f6146f4ae89608fd0494e7780da862 |
13 |
|
14 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
15 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
16 |
|
17 |
.../kajongg/files/kajongg-21.08.3-python3.10.patch | 109 +++++++++++++++++++++ |
18 |
...gg-21.08.3.ebuild => kajongg-21.08.3-r1.ebuild} | 2 + |
19 |
...gg-21.12.0.ebuild => kajongg-21.12.0-r1.ebuild} | 2 + |
20 |
3 files changed, 113 insertions(+) |
21 |
|
22 |
diff --git a/kde-apps/kajongg/files/kajongg-21.08.3-python3.10.patch b/kde-apps/kajongg/files/kajongg-21.08.3-python3.10.patch |
23 |
new file mode 100644 |
24 |
index 000000000000..d9f7e100309d |
25 |
--- /dev/null |
26 |
+++ b/kde-apps/kajongg/files/kajongg-21.08.3-python3.10.patch |
27 |
@@ -0,0 +1,109 @@ |
28 |
+From b647417e16f6146f4ae89608fd0494e7780da862 Mon Sep 17 00:00:00 2001 |
29 |
+From: Antonio Rojas <arojas@×××××××××.org> |
30 |
+Date: Sat, 18 Dec 2021 10:13:32 +0000 |
31 |
+Subject: [PATCH] Fix running with Python 3.10 |
32 |
+ |
33 |
+--- |
34 |
+ src/board.py | 10 +++++----- |
35 |
+ src/genericdelegates.py | 2 +- |
36 |
+ src/humanclient.py | 4 ++-- |
37 |
+ src/qtreactor.py | 2 +- |
38 |
+ src/uitile.py | 4 ++-- |
39 |
+ 5 files changed, 11 insertions(+), 11 deletions(-) |
40 |
+ |
41 |
+diff --git a/src/board.py b/src/board.py |
42 |
+index 2f52a47d..ed432c22 100644 |
43 |
+--- a/src/board.py |
44 |
++++ b/src/board.py |
45 |
+@@ -102,7 +102,7 @@ class PlayerWind(AnimatedMixin, QGraphicsObject, StrMixin): |
46 |
+ """paint the marker""" |
47 |
+ with Painter(painter): |
48 |
+ painter.setBrush(self.__brush) |
49 |
+- size = Internal.scene.windTileset.faceSize.height() |
50 |
++ size = int(Internal.scene.windTileset.faceSize.height()) |
51 |
+ ellRect = QRectF(QPoint(), QPoint(size, size)) |
52 |
+ painter.drawEllipse(ellRect) |
53 |
+ renderer = Internal.scene.windTileset.renderer() |
54 |
+@@ -112,7 +112,7 @@ class PlayerWind(AnimatedMixin, QGraphicsObject, StrMixin): |
55 |
+ |
56 |
+ def boundingRect(self): # pylint: disable=no-self-use |
57 |
+ """define the part of the tile we want to see""" |
58 |
+- size = Internal.scene.windTileset.faceSize.height() * 1.1 |
59 |
++ size = int(Internal.scene.windTileset.faceSize.height() * 1.1) |
60 |
+ return QRectF(QPoint(), QPoint(size, size)) |
61 |
+ |
62 |
+ def __str__(self): |
63 |
+@@ -878,11 +878,11 @@ class FittingView(QGraphicsView): |
64 |
+ tRect = uiTile.boundingRect() |
65 |
+ tRect = self.viewportTransform().mapRect(tRect) |
66 |
+ pmapSize = QSize( |
67 |
+- tRect.width() * uiTile.scale, |
68 |
+- tRect.height() * uiTile.scale) |
69 |
++ int(tRect.width() * uiTile.scale), |
70 |
++ int(tRect.height() * uiTile.scale)) |
71 |
+ pMap = uiTile.pixmapFromSvg(pmapSize) |
72 |
+ drag.setPixmap(pMap) |
73 |
+- drag.setHotSpot(QPoint(pMap.width() / 2, pMap.height() / 2)) |
74 |
++ drag.setHotSpot(QPoint(int(pMap.width() / 2), int(pMap.height() / 2))) |
75 |
+ return drag |
76 |
+ |
77 |
+ |
78 |
+diff --git a/src/genericdelegates.py b/src/genericdelegates.py |
79 |
+index be99eb57..a4521177 100644 |
80 |
+--- a/src/genericdelegates.py |
81 |
++++ b/src/genericdelegates.py |
82 |
+@@ -64,7 +64,7 @@ class RichTextColumnDelegate(QStyledItemDelegate): |
83 |
+ text = index.model().data(index) |
84 |
+ self.document.setDefaultFont(option.font) |
85 |
+ self.document.setHtml(text) |
86 |
+- return QSize(self.document.idealWidth() + 5, |
87 |
++ return QSize(int(self.document.idealWidth()) + 5, |
88 |
+ option.fontMetrics.height()) |
89 |
+ |
90 |
+ |
91 |
+diff --git a/src/humanclient.py b/src/humanclient.py |
92 |
+index 1d3f58f3..8edf848b 100644 |
93 |
+--- a/src/humanclient.py |
94 |
++++ b/src/humanclient.py |
95 |
+@@ -321,8 +321,8 @@ class ClientDialog(QDialog): |
96 |
+ idx if vertical else 0, |
97 |
+ idx if not vertical else 0) |
98 |
+ |
99 |
+- geometry.setWidth(width) |
100 |
+- geometry.setHeight(height) |
101 |
++ geometry.setWidth(int(width)) |
102 |
++ geometry.setHeight(int(height)) |
103 |
+ self.setGeometry(geometry) |
104 |
+ |
105 |
+ def showEvent(self, dummyEvent): |
106 |
+diff --git a/src/qtreactor.py b/src/qtreactor.py |
107 |
+index bda4782f..c24d01d0 100644 |
108 |
+--- a/src/qtreactor.py |
109 |
++++ b/src/qtreactor.py |
110 |
+@@ -250,7 +250,7 @@ class QtReactor(posixbase.PosixReactorBase): |
111 |
+ timeout = 0 |
112 |
+ else: |
113 |
+ timeout = self.timeout() |
114 |
+- self._timer.setInterval(timeout * 1000) |
115 |
++ self._timer.setInterval(int(timeout * 1000)) |
116 |
+ self._timer.start() |
117 |
+ |
118 |
+ def runReturn(self, installSignalHandlers=True): |
119 |
+diff --git a/src/uitile.py b/src/uitile.py |
120 |
+index 57e322bb..9e4b3f9d 100644 |
121 |
+--- a/src/uitile.py |
122 |
++++ b/src/uitile.py |
123 |
+@@ -250,8 +250,8 @@ class UITile(AnimatedMixin, QGraphicsObject, StrMixin): |
124 |
+ if self.showFace(): |
125 |
+ faceSize = self.tileset.faceSize.toSize() |
126 |
+ faceSize = QSize( |
127 |
+- faceSize.width() * xScale, |
128 |
+- faceSize.height() * yScale) |
129 |
++ int(faceSize.width() * xScale), |
130 |
++ int(faceSize.height() * yScale)) |
131 |
+ painter.translate(self.facePos()) |
132 |
+ renderer.render(painter, self.tileset.svgName[self.tile.exposed], |
133 |
+ QRectF(QPointF(), QSizeF(faceSize))) |
134 |
+-- |
135 |
+GitLab |
136 |
+ |
137 |
|
138 |
diff --git a/kde-apps/kajongg/kajongg-21.08.3.ebuild b/kde-apps/kajongg/kajongg-21.08.3-r1.ebuild |
139 |
similarity index 95% |
140 |
rename from kde-apps/kajongg/kajongg-21.08.3.ebuild |
141 |
rename to kde-apps/kajongg/kajongg-21.08.3-r1.ebuild |
142 |
index 7bb25ba3b606..254228048ce3 100644 |
143 |
--- a/kde-apps/kajongg/kajongg-21.08.3.ebuild |
144 |
+++ b/kde-apps/kajongg/kajongg-21.08.3-r1.ebuild |
145 |
@@ -37,6 +37,8 @@ RDEPEND="${DEPEND} |
146 |
>=kde-apps/libkmahjongg-${PVCUT}:5 |
147 |
" |
148 |
|
149 |
+PATCHES=( "${FILESDIR}/${P}-python3.10.patch" ) |
150 |
+ |
151 |
pkg_setup() { |
152 |
python-single-r1_pkg_setup |
153 |
ecm_pkg_setup |
154 |
|
155 |
diff --git a/kde-apps/kajongg/kajongg-21.12.0.ebuild b/kde-apps/kajongg/kajongg-21.12.0-r1.ebuild |
156 |
similarity index 94% |
157 |
rename from kde-apps/kajongg/kajongg-21.12.0.ebuild |
158 |
rename to kde-apps/kajongg/kajongg-21.12.0-r1.ebuild |
159 |
index e6e07170fdd6..698f5a8e9bcd 100644 |
160 |
--- a/kde-apps/kajongg/kajongg-21.12.0.ebuild |
161 |
+++ b/kde-apps/kajongg/kajongg-21.12.0-r1.ebuild |
162 |
@@ -37,6 +37,8 @@ RDEPEND="${DEPEND} |
163 |
>=kde-apps/libkmahjongg-${PVCUT}:5 |
164 |
" |
165 |
|
166 |
+PATCHES=( "${FILESDIR}/${PN}-21.08.3-python3.10.patch" ) |
167 |
+ |
168 |
pkg_setup() { |
169 |
python-single-r1_pkg_setup |
170 |
ecm_pkg_setup |