1
0
python-wxPython/additional-310-fixes.patch
Jan Engelhardt ff0538714f Accepting request 943732 from home:mcepl:branches:X11:wxWidgets
- Add additional patches fixing the situation with Python 3.10
  compatibility:
  - 2039-bunch-py310-fixes.patch (from gh#wxWidgets/Phoenix#2039)
  - additional-310-fixes.patch (from various commits on master)
- Split out the TW python3 flavors into multibuild using the
  python_subpackage_only mechanism: Multiple python3 flavors
  sequentially require too much space and time in one build.

OBS-URL: https://build.opensuse.org/request/show/943732
OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/python-wxPython?expand=0&rev=29
2022-01-04 11:27:04 +00:00

84 lines
3.6 KiB
Diff

---
docker/build/ubuntu-18.04/Dockerfile | 4 +++-
docker/build/ubuntu-20.04/Dockerfile | 2 +-
wx/lib/agw/flatnotebook.py | 14 +++++++-------
wx/svg/__init__.py | 4 ++--
4 files changed, 13 insertions(+), 11 deletions(-)
--- a/docker/build/ubuntu-18.04/Dockerfile
+++ b/docker/build/ubuntu-18.04/Dockerfile
@@ -53,6 +53,7 @@ RUN \
apt-get install -y python3.7 python3.7-dev libpython3.7-dev python3.7-venv; \
apt-get install -y python3.8 python3.8-dev libpython3.8-dev python3.8-venv; \
apt-get install -y python3.9 python3.9-dev libpython3.9-dev python3.9-venv; \
+ apt-get install -y python3.10 python3.10-dev libpython3.10-dev python3.10-venv; \
apt-get clean;
# Add files from host into the container
@@ -72,7 +73,8 @@ RUN \
python3.6 -m venv venvs/Py36; \
python3.7 -m venv venvs/Py37; \
python3.8 -m venv venvs/Py38; \
- python3.9 -m venv venvs/Py39;
+ python3.9 -m venv venvs/Py39; \
+ python3.10 -m venv venvs/Py310;
# Define default command
CMD ["/bin/bash", "-l"]
--- a/docker/build/ubuntu-20.04/Dockerfile
+++ b/docker/build/ubuntu-20.04/Dockerfile
@@ -3,7 +3,7 @@ FROM ubuntu:20.04
# Set environment variables
ENV DIST_NAME=ubuntu-20.04
-ENV USE_DEADSNAKES=no
+ENV USE_DEADSNAKES=yes
ENV USER=wxpy
ENV HOME=/home/$USER
ENV PYTHONUNBUFFERED=1
--- a/wx/lib/agw/flatnotebook.py
+++ b/wx/lib/agw/flatnotebook.py
@@ -925,14 +925,14 @@ def DrawButton(dc, rect, focus, upperTab
if focus:
if upperTabs:
- leftPt = wx.Point(rect.x, rect.y + (rect.height / 10)*8)
- rightPt = wx.Point(rect.x + rect.width - 2, rect.y + (rect.height / 10)*8)
+ leftPt = wx.Point(rect.x, int(rect.y + (rect.height / 10)*8))
+ rightPt = wx.Point(rect.x + rect.width - 2, int(rect.y + (rect.height / 10)*8))
else:
- leftPt = wx.Point(rect.x, rect.y + (rect.height / 10)*5)
- rightPt = wx.Point(rect.x + rect.width - 2, rect.y + (rect.height / 10)*5)
+ leftPt = wx.Point(rect.x, int(rect.y + (rect.height / 10)*5))
+ rightPt = wx.Point(rect.x + rect.width - 2, int(rect.y + (rect.height / 10)*5))
else:
- leftPt = wx.Point(rect.x, rect.y + (rect.height / 2))
- rightPt = wx.Point(rect.x + rect.width - 2, rect.y + (rect.height / 2))
+ leftPt = wx.Point(rect.x, int(rect.y + (rect.height / 2)))
+ rightPt = wx.Point(rect.x + rect.width - 2, int(rect.y + (rect.height / 2)))
# Define the top region
top = wx.Rect(rect.GetTopLeft(), rightPt)
@@ -2765,7 +2765,7 @@ class FNBRendererFirefox2(FNBRenderer):
if pageTextColour is not None:
dc.SetTextForeground(pageTextColour)
- dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
+ dc.DrawText(pc.GetPageText(tabIdx), int(posx + textOffset), imageYCoord)
# draw 'x' on tab (if enabled)
if pc.HasAGWFlag(FNB_X_ON_TAB) and tabIdx == pc.GetSelection():
--- a/wx/svg/__init__.py
+++ b/wx/svg/__init__.py
@@ -132,8 +132,8 @@ class SVGimage(SVGimageBase):
"""
size = wx.Size(*size)
if window:
- size.width *= window.GetContentScaleFactor()
- size.height *= window.GetContentScaleFactor()
+ size.width = int(size.width * window.GetContentScaleFactor())
+ size.height = int(size.height * window.GetContentScaleFactor())
# We can only have one overall scale factor for both dimensions with
# this rasterization method, so chose either the minimum of width or