summaryrefslogtreecommitdiff
path: root/games/pysolfc
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2019-11-13 05:24:26 +0100
committerRobby Workman <rworkman@slackbuilds.org>2021-04-17 23:54:38 -0500
commit7f21051b0f6bc3c1a72d987cae4cfdb0e0c83890 (patch)
tree64bc6f5144a937642f297f2f1e04d9d8a0967e1b /games/pysolfc
parent0671ab3f1a2bfd3fea28bc690368ebe7a3e54a02 (diff)
downloadslackbuilds-7f21051b0f6bc3c1a72d987cae4cfdb0e0c83890.tar.gz
games/pysolfc: Patched for pillow-6.x.
Thanks to TheRealGrogan on LQ! Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'games/pysolfc')
-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,