summaryrefslogtreecommitdiff
path: root/games-board/pychess
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-05-14 11:09:11 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-05-14 11:09:11 +0100
commitdeba8115d2c2af26df42966b91ef04ff4dd79cde (patch)
tree9a48f42594e1a9e6b2020d5535a784314434d7a7 /games-board/pychess
parent38423c67c8a23f6a1bc42038193182e2da3116eb (diff)
gentoo resync : 14.05.2020
Diffstat (limited to 'games-board/pychess')
-rw-r--r--games-board/pychess/Manifest8
-rw-r--r--games-board/pychess/files/pychess-gtk-compat.patch46
-rw-r--r--games-board/pychess/files/pychess-setup-no-display.patch136
-rw-r--r--games-board/pychess/metadata.xml2
-rw-r--r--games-board/pychess/pychess-0.99.4-r1.ebuild46
-rw-r--r--games-board/pychess/pychess-1.0.0.ebuild56
6 files changed, 244 insertions, 50 deletions
diff --git a/games-board/pychess/Manifest b/games-board/pychess/Manifest
index a24b53810502..f985862bf520 100644
--- a/games-board/pychess/Manifest
+++ b/games-board/pychess/Manifest
@@ -1,3 +1,5 @@
-DIST pychess-0.99.4.tar.gz 12318797 BLAKE2B ae0741d724516b85c4158e25bc7a2ea1f7642bfa165365d6022c6de6c4447b5f9d3baa2f801bdcbf2449de53f95df3ec68d9a5c898d962c1864a5a2b0c5183b6 SHA512 79b5a3a780864ca8b92be19b213442030752694fa9cd3a4bf71140d2364042521f534adf94843094531550b1029bb6f80150953dd661631ec45b1b08014cf9dc
-EBUILD pychess-0.99.4-r1.ebuild 1067 BLAKE2B 8f88d3b7fa8b6e60ba7e8087c21dec9b4b12546a792aedfcfb310afb081694ff9c7da89dfc47b003922e8cd9e1db0bff458c50ea5c98be8dbf2050e058a3541f SHA512 b23a1451099ad34b424ba398f7c9d8f8b40887c2f152b873c7521364aac941707b987106846f8584104df70a5ea99de021dbae96779f9dad56e0e8c97125e1c9
-MISC metadata.xml 330 BLAKE2B 15a47bf5f276ac9befdb283d8c69ecb24c91b4ea01cd72afd84227afe207ee7f3abfc037d9bc1c214b5e0091aeae4ea071cfda32d55b25766cc9480a3611ae43 SHA512 0233cc10e31aa616eaab261554b2a730bb8932e3a266943c829a2c1c48f296830ea42217174256816a1bd4d0d4eeebb34e8c615ef2d997ee2d3da512ca97ee5c
+AUX pychess-gtk-compat.patch 1802 BLAKE2B 9c073b28c9dc2cbfc3e9bc1acce5b091ae6d77869c23a21d06e84fde2e7190ec412aa7d1f4e3a24698816a843ca8525be4f2114c046774ba6daa6aec6765edc7 SHA512 54db9fd66bcbf2e5c4a0d761b72fb461450a75ac32338fc7a7a097bd8e14667bae682a0ecb9e0ad63f9d0ff04892f3b37afe7041c0582bab57f36e64e6d7d65c
+AUX pychess-setup-no-display.patch 5165 BLAKE2B 897e1b5d01b9192ca969c1d4603a1597a3c3ebbc91783c66f8f8067ef6e1064c5011faeca5684dcb3ad472860ea9c256882f35546d3582837957f3d3c53fec17 SHA512 bc7a975b8069e9a96d8f56e54bb3f7b8e2d1c1eddf89615ad2a45292b5bb1926bbb17341f565129a868787120e501b7c2f6cbe3e059249030ec9dc218a2e320a
+DIST pychess-1.0.0.tar.gz 12853354 BLAKE2B 1e5f3c219bce10f3cd9e68b873634742d4b673e93adb00cfcc84fcbc6ca5c7ce0534feecca3f8ddce6cd848074b84957db81f8c45841ffd7c4e1007672082840 SHA512 331765d22e2360dba145be5e22677d8676e1c7fcc8486d0e52e379b41c85bab782a5d548b93fe2f19de99ce0ccc4904e02fc8130de679ca534a211b579f1679a
+EBUILD pychess-1.0.0.ebuild 1289 BLAKE2B c6ac6d6892c04e073ce45fdded88062d9e310ff0162642ad62d0f84c44ced29eda067eec6dc8c2f57598aea48a74dce584e6779afa904ca8a7a22245cafe83b7 SHA512 4bb246d780352cef5e0359ac40090e7612f4e879cf07eb7aadef6ecdf465333b579b379de6534a06ad2a038c2127d19cb3c9ae20ddeb12675ff48bf6485e061d
+MISC metadata.xml 333 BLAKE2B b9ea104e76e26c1fd5cbfd083427ca866c374ed3dbd4b258a61746ddf5cb2956f0483fc91ba1a526f795a56a741a61d6291ad46cb024938b76346006d5aab86f SHA512 c0734172b006a0f01357bf748c53c5191aedfd09213192696e19c009fd2758554eeaf1e26678c2208ad2814725af72dcb3ffe2c55c0626ea24d4a47c600f07da
diff --git a/games-board/pychess/files/pychess-gtk-compat.patch b/games-board/pychess/files/pychess-gtk-compat.patch
new file mode 100644
index 000000000000..fa7f2fc61033
--- /dev/null
+++ b/games-board/pychess/files/pychess-gtk-compat.patch
@@ -0,0 +1,46 @@
+From 6c840c9981f2077d0fa4436b30a2f2f6650e55fb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= <contact@tiger-222.fr>
+Date: Mon, 13 Apr 2020 14:48:40 +0200
+Subject: [PATCH] Fix missing TreeModelFilter.sort_new_with_model() on some Gtk
+ versions
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is due to API changes, but let's keep compatibility with older versions.
+That should fix #1811.
+
+Signed-off-by: Mickaƫl Schoentgen <contact@tiger-222.fr>
+---
+ lib/pychess/perspectives/fics/__init__.py | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/lib/pychess/perspectives/fics/__init__.py b/lib/pychess/perspectives/fics/__init__.py
+index 4f956b695..1518c21e0 100644
+--- a/lib/pychess/perspectives/fics/__init__.py
++++ b/lib/pychess/perspectives/fics/__init__.py
+@@ -27,6 +27,24 @@
+ from pychess.perspectives import Perspective, perspective_manager, panel_name
+
+
++if not hasattr(Gtk.TreeModelFilter, "new_with_model"):
++ # Fix #1811: TreeModelFilter.sort_new_with_model() is missing on some Gtk versions
++ # due to API changes. Let's keep compatibility with older versions.
++
++ def sort_new_with_model(self):
++ super_object = super(Gtk.TreeModel, self)
++ if hasattr(super_object, "sort_new_with_model"):
++ return super_object.sort_new_with_model()
++ return Gtk.TreeModelSort.new_with_model(self)
++
++ @classmethod
++ def new_with_model(self, child_model):
++ return Gtk.TreeModel.sort_new_with_model(child_model)
++
++ Gtk.TreeModel.sort_new_with_model = sort_new_with_model
++ Gtk.TreeModelFilter.new_with_model = new_with_model
++
++
+ class PlayerNotificationMessage(InfoBarMessage):
+
+ def __init__(self, message_type, content, callback, player, text):
diff --git a/games-board/pychess/files/pychess-setup-no-display.patch b/games-board/pychess/files/pychess-setup-no-display.patch
new file mode 100644
index 000000000000..29b06bd93fe8
--- /dev/null
+++ b/games-board/pychess/files/pychess-setup-no-display.patch
@@ -0,0 +1,136 @@
+From faf456bf2d081aa3cff52d0f9f714748a04628b1 Mon Sep 17 00:00:00 2001
+From: gbtami <gbtami@gmail.com>
+Date: Sat, 18 May 2019 18:50:17 +0200
+Subject: [PATCH] Fix bdist_rpm. Prevent importing GLib from setup.py
+
+---
+ lib/pychess/Savers/pgn.py | 8 ++++----
+ lib/pychess/Utils/__init__.py | 18 ++++++++++++++++++
+ lib/pychess/widgets/ChessClock.py | 20 ++------------------
+ 3 files changed, 24 insertions(+), 22 deletions(-)
+
+diff --git a/lib/pychess/Savers/pgn.py b/lib/pychess/Savers/pgn.py
+index ac4238471..2b089e1d1 100644
+--- a/lib/pychess/Savers/pgn.py
++++ b/lib/pychess/Savers/pgn.py
+@@ -10,8 +10,6 @@
+ import sys
+ import textwrap
+
+-from gi.repository import GLib
+-
+ import pexpect
+
+ from sqlalchemy import String
+@@ -23,7 +21,6 @@
+ WON_RESIGN, DRAW, BLACKWON, WHITEWON, NORMALCHESS, DRAW_AGREE, FIRST_PAGE, PREV_PAGE, NEXT_PAGE, \
+ ABORTED_REASONS, ADJOURNED_REASONS, WON_CALLFLAG, DRAW_ADJUDICATION, WON_ADJUDICATION, \
+ WHITE_ENGINE_DIED, BLACK_ENGINE_DIED, RUNNING, TOOL_NONE, TOOL_CHESSDB, TOOL_SCOUTFISH
+-
+ from pychess.System import conf
+ from pychess.System.Log import log
+ from pychess.System.protoopen import PGN_ENCODING
+@@ -35,7 +32,7 @@
+ from pychess.Utils.elo import get_elo_rating_change_pgn
+ from pychess.Utils.logic import getStatus
+ from pychess.Variants import name2variant, NormalBoard, variants
+-from pychess.widgets.ChessClock import formatTime
++from pychess.Utils import formatTime
+ from pychess.Savers.ChessFile import ChessFile, LoadingError
+ from pychess.Savers.database import col2label, TagDatabase, parseDateTag
+ from pychess.Database import model as dbmodel
+@@ -460,6 +457,7 @@ def init_tag_database(self, importer=None):
+ if size > 10000000:
+ drop_indexes(self.engine)
+ if self.progressbar is not None:
++ from gi.repository import GLib
+ GLib.idle_add(self.progressbar.set_text, _("Importing game headers..."))
+ if importer is None:
+ importer = PgnImport(self)
+@@ -477,6 +475,7 @@ def init_chess_db(self):
+ if chess_db_path is not None and self.path and self.size > 0:
+ try:
+ if self.progressbar is not None:
++ from gi.repository import GLib
+ GLib.idle_add(self.progressbar.set_text, _("Creating .bin index file..."))
+ self.chess_db = Parser(engine=(chess_db_path, ))
+ self.chess_db.open(self.path)
+@@ -503,6 +502,7 @@ def init_scoutfish(self):
+ if scoutfish_path is not None and self.path and self.size > 0:
+ try:
+ if self.progressbar is not None:
++ from gi.repository import GLib
+ GLib.idle_add(self.progressbar.set_text, _("Creating .scout index file..."))
+ self.scoutfish = Scoutfish(engine=(scoutfish_path, ))
+ self.scoutfish.open(self.path)
+diff --git a/lib/pychess/Utils/__init__.py b/lib/pychess/Utils/__init__.py
+index 481273854..038c798da 100755
+--- a/lib/pychess/Utils/__init__.py
++++ b/lib/pychess/Utils/__init__.py
+@@ -1,9 +1,27 @@
+ import asyncio
+ import weakref
++from math import ceil
+
+ from pychess.Utils.lutils.ldata import MATE_VALUE, MATE_DEPTH
+
+
++def formatTime(seconds, clk2pgn=False):
++ minus = ""
++ if seconds <= -10 or seconds >= 10:
++ seconds = ceil(seconds)
++ if seconds < 0:
++ minus = "-"
++ seconds = -seconds
++ hours, remainder = divmod(seconds, 3600)
++ minutes, seconds = divmod(remainder, 60)
++ if hours or clk2pgn:
++ return minus + "%d:%02d:%02d" % (hours, minutes, seconds)
++ elif not minutes and seconds < 10:
++ return minus + "%.1f" % seconds
++ else:
++ return minus + "%d:%02d" % (minutes, seconds)
++
++
+ def prettyPrintScore(s, depth, format_mate=False):
+ """The score parameter is an eval value from White point of view"""
+
+diff --git a/lib/pychess/widgets/ChessClock.py b/lib/pychess/widgets/ChessClock.py
+index 8811d13db..740e0828a 100644
+--- a/lib/pychess/widgets/ChessClock.py
++++ b/lib/pychess/widgets/ChessClock.py
+@@ -1,32 +1,16 @@
+ # -*- coding: UTF-8 -*-
+
+-from math import ceil, pi, cos, sin
++from math import pi, cos, sin
+
+ import cairo
+ from gi.repository import GLib, Gtk, Gdk, Pango, PangoCairo, GObject
+
+ from pychess.System import conf
++from pychess.Utils import formatTime
+ from pychess.Utils.const import BLACK, WHITE, LOCAL, UNFINISHED_STATES, DRAW, WHITEWON, BLACKWON, UNKNOWN_STATE
+ from . import preferencesDialog
+
+
+-def formatTime(seconds, clk2pgn=False):
+- minus = ""
+- if seconds <= -10 or seconds >= 10:
+- seconds = ceil(seconds)
+- if seconds < 0:
+- minus = "-"
+- seconds = -seconds
+- hours, remainder = divmod(seconds, 3600)
+- minutes, seconds = divmod(remainder, 60)
+- if hours or clk2pgn:
+- return minus + "%d:%02d:%02d" % (hours, minutes, seconds)
+- elif not minutes and seconds < 10:
+- return minus + "%.1f" % seconds
+- else:
+- return minus + "%d:%02d" % (minutes, seconds)
+-
+-
+ class ChessClock(Gtk.DrawingArea):
+ def __init__(self):
+ GObject.GObject.__init__(self)
diff --git a/games-board/pychess/metadata.xml b/games-board/pychess/metadata.xml
index 852efafb3934..652441d5c75c 100644
--- a/games-board/pychess/metadata.xml
+++ b/games-board/pychess/metadata.xml
@@ -6,6 +6,6 @@
<name>Gentoo Games Project</name>
</maintainer>
<upstream>
- <remote-id type="google-code">pychess</remote-id>
+ <remote-id type="github">pychess/pychess</remote-id>
</upstream>
</pkgmetadata>
diff --git a/games-board/pychess/pychess-0.99.4-r1.ebuild b/games-board/pychess/pychess-0.99.4-r1.ebuild
deleted file mode 100644
index d22aeacf0f6a..000000000000
--- a/games-board/pychess/pychess-0.99.4-r1.ebuild
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python3_6 )
-PYTHON_REQ_USE="sqlite"
-
-inherit xdg-utils distutils-r1
-
-DESCRIPTION="A chess client for Gnome"
-HOMEPAGE="http://pychess.org/"
-SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.gz"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="gstreamer"
-
-DEPEND="
- dev-python/pexpect[${PYTHON_USEDEP}]
- dev-python/psutil[${PYTHON_USEDEP}]
- dev-python/pycairo[${PYTHON_USEDEP}]
- dev-python/pygobject:3[${PYTHON_USEDEP}]
- dev-python/sqlalchemy[${PYTHON_USEDEP},sqlite]
- gnome-base/librsvg:2
- x11-libs/gtksourceview:3.0
- x11-libs/pango
- x11-themes/adwaita-icon-theme
- gstreamer? (
- dev-python/gst-python:1.0[${PYTHON_USEDEP}]
- media-libs/gstreamer:1.0
- media-libs/gst-plugins-base:1.0
- )"
-RDEPEND="${DEPEND}"
-
-pkg_postinst() {
- xdg_desktop_database_update
- xdg_icon_cache_update
- xdg_mimeinfo_database_update
-}
-
-pkg_postrm() {
- xdg_desktop_database_update
- xdg_icon_cache_update
- xdg_mimeinfo_database_update
-}
diff --git a/games-board/pychess/pychess-1.0.0.ebuild b/games-board/pychess/pychess-1.0.0.ebuild
new file mode 100644
index 000000000000..ca376621f378
--- /dev/null
+++ b/games-board/pychess/pychess-1.0.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7,8} )
+DISTUTILS_SINGLE_IMPL=1
+DISTUTILS_USE_SETUPTOOLS=no
+PYTHON_REQ_USE="sqlite"
+
+inherit xdg distutils-r1
+
+DESCRIPTION="A chess client for GNOME"
+HOMEPAGE="https://github.com/pychess/pychess"
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="gstreamer"
+
+DEPEND="
+ $(python_gen_cond_dep '
+ dev-python/pexpect[${PYTHON_USEDEP}]
+ dev-python/psutil[${PYTHON_USEDEP}]
+ dev-python/pycairo[${PYTHON_USEDEP}]
+ dev-python/pygobject:3[${PYTHON_USEDEP}]
+ dev-python/sqlalchemy[${PYTHON_USEDEP},sqlite]
+ dev-python/websockets[${PYTHON_USEDEP}]
+ ')
+ gnome-base/librsvg:2
+ x11-libs/gtksourceview:3.0
+ x11-libs/pango
+ x11-themes/adwaita-icon-theme
+ gstreamer? (
+ $(python_gen_cond_dep '
+ dev-python/gst-python:1.0[${PYTHON_USEDEP}]
+ ')
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )
+"
+
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-setup-no-display.patch
+ "${FILESDIR}"/${PN}-gtk-compat.patch
+)
+
+src_install() {
+ distutils-r1_src_install
+
+ mv -v "${ED}"/usr/share/{appdata,metainfo} || die
+ gunzip -v "${ED}"/usr/share/man/man1/${PN}.1.gz || die
+}