Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/wxpython/, dev-python/wxpython/files/
Date: Sun, 03 Jul 2022 09:51:05
Message-Id: 1656841850.30940b89964a21e240087099e4a7859c4ee9e214.andrewammerlaan@gentoo
1 commit: 30940b89964a21e240087099e4a7859c4ee9e214
2 Author: Thomas Bettler <thomas.bettler <AT> gmail <DOT> com>
3 AuthorDate: Wed Apr 27 17:23:12 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 3 09:50:50 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30940b89
7
8 dev-python/wxpython: apply upstream fix
9
10 Correct types of arguments to ScrolledWindow.SetScrollbars
11 Related: https://github.com/wxWidgets/Phoenix/pull/2005
12
13 Signed-off-by: Thomas Bettler <thomas.bettler <AT> gmail.com>
14 Closes: https://github.com/gentoo/gentoo/pull/25228
15 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
16
17 .../files/wxpython-4.0.7-ultimatelistctrl.patch | 85 ++++++++++++++++++++
18 dev-python/wxpython/wxpython-4.0.7-r2.ebuild | 92 ++++++++++++++++++++++
19 2 files changed, 177 insertions(+)
20
21 diff --git a/dev-python/wxpython/files/wxpython-4.0.7-ultimatelistctrl.patch b/dev-python/wxpython/files/wxpython-4.0.7-ultimatelistctrl.patch
22 new file mode 100644
23 index 000000000000..9d1cc7649e1f
24 --- /dev/null
25 +++ b/dev-python/wxpython/files/wxpython-4.0.7-ultimatelistctrl.patch
26 @@ -0,0 +1,85 @@
27 +From https://github.com/wxWidgets/Phoenix/commit/3eb9eb32dc3285435039f6c420c398665372a1ad
28 +From 3eb9eb32dc3285435039f6c420c398665372a1ad Mon Sep 17 00:00:00 2001
29 +From: Glen Whitney <glen@××××××××××××××.org>
30 +Date: Tue, 31 Aug 2021 11:06:27 -0700
31 +Subject: [PATCH] fix: Correct types of arguments to
32 + ScrolledWindow.SetScrollbars
33 +
34 +---
35 + demo/Mask.py | 2 +-
36 + demo/OGL.py | 2 +-
37 + wx/lib/agw/ultimatelistctrl.py | 14 +++++++-------
38 + 3 files changed, 9 insertions(+), 9 deletions(-)
39 +
40 +diff --git a/demo/Mask.py b/demo/Mask.py
41 +index 5f0c2cdde..109b8f30b 100644
42 +--- a/demo/Mask.py
43 ++++ b/demo/Mask.py
44 +@@ -56,7 +56,7 @@ def __init__(self, parent):
45 + mask = wx.Mask(self.bmp_withcolourmask, wx.WHITE)
46 + self.bmp_withcolourmask.SetMask(mask)
47 +
48 +- self.SetScrollbars(20, 20, 700/20, 460/20)
49 ++ self.SetScrollbars(20, 20, 700//20, 460//20)
50 +
51 + self.Bind(wx.EVT_PAINT, self.OnPaint)
52 +
53 +diff --git a/demo/OGL.py b/demo/OGL.py
54 +index 72ca543dd..d475e5011 100644
55 +--- a/demo/OGL.py
56 ++++ b/demo/OGL.py
57 +@@ -272,7 +272,7 @@ def __init__(self, parent, log, frame):
58 +
59 + maxWidth = 1000
60 + maxHeight = 1000
61 +- self.SetScrollbars(20, 20, maxWidth/20, maxHeight/20)
62 ++ self.SetScrollbars(20, 20, maxWidth//20, maxHeight//20)
63 +
64 + self.log = log
65 + self.frame = frame
66 +diff --git a/wx/lib/agw/ultimatelistctrl.py b/wx/lib/agw/ultimatelistctrl.py
67 +index c60867684..14fc41f86 100644
68 +--- a/wx/lib/agw/ultimatelistctrl.py
69 ++++ b/wx/lib/agw/ultimatelistctrl.py
70 +@@ -9654,8 +9654,8 @@ def RecalculatePositions(self, noRefresh=False):
71 + self._linesPerPage = clientHeight//lineHeight
72 +
73 + self.SetScrollbars(SCROLL_UNIT_X, lineHeight,
74 +- (self.GetHeaderWidth()-decrement)/SCROLL_UNIT_X,
75 +- (entireHeight + lineHeight - 1)/lineHeight,
76 ++ (self.GetHeaderWidth()-decrement)//SCROLL_UNIT_X,
77 ++ (entireHeight + lineHeight - 1)//lineHeight,
78 + self.GetScrollPos(wx.HORIZONTAL),
79 + self.GetScrollPos(wx.VERTICAL),
80 + True)
81 +@@ -9676,8 +9676,8 @@ def RecalculatePositions(self, noRefresh=False):
82 + decrement = SCROLL_UNIT_X
83 +
84 + self.SetScrollbars(SCROLL_UNIT_X, SCROLL_UNIT_Y,
85 +- (self.GetHeaderWidth()-decrement)/SCROLL_UNIT_X,
86 +- (entireHeight + SCROLL_UNIT_Y - 1)/SCROLL_UNIT_Y,
87 ++ (self.GetHeaderWidth()-decrement)//SCROLL_UNIT_X,
88 ++ (entireHeight + SCROLL_UNIT_Y - 1)//SCROLL_UNIT_Y,
89 + self.GetScrollPos(wx.HORIZONTAL),
90 + self.GetScrollPos(wx.VERTICAL),
91 + True)
92 +@@ -9728,8 +9728,8 @@ def RecalculatePositions(self, noRefresh=False):
93 + line._gi.ExtendWidth(widthMax)
94 +
95 + self.SetScrollbars(SCROLL_UNIT_X, lineHeight,
96 +- (x + SCROLL_UNIT_X)/SCROLL_UNIT_X,
97 +- (y + lineHeight)/lineHeight,
98 ++ (x + SCROLL_UNIT_X)//SCROLL_UNIT_X,
99 ++ (y + lineHeight)//lineHeight,
100 + self.GetScrollPos(wx.HORIZONTAL),
101 + self.GetScrollPos(wx.VERTICAL),
102 + True)
103 +@@ -9797,7 +9797,7 @@ def RecalculatePositions(self, noRefresh=False):
104 + break # Everything fits, no second try required.
105 +
106 + self.SetScrollbars(SCROLL_UNIT_X, lineHeight,
107 +- (entireWidth + SCROLL_UNIT_X)/SCROLL_UNIT_X,
108 ++ (entireWidth + SCROLL_UNIT_X)//SCROLL_UNIT_X,
109 + 0,
110 + self.GetScrollPos(wx.HORIZONTAL),
111 + 0,
112
113 diff --git a/dev-python/wxpython/wxpython-4.0.7-r2.ebuild b/dev-python/wxpython/wxpython-4.0.7-r2.ebuild
114 new file mode 100644
115 index 000000000000..2e17a2286297
116 --- /dev/null
117 +++ b/dev-python/wxpython/wxpython-4.0.7-r2.ebuild
118 @@ -0,0 +1,92 @@
119 +# Copyright 1999-2022 Gentoo Authors
120 +# Distributed under the terms of the GNU General Public License v2
121 +
122 +EAPI=8
123 +PYTHON_COMPAT=( python3_{8..10} )
124 +WX_GTK_VER="3.0-gtk3"
125 +
126 +DISTUTILS_IN_SOURCE_BUILD="1"
127 +
128 +inherit distutils-r1 multiprocessing virtualx wxwidgets
129 +
130 +MY_PN="wxPython"
131 +MY_PV="${PV}.post2"
132 +
133 +DESCRIPTION="A blending of the wxWindows C++ class library with Python"
134 +HOMEPAGE="https://www.wxpython.org/"
135 +SRC_URI="mirror://pypi/${P:0:1}/${MY_PN}/${MY_PN}-${MY_PV}.tar.gz"
136 +
137 +LICENSE="wxWinLL-3"
138 +SLOT="4.0"
139 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
140 +IUSE="test webkit"
141 +# Tests broken: #726812, #722716
142 +RESTRICT="test"
143 +#RESTRICT="!test? ( test )"
144 +
145 +# wxPython doesn't seem to be able to optionally disable features. webkit is
146 +# optionally patched out because it's so huge, but other elements are not,
147 +# which makes us have to require all features from wxGTK
148 +RDEPEND="
149 + >=x11-libs/wxGTK-3.0.4-r301:${WX_GTK_VER}=[gstreamer,libnotify,opengl,sdl,tiff,webkit?,X]
150 + media-libs/libpng:0=
151 + media-libs/tiff:0
152 + media-libs/libjpeg-turbo:0"
153 +
154 +BDEPEND="${RDEPEND}
155 + app-doc/doxygen
156 + dev-python/setuptools[${PYTHON_USEDEP}]
157 + dev-python/six[${PYTHON_USEDEP}]
158 + test? (
159 + ${VIRTUALX_DEPEND}
160 + dev-python/appdirs[${PYTHON_USEDEP}]
161 + dev-python/numpy[${PYTHON_USEDEP}]
162 + dev-python/pillow[${PYTHON_USEDEP}]
163 + dev-python/pytest[${PYTHON_USEDEP}]
164 + )"
165 +
166 +S="${WORKDIR}/${MY_PN}-${MY_PV}"
167 +
168 +PATCHES=(
169 + "${FILESDIR}/${PN}-4.0.6-skip-broken-tests.patch"
170 + "${FILESDIR}/${P}-ultimatelistctrl.patch"
171 +)
172 +
173 +python_prepare_all() {
174 + if ! use webkit; then
175 + eapply "${FILESDIR}/${PN}-4.0.6-no-webkit.patch"
176 + rm unittests/test_webview.py || die
177 + fi
178 + # Most of these tests disabled below fail because of the virtx/portage
179 + # environment, but some fail for unknown reasons.
180 + rm unittests/test_uiaction.py \
181 + unittests/test_notifmsg.py \
182 + unittests/test_mousemanager.py \
183 + unittests/test_display.py \
184 + unittests/test_pi_import.py \
185 + unittests/test_lib_agw_thumbnailctrl.py \
186 + unittests/test_sound.py || die
187 +
188 + distutils-r1_python_prepare_all
189 +}
190 +
191 +src_configure() {
192 + setup-wxwidgets
193 +}
194 +
195 +python_compile() {
196 + DOXYGEN=/usr/bin/doxygen ${PYTHON} build.py dox etg --nodoc || die
197 + ${PYTHON} build.py build_py \
198 + --use_syswx \
199 + --no_magic \
200 + --jobs=$(makeopts_jobs) \
201 + --release || die
202 +}
203 +
204 +python_install() {
205 + distutils-r1_python_install --skip-build
206 +}
207 +
208 +python_test() {
209 + virtx epytest unittests
210 +}