summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Matteo Bernardini2019-11-13 05:24:26 +0100
committer Matteo Bernardini2021-02-27 10:48:32 +0100
commit63ab7abc19900c18333de822d973e64995d7745a (patch)
treebeabd7d9966b33f5b844464f9b720675f9664a09
parent9aa1498acb0841d4ce656319a4de5cc157b4e2ed (diff)
downloadslackbuilds-pysolfc.tar.gz
games/pysolfc: Patched for pillow-6.x.pysolfc
Thanks to TheRealGrogan on LQ! Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r--games/pysolfc/pillow6.patch47
-rw-r--r--games/pysolfc/pysolfc.SlackBuild2
2 files changed, 49 insertions, 0 deletions
diff --git a/games/pysolfc/pillow6.patch b/games/pysolfc/pillow6.patch
new file mode 100644
index 0000000000..80f0f1868e
--- /dev/null
+++ b/games/pysolfc/pillow6.patch
@@ -0,0 +1,47 @@
+From fa20e7f834a1385f383f09a3aa8f4fb4bb86da18 Mon Sep 17 00:00:00 2001
+From: Shlomi Fish <shlomif@shlomifish.org>
+Date: Fri, 5 Apr 2019 17:13:13 +0300
+Subject: [PATCH] Try fixing issue #108 - compat with pillow 6.0
+
+See https://github.com/shlomif/PySolFC/issues/108 .
+---
+ pysollib/mfxutil.py | 2 +-
+ pysollib/ui/tktile/tkutil.py | 11 +++--------
+ 2 files changed, 4 insertions(+), 9 deletions(-)
+
+diff --git a/pysollib/mfxutil.py b/pysollib/mfxutil.py
+index a0d0aed4..f461ed10 100644
+--- a/pysollib/mfxutil.py
++++ b/pysollib/mfxutil.py
+@@ -51,7 +51,7 @@
+ from PIL import PpmImagePlugin # noqa: F401
+ Image._initialized = 2
+ USE_PIL = False
+-if TOOLKIT == 'tk' and Image and Image.VERSION >= '1.1.7':
++if TOOLKIT == 'tk' and Image:
+ USE_PIL = True
+
+ # debug
+diff --git a/pysollib/ui/tktile/tkutil.py b/pysollib/ui/tktile/tkutil.py
+index af43130a..0319e6d3 100644
+--- a/pysollib/ui/tktile/tkutil.py
++++ b/pysollib/ui/tktile/tkutil.py
+@@ -353,15 +353,10 @@ def shadowImage(image, color='#3896f8', factor=0.3):
+ if not hasattr(image, '_pil_image'):
+ return None
+ im = image._pil_image
+- if Image.VERSION >= '1.1.7':
+- # use an alpha image
+- sh = Image.new('RGBA', im.size, color)
+- sh.putalpha(100)
+- out = Image.composite(sh, im, im)
+- return PIL_Image(image=out)
++ # use an alpha image
+ sh = Image.new('RGBA', im.size, color)
+- tmp = Image.blend(im, sh, factor)
+- out = Image.composite(tmp, im, im)
++ sh.putalpha(100)
++ out = Image.composite(sh, im, im)
+ return PIL_Image(image=out)
+
+
diff --git a/games/pysolfc/pysolfc.SlackBuild b/games/pysolfc/pysolfc.SlackBuild
index 02ef038041..1c2b20b606 100644
--- a/games/pysolfc/pysolfc.SlackBuild
+++ b/games/pysolfc/pysolfc.SlackBuild
@@ -76,6 +76,8 @@ chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+patch -p1 < $CWD/pillow6.patch
+
# 20181012 bkw: Slightly dirty hack, to combat a dirty hack from upstream.
# Begin rant:
# Basically, the old versions of pysol used the python 'random' library,