summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2018-07-24 22:36:18 +0100
committerJames Le Cuirot <chewi@gentoo.org>2018-07-24 22:36:18 +0100
commit5b74766ad5f4cf1735009a302a1ad49a0290ffaa (patch)
tree200b8c7ea4fa39203fd5987a2751dc647eba1319 /games-puzzle/brainworkshop
parentdev-python/more-itertools: make pytest more verbose (diff)
downloadgentoo-5b74766ad5f4cf1735009a302a1ad49a0290ffaa.tar.gz
gentoo-5b74766ad5f4cf1735009a302a1ad49a0290ffaa.tar.bz2
gentoo-5b74766ad5f4cf1735009a302a1ad49a0290ffaa.zip
games-puzzle/brainworkshop: Version bump to 5_beta20180712
This has a new upstream. Closes: https://bugs.gentoo.org/654510 Package-Manager: Portage-2.3.43, Repoman-2.3.10
Diffstat (limited to 'games-puzzle/brainworkshop')
-rw-r--r--games-puzzle/brainworkshop/Manifest1
-rw-r--r--games-puzzle/brainworkshop/brainworkshop-5_beta20180712.ebuild52
-rw-r--r--games-puzzle/brainworkshop/files/brainworkshop-5-fix-paths.patch38
-rw-r--r--games-puzzle/brainworkshop/metadata.xml1
4 files changed, 92 insertions, 0 deletions
diff --git a/games-puzzle/brainworkshop/Manifest b/games-puzzle/brainworkshop/Manifest
index be952e8902ad..8f3e9e3b8c34 100644
--- a/games-puzzle/brainworkshop/Manifest
+++ b/games-puzzle/brainworkshop/Manifest
@@ -1 +1,2 @@
DIST brainworkshop-4.8.4.zip 9373980 BLAKE2B 85af1f17755f0007f01c1684f4d746de6bab6580ed29c717e9462f8dd57115ce8ed7d2d61a411523e2d92191abe5a49d29b2598e937b014e68b3e1cb9ac3e059 SHA512 d3819036fef98fab9a89637ba01b2d844146babc7cb34b6ec6f4a589c18a7532fd23cf083c867ea1c917df9d7a6507ab51a5942e745d3ab9d01d938812486936
+DIST brainworkshop-5_beta20180712.tar.gz 8001699 BLAKE2B 0bf6114d89ab39a79e7659f6fb76d1e1cb21624a014381fc73bf6ca56f2bd721c192bc89e42b147666dd6fb7d0f6df12c60230dc3bf17b75d68f3fba1ea58b99 SHA512 5733daefd79f77c0eadcf7cec03d1cd3658ca8f79b23705f763ba5b15cf44d2f67861852287a3998c101072a7dfae20304508bf68cd728f27e2051271a16464f
diff --git a/games-puzzle/brainworkshop/brainworkshop-5_beta20180712.ebuild b/games-puzzle/brainworkshop/brainworkshop-5_beta20180712.ebuild
new file mode 100644
index 000000000000..2783a034d990
--- /dev/null
+++ b/games-puzzle/brainworkshop/brainworkshop-5_beta20180712.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python3_6 )
+inherit eutils gnome2-utils python-r1
+
+COMMIT="c5343cb3d828e8181ffff8249f683fce2fcca6db"
+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"
+LICENSE="GPL-3"
+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] )"
+
+S="${WORKDIR}/${PN}-${COMMIT}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-${PV%_*}-fix-paths.patch
+)
+
+src_prepare() {
+ edos2unix ${PN}.pyw
+ default
+
+ sed -i \
+ "s#@GENTOO_DATADIR@#${EPREFIX}/usr/share/${PN}#g" \
+ ${PN}.pyw || die
+}
+
+src_install() {
+ newbin ${PN}.pyw ${PN}
+ python_replicate_script "${ED}"usr/bin/${PN}
+
+ insinto /usr/share/${PN}
+ doins -r res/*
+
+ dodoc Readme.md Readme-{instructions,resources}.txt data/Readme-stats.txt
+
+ 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; }
diff --git a/games-puzzle/brainworkshop/files/brainworkshop-5-fix-paths.patch b/games-puzzle/brainworkshop/files/brainworkshop-5-fix-paths.patch
new file mode 100644
index 000000000000..0ecf099ff6b9
--- /dev/null
+++ b/games-puzzle/brainworkshop/files/brainworkshop-5-fix-paths.patch
@@ -0,0 +1,38 @@
+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
+ else:
+- return os.path.join(get_main_dir(), FOLDER_RES)
++ return '@GENTOO_DATADIR@'
+ 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)
diff --git a/games-puzzle/brainworkshop/metadata.xml b/games-puzzle/brainworkshop/metadata.xml
index c0fd59a21391..91d27f3c24f6 100644
--- a/games-puzzle/brainworkshop/metadata.xml
+++ b/games-puzzle/brainworkshop/metadata.xml
@@ -6,6 +6,7 @@
<name>Gentoo Games Project</name>
</maintainer>
<upstream>
+ <remote-id type="github">samcv/brainworkshop</remote-id>
<remote-id type="sourceforge">brainworkshop</remote-id>
</upstream>
</pkgmetadata>