Skip to content

Commit

Permalink
games-puzzle/brainworkshop: Bump to 20200310 snapshot, drop old
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/718314
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: James Le Cuirot <[email protected]>
  • Loading branch information
chewi committed Apr 20, 2020
1 parent 5ef1ce2 commit d35c389
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 41 deletions.
2 changes: 1 addition & 1 deletion games-puzzle/brainworkshop/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DIST brainworkshop-5_beta20180712.tar.gz 8001699 BLAKE2B 0bf6114d89ab39a79e7659f6fb76d1e1cb21624a014381fc73bf6ca56f2bd721c192bc89e42b147666dd6fb7d0f6df12c60230dc3bf17b75d68f3fba1ea58b99 SHA512 5733daefd79f77c0eadcf7cec03d1cd3658ca8f79b23705f763ba5b15cf44d2f67861852287a3998c101072a7dfae20304508bf68cd728f27e2051271a16464f
DIST brainworkshop-5_beta20200310.tar.gz 8001718 BLAKE2B ec3ef92d169956cb9334230e60b5e2c370154c11640daa3201b56654cd402ecba37d3bd1e3ff95339b351bd8984fb84a6bab72bf9f752175d0fb3ae1d989ba10 SHA512 f061ef005ac5f1c8b3fe1f23d847852730a9402bfa6be83946b2cd1f3a352a7a6eb67b73c81506f082fe2ae590598435736a36c87513a11b87f3e8237a296669
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Copyright 1999-2018 Gentoo Foundation
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6
EAPI=7

PYTHON_COMPAT=( python3_6 )
inherit eutils gnome2-utils python-r1
PYTHON_COMPAT=( python3_{7,8} )

COMMIT="c5343cb3d828e8181ffff8249f683fce2fcca6db"
inherit desktop eutils python-single-r1 xdg

COMMIT="ea817f7e163c4fb07a60b2066c694cba92d23818"
DESCRIPTION="Short-term-memory training N-Back game"
HOMEPAGE="https://github.com/samcv/brainworkshop"
SRC_URI="https://github.com/samcv/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
Expand All @@ -15,9 +16,16 @@ SLOT="0"
KEYWORDS="~amd64 ~x86"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

RDEPEND="${PYTHON_DEPS}
|| ( >=dev-python/pyglet-1.1.4[${PYTHON_USEDEP},openal]
>=dev-python/pyglet-1.1.4[${PYTHON_USEDEP},alsa] )"
RDEPEND="
${PYTHON_DEPS}
$(python_gen_cond_dep '
>=dev-python/pyglet-1.5[${PYTHON_USEDEP},sound]
')
"

BDEPEND="
${PYTHON_DEPS}
"

S="${WORKDIR}/${PN}-${COMMIT}"

Expand All @@ -35,8 +43,7 @@ src_prepare() {
}

src_install() {
newbin ${PN}.pyw ${PN}
python_replicate_script "${ED}"usr/bin/${PN}
python_newscript ${PN}.pyw ${PN}

insinto /usr/share/${PN}
doins -r res/*
Expand All @@ -46,7 +53,3 @@ src_install() {
newicon -s 48 res/misc/brain/brain.png ${PN}.png
make_desktop_entry ${PN} "Brain Workshop"
}

pkg_preinst() { gnome2_icon_savelist; }
pkg_postinst() { gnome2_icon_cache_update; }
pkg_postrm() { gnome2_icon_cache_update; }
26 changes: 0 additions & 26 deletions games-puzzle/brainworkshop/files/brainworkshop-5-fix-paths.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
diff -Naur a/brainworkshop.pyw b/brainworkshop.pyw
--- a/brainworkshop.pyw 2018-07-14 19:11:17.536581902 +0100
+++ b/brainworkshop.pyw 2018-07-14 19:12:07.582695292 +0100
@@ -41,7 +41,7 @@
error_msg("Expected an argument following %s" % arg)
exit(1)

-import random, os, sys, imp, socket, webbrowser, time, math, traceback, datetime
+import random, os, sys, imp, socket, webbrowser, time, math, traceback, datetime, errno
if sys.version_info >= (3,0):
import urllib.request, configparser as ConfigParser
from io import StringIO
@@ -173,7 +173,7 @@
if rtrn:
return rtrn
Expand All @@ -19,20 +10,3 @@ diff -Naur a/brainworkshop.pyw b/brainworkshop.pyw
def edit_config_ini():
if sys.platform == 'win32':
cmd = 'notepad'
@@ -823,7 +823,15 @@
f = open(os.path.join(get_data_dir(), STATS_BINARY), 'w')
f.close()

-check_and_move_user_data()
+try:
+ path = get_data_dir()
+ os.makedirs(path)
+except OSError as exc:
+ if exc.errno == errno.EEXIST and os.path.isdir(path):
+ pass
+ else:
+ raise
+
load_last_user('defaults.ini')

cfg = parse_config(CONFIGFILE)

0 comments on commit d35c389

Please sign in to comment.