You've already forked macports-ports
mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
py-Pillow: added patch to restore PyQt5 and PySide2 functionality
This commit is contained in:
committed by
Renee Otten
parent
6aa17fc917
commit
22fb791c40
@@ -59,7 +59,7 @@ if {${name} ne ${subport}} {
|
||||
}
|
||||
} else {
|
||||
distname pillow-${version}
|
||||
patchfiles-append patch-setup.py.diff
|
||||
patchfiles-append patch-setup.py.diff patch-ImageQt.py.diff
|
||||
|
||||
build.args-append -C raqm=disable \
|
||||
-C imagequant=disable \
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--- src/PIL/ImageQt.py
|
||||
+++ src/PIL/ImageQt.py
|
||||
@@ -36,6 +36,8 @@ qt_version: str | None
|
||||
qt_versions = [
|
||||
["6", "PyQt6"],
|
||||
["side6", "PySide6"],
|
||||
+ ["5", "PyQt5"],
|
||||
+ ["side2", "PySide2"],
|
||||
]
|
||||
|
||||
# If a version has already been imported, attempt it first
|
||||
@@ -53,6 +55,12 @@ for version, qt_module in qt_versions:
|
||||
QIODevice,
|
||||
)
|
||||
from PySide6.QtGui import QImage, QPixmap, qRgba # type: ignore[assignment]
|
||||
+ elif qt_module == "PyQt5":
|
||||
+ from PyQt5.QtCore import QBuffer, QByteArray, QIODevice
|
||||
+ from PyQt5.QtGui import QImage, QPixmap, qRgba
|
||||
+ elif qt_module == "PySide2":
|
||||
+ from PySide2.QtCore import QBuffer, QByteArray, QIODevice
|
||||
+ from PySide2.QtGui import QImage, QPixmap, qRgba
|
||||
except (ImportError, RuntimeError):
|
||||
continue
|
||||
qt_is_installed = True
|
||||
Reference in New Issue
Block a user