aboutsummaryrefslogtreecommitdiff
path: root/games/pysolfc
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-12-28 12:39:52 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-01-04 07:55:38 +0700
commit05cc9a566d50e97766d64c886d4de71dc2c998c2 (patch)
tree4503f52cd3be83429287a077129732a601062365 /games/pysolfc
parentd5679d839ed72dc3819674fb4f241593e06ba9c8 (diff)
games/pysolfc: Updated for version 2.14.1.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/pysolfc')
-rw-r--r--games/pysolfc/README18
-rw-r--r--games/pysolfc/pillow6.patch47
-rw-r--r--games/pysolfc/pysolfc.SlackBuild91
-rw-r--r--games/pysolfc/pysolfc.info12
4 files changed, 53 insertions, 115 deletions
diff --git a/games/pysolfc/README b/games/pysolfc/README
index e170010803f7..d3fca33e2538 100644
--- a/games/pysolfc/README
+++ b/games/pysolfc/README
@@ -5,13 +5,17 @@ PySolFC (PySol Fanclub Edition) is a solitaire suite containing over
There are games that use the 52 card International Pattern deck,
games for the 78 card Tarock deck, eight and ten suite Ganjifa games,
-Hanafuda games, Matrix games, Mahjongg games, and games for an original
-hexadecimal-based deck. PySolFC features a modern look and feel,
-multiple cardsets and backgrounds, sound, unlimited undo, player
+Hanafuda games, Matrix games, Mahjongg games, and games for an
+original hexadecimal-based deck. PySolFC features a modern look and
+feel, multiple cardsets and backgrounds, sound, unlimited undo, player
statistics, and much more.
-PySolFC comes with several different cardsets, but there
-are many optional cardsets available. These can be found in
-games/pysolfc-extra-cardsets.
-
PySolFC is distributed under the terms of the GNU GPL.
+
+Optional dependencies:
+
+- games/pysolfc-extra-cardsets
+ Extra cardsets, including large-sized ones for high-res displays.
+
+- python/pygame
+ Required if you want pysolfc to make sound.
diff --git a/games/pysolfc/pillow6.patch b/games/pysolfc/pillow6.patch
deleted file mode 100644
index 80f0f1868e1b..000000000000
--- a/games/pysolfc/pillow6.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-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 7bfc1d74c0bc..1c8b838b4b44 100644
--- a/games/pysolfc/pysolfc.SlackBuild
+++ b/games/pysolfc/pysolfc.SlackBuild
@@ -2,28 +2,18 @@
# Slackware build script for pysolfc
-# Copyright 2009 Matthew "mfillpot" Fillpot
-# All rights reserved.
-#
-# Redistribution and use of this script, with or without modification, is
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of this script must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Originally written by Matthew "mfillpot" Fillpot.
# Now maintained by B. Watson <yalhcru@gmail.com>
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# 20211228 bkw: update for v2.14.1.
+# - relicensed as WTFPL with permission from Matthew.
+# - we now use python3 and -current's python-pillow, no need for
+# pillow6 patch, six, etc.
+# - document optional dep pygame in README.
+
# 20181206 bkw:
# - Add missing 'six' dependency. Thanks to Carsten Boysen Jensen for
# the bug report. BUILD=2
@@ -46,8 +36,8 @@ SRCNAM=PySolFC
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=pysolfc
-VERSION=${VERSION:-2.4.0}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-2.14.1}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -62,9 +52,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -76,36 +63,28 @@ OUTPUT=${OUTPUT:-/tmp}
set -e
+fixperms() {
+ chown -R root:root $1
+ find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+}
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM-$VERSION
-tar xvf $CWD/$SRCNAM-$VERSION.tar.xz
+tar xvf $CWD/$SRCNAM-$VERSION.tar.?z
cd $SRCNAM-$VERSION
-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,
-# which ships with python2 (included in Slackware). With 2.4.0, they've
-# ported the code so it's python3-compatible (though it still works
-# with python2). The python3 random library is API-incompatible with
-# the python2 one... so someone ported the python2 random to python3
-# and named it 'random2'. random2 is also python2-compatible... so the
-# PySolFC devs changed their code to require random2, even on python
-# 2. So I'm changing it back, to avoid adding an extra (redundant) dependency.
-# The reason for going into such detail about it here, is that maintainers
-# of other python-based packages might run into the same issue someday.
-# I'll have a handy URL to point them to with the fix.
-# Here endeth the rant.
-
-sed -i 's,\<random2\>,random,' pysollib/pysolrandom.py
-
-python setup.py install --root $PKG
+fixperms .
+
+# do not use 'make install', it has no way to pass --root to setup.py.
+# "mo" creates the UI translations. "rules" and "all_games_html" make
+# the docs. setup.py will install the docs & translations if they
+# exist.
+make mo
+make rules
+make all_games_html
+python3 setup.py install --root $PKG
mkdir -p $PKG/usr/man/man6
gzip -9c < docs/$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
@@ -117,14 +96,16 @@ ln -s $PRGNAM.6.gz $PKG/usr/man/man6/pysol.py.6
# The minimal cardsets are now required, since the source tarball
# has none. Extract directly to $PKG instead of extracting and copying.
tar xvf $CWD/$CARDSETS.tar.xz -C $PKG/usr/share/$SRCNAM/ --strip-components=1
+fixperms $PKG/usr/share/$SRCNAM
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a README.md COPYING docs/README $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+# old-style icon, in case something needs it.
+mkdir -p $PKG/usr/share/pixmaps
+ln -s ../icons/hicolor/48x48/apps/pysol.png $PKG/usr/share/pixmaps/pysol.png
-# Handy HTML list of all the games, but with hardcoded (wrong) paths.
-sed '/href=/s,"[^"]*/data,"/usr/share/'$SRCNAM, docs/all_games.html > \
- $PKG/usr/doc/$PRGNAM-$VERSION/all_games.html
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a contrib/*.asciidoc *.md NEWS.* COPYING docs/README $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
diff --git a/games/pysolfc/pysolfc.info b/games/pysolfc/pysolfc.info
index c853cad8cda4..6ea78e6e3352 100644
--- a/games/pysolfc/pysolfc.info
+++ b/games/pysolfc/pysolfc.info
@@ -1,12 +1,12 @@
PRGNAM="pysolfc"
-VERSION="2.4.0"
-HOMEPAGE="https://pysolfc.sourceforge.net"
-DOWNLOAD="https://downloads.sourceforge.net/project/pysolfc/PySolFC/PySolFC-2.4.0/PySolFC-2.4.0.tar.xz \
- https://downloads.sourceforge.net/pysolfc/PySolFC-Cardsets--Minimal-2.0.tar.xz"
-MD5SUM="43d3a6f82418a9cb7452ab7bc0e1401b \
+VERSION="2.14.1"
+HOMEPAGE="https://pysolfc.sourceforge.io"
+DOWNLOAD="https://github.com/shlomif/PySolFC/archive/2.14.1/PySolFC-2.14.1.tar.gz \
+ https://downloads.sourceforge.net/pysolfc/PySolFC-Cardsets--Minimal-2.0.tar.xz"
+MD5SUM="c833407fc80c6f175d16616ba1533610 \
85c0edeeb0e319d54f9ebcd4165a2077"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES=""
+REQUIRES="configobj python3-attrs"
MAINTAINER="B. Watson"
EMAIL="yalhcru@gmail.com"