diff options
Diffstat (limited to 'games-board')
-rw-r--r-- | games-board/Manifest.gz | bin | 9874 -> 9873 bytes | |||
-rw-r--r-- | games-board/pysolfc/Manifest | 2 | ||||
-rw-r--r-- | games-board/pysolfc/files/pysolfc-2.20.1-pillow-10.patch | 138 | ||||
-rw-r--r-- | games-board/pysolfc/pysolfc-2.20.1-r1.ebuild | 72 |
4 files changed, 212 insertions, 0 deletions
diff --git a/games-board/Manifest.gz b/games-board/Manifest.gz Binary files differindex 8f28b52bafa3..f0d2b09f0b70 100644 --- a/games-board/Manifest.gz +++ b/games-board/Manifest.gz diff --git a/games-board/pysolfc/Manifest b/games-board/pysolfc/Manifest index 9e595391e6f0..3d89c271f43a 100644 --- a/games-board/pysolfc/Manifest +++ b/games-board/pysolfc/Manifest @@ -1,5 +1,7 @@ +AUX pysolfc-2.20.1-pillow-10.patch 5219 BLAKE2B fe4309ba3d037b15f73332cab0495f963ed5a3abbaa68e16b65d6536d3b88ba227022ac6b3bfad7f582f3443db32d7c3248c5b2bcfaa9a3cb44dc306b83d1ee6 SHA512 e75c1b38cbbcc1ec2993be2b6851108e770957b160db88de96d54f2bb3c9b11dbac6f61a834db642d512041179f7ced2941b99088a7022f485049a5835dea91b DIST PySolFC-2.20.1.tar.xz 9175764 BLAKE2B 3eba9044cc37f96d85e51f5bb5faa5605e8a5de887fe0c73a9bea7dde1a49e63263d7a9b66113e975a26d71de2611e0b5dc176713734316b8c0410fb8145a539 SHA512 f801dacfb3f538496a7dd2fd1777897681521928fe7ea8aec7ea514c1422e8d4ad6c0943ba534914d95544d8eb5e4868f860e6864a8e105f6cc0d16a3d678346 DIST PySolFC-Cardsets--Minimal-2.2.0.tar.xz 23145612 BLAKE2B f98e51c9609bda850cf39ffcd255c7d5c729bc01c35475b1f99a4a4d4ec6a436d44d7e5ecdcce3726616aeaff19617dba6735861f6c5677d2c197882d631a475 SHA512 d5eb0753d14e0758f410d843f553ca6c03acc6d4283b447016e959c889c9dada29fa3facead44354782010b52ec51e0d095858d3b78243ad5280068ec6cd3e31 DIST PySolFC-Cardsets-2.2.tar.bz2 65408375 BLAKE2B 7c0f4bb245d628222e0c8e3b56739c52d77aa6f62088b547c077368591ac3632300a9a35145ddbc33bfdf3accd91d261d103be6777db8c3cbb5576683358b0de SHA512 5562e572909eba96399c79487127b3d98c8f0e1ad145469e48fd6c3803334ba11c41e403d7dcaab5cd01324219426f7afdba9459d97b03071dd67b6dd73ce304 +EBUILD pysolfc-2.20.1-r1.ebuild 2017 BLAKE2B 19bdb3a8799b9681722110aa95c35ec2c8e178d9af0252f672d54254dc50608ef1d7ef96e0fb24571c61acbf3723432b291bddb14dfc47c08e4cc00839a60076 SHA512 3417b22b52ee6324ad0fd42c8a1ef0b0b4021faff245b2772c2ce9456096f552d339352f13782877b684fba9661ff52d7120c923338e39350b26c8a45aa3801b EBUILD pysolfc-2.20.1.ebuild 1968 BLAKE2B 897c31aea29d5e6191e70e8ca60c03c1bf292932e45fba93b72f91d6b38b39030eaf412d4db979b77b10937b27db38624eebfb1a2246dd04a6cfa6d0b5d147cb SHA512 bcf34d8a45f65968a14b35aae876ef043cd14575458c1876798d333eae10f810d374ac39953ece853097ffeed76ffe178e90c007ccbc8ff4cd762d6b8f9b6baf MISC metadata.xml 563 BLAKE2B 3b59b69697c8e2e34a4dad3f042639eeaf78e93167299d68ee17e7a0efb9417d78efb4d85be54b2dfa9710767abd4f1de5d9579e9f2ece656e39c286149eb5cc SHA512 6f27d71460517af500de23bc137225272c9ea45bf727725f2964a104ba48ac2a5464a930071d85e67ebf4f83b29a3359041ff8b4966b19459ed8e6cd7a24cb3f diff --git a/games-board/pysolfc/files/pysolfc-2.20.1-pillow-10.patch b/games-board/pysolfc/files/pysolfc-2.20.1-pillow-10.patch new file mode 100644 index 000000000000..d4a803b97aec --- /dev/null +++ b/games-board/pysolfc/files/pysolfc-2.20.1-pillow-10.patch @@ -0,0 +1,138 @@ +https://bugs.gentoo.org/910081 +https://github.com/shlomif/PySolFC/commit/75a3000ca1301e15d5fdbc6bae6df8dbf1cac066 + +From 75a3000ca1301e15d5fdbc6bae6df8dbf1cac066 Mon Sep 17 00:00:00 2001 +From: Joe R <joeraz5@verizon.net> +Date: Sun, 2 Jul 2023 11:07:24 -0400 +Subject: [PATCH] New logic for getting resampling method, for compatibility + with newer Pillow versions. + +--- a/pysollib/mfxutil.py ++++ b/pysollib/mfxutil.py +@@ -106,6 +106,17 @@ def format_time(t): + return "%d:%02d:%02d" % (t // 3600, (t % 3600) // 60, t % 60) + + ++def get_default_resampling(): ++ if not USE_PIL: ++ return 0 ++ elif hasattr(Image, "ANTIALIAS"): ++ return Image.ANTIALIAS ++ elif hasattr(Image, "LANCZOS"): ++ return Image.LANCZOS ++ else: ++ return Image.NEAREST ++ ++ + def print_err(s, level=1): + if level == 0: + ss = PACKAGE+': ERROR:' +--- a/pysollib/options.py ++++ b/pysollib/options.py +@@ -28,7 +28,8 @@ + import configobj + + import pysollib.settings +-from pysollib.mfxutil import Image, USE_PIL, print_err ++from pysollib.mfxutil import USE_PIL,\ ++ get_default_resampling, print_err + from pysollib.mygettext import _ + from pysollib.mygettext import myGettext + from pysollib.pysoltk import STATUSBAR_ITEMS, TOOLBAR_BUTTONS, TOOLKIT +@@ -474,7 +475,8 @@ def __init__(self): + self.tabletile_scale_method = 0 + self.resampling = 0 + if USE_PIL: +- self.resampling = int(Image.ANTIALIAS) ++ self.resampling = int(get_default_resampling()) ++ + # solver + self.solver_presets = [ + 'none', +--- a/pysollib/ui/tktile/menubar.py ++++ b/pysollib/ui/tktile/menubar.py +@@ -94,32 +94,32 @@ def createResamplingMenu(menubar, menu): + variable=menubar.tkopt.resampling, + value=int(Image.NEAREST), + command=menubar.mOptResampling) +- if Image.BILINEAR: ++ if hasattr(Image, "BILINEAR"): + submenu.add_radiobutton(label=n_("&Bilinear"), + variable=menubar.tkopt.resampling, + value=int(Image.BILINEAR), + command=menubar.mOptResampling) +- if Image.BICUBIC: ++ if hasattr(Image, "BICUBIC"): + submenu.add_radiobutton(label=n_("B&icubic"), + variable=menubar.tkopt.resampling, + value=int(Image.BICUBIC), + command=menubar.mOptResampling) +- if Image.LANCZOS: ++ if hasattr(Image, "LANCZOS"): + submenu.add_radiobutton(label=n_("&Lanczos"), + variable=menubar.tkopt.resampling, + value=int(Image.LANCZOS), + command=menubar.mOptResampling) +- elif Image.ANTIALIAS: ++ elif hasattr(Image, "ANTIALIAS"): + submenu.add_radiobutton(label=n_("&Antialiasing"), + variable=menubar.tkopt.resampling, + value=int(Image.ANTIALIAS), + command=menubar.mOptResampling) +- if Image.BOX: ++ if hasattr(Image, "BOX"): + submenu.add_radiobutton(label=n_("B&ox"), + variable=menubar.tkopt.resampling, + value=int(Image.BOX), + command=menubar.mOptResampling) +- if Image.HAMMING: ++ if hasattr(Image, "HAMMING"): + submenu.add_radiobutton(label=n_("&Hamming"), + variable=menubar.tkopt.resampling, + value=int(Image.HAMMING), +--- a/pysollib/ui/tktile/tkutil.py ++++ b/pysollib/ui/tktile/tkutil.py +@@ -24,7 +24,8 @@ + import os + import re + +-from pysollib.mfxutil import Image, ImageDraw, ImageOps, ImageTk ++from pysollib.mfxutil import Image, ImageDraw, ImageOps, ImageTk, \ ++ get_default_resampling + from pysollib.settings import TITLE, WIN_SYSTEM + + from six.moves import tkinter +@@ -288,7 +289,10 @@ def subsample(self, r): + im = PIL_Image(image=im) + return im + +- def resize(self, xf, yf, resample=Image.ANTIALIAS): ++ def resize(self, xf, yf, resample=-1): ++ ++ if resample == -1: ++ resample = get_default_resampling() + + w, h = self._pil_image_orig.size + w0, h0 = int(w*xf), int(h*yf) +@@ -456,7 +460,10 @@ def _createBottomImage(image, color='white', backfile=None): + size = (w-th*2, h-th*2) + tmp = Image.new('RGBA', size, color) + tmp.putalpha(60) +- mask = out.resize(size, Image.ANTIALIAS) ++ ++ resampling = get_default_resampling() ++ ++ mask = out.resize(size, resampling) + out.paste(tmp, (th, th), mask) + if backfile: + back = Image.open(backfile).convert('RGBA') +@@ -465,7 +472,7 @@ def _createBottomImage(image, color='white', backfile=None): + a = min(float(w1)/w0, float(h1)/h0) + a = a*0.9 + w0, h0 = int(w0*a), int(h0*a) +- back = back.resize((w0, h0), Image.ANTIALIAS) ++ back = back.resize((w0, h0), resampling) + x, y = (w1 - w0) // 2, (h1 - h0) // 2 + out.paste(back, (x, y), back) + return out + diff --git a/games-board/pysolfc/pysolfc-2.20.1-r1.ebuild b/games-board/pysolfc/pysolfc-2.20.1-r1.ebuild new file mode 100644 index 000000000000..e4a685a7a5c3 --- /dev/null +++ b/games-board/pysolfc/pysolfc-2.20.1-r1.ebuild @@ -0,0 +1,72 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_SINGLE_IMPL=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{9..11} ) +PYTHON_REQ_USE="tk" +inherit distutils-r1 xdg + +MY_PN="PySolFC" +MY_P="${MY_PN}-${PV}" +PS_CARD_P="${MY_PN}-Cardsets-2.2" +PS_CARD_MIN_P="${MY_PN}-Cardsets--Minimal-2.2.0" + +DESCRIPTION="Exciting collection of more than 1000 solitaire card games" +HOMEPAGE="https://pysolfc.sourceforge.io/" +SRC_URI="mirror://sourceforge/pysolfc/${MY_P}.tar.xz + extra-cardsets? ( mirror://sourceforge/pysolfc/${PS_CARD_P}.tar.bz2 ) + !extra-cardsets? ( mirror://sourceforge/pysolfc/${PS_CARD_MIN_P}.tar.xz )" +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3+ GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="extra-cardsets minimal +sound" + +RDEPEND=" + $(python_gen_cond_dep ' + dev-python/attrs[${PYTHON_USEDEP}] + dev-python/configobj[${PYTHON_USEDEP}] + dev-python/pysol_cards[${PYTHON_USEDEP}] + dev-python/random2[${PYTHON_USEDEP}] + dev-python/six[${PYTHON_USEDEP}] + sound? ( dev-python/pygame[${PYTHON_USEDEP}] ) + !minimal? ( dev-python/pillow[jpeg,tk,${PYTHON_USEDEP}] )') + !minimal? ( dev-tcltk/tktable )" + +PATCHES=( + "${FILESDIR}"/${P}-pillow-10.patch +) + +distutils_enable_tests unittest + +src_prepare() { + distutils-r1_src_prepare + + # make pip check happier, pycotap is not needed + sed -i "/'pycotap'/d" setup.py || die + + if use extra-cardsets; then + find ../${PS_CARD_P} -type d -name .thumbnails -exec rm -r {} + || die + fi +} + +python_install_all() { + local DOCS=( AUTHORS.md NEWS.asciidoc README.md ) + distutils-r1_python_install_all + + doman docs/pysol{,fc}.6 + + insinto /usr/share/${MY_PN} + doins -r ../$(usex extra-cardsets ${PS_CARD_P} ${PS_CARD_MIN_P})/. + + # html files are used at runtime, keep at default location + dosym -r /usr/share/{${MY_PN},doc/${PF}}/html + + # russian translation is not currently displaying right + # https://forums.gentoo.org/viewtopic-t-1142910.html + rm "${ED}"/usr/share/locale/ru/LC_MESSAGES/pysol.mo || die +} |