commit:     5b74766ad5f4cf1735009a302a1ad49a0290ffaa
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 24 21:36:18 2018 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Tue Jul 24 21:36:18 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b74766a

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

 games-puzzle/brainworkshop/Manifest                |  1 +
 .../brainworkshop-5_beta20180712.ebuild            | 52 ++++++++++++++++++++++
 .../files/brainworkshop-5-fix-paths.patch          | 38 ++++++++++++++++
 games-puzzle/brainworkshop/metadata.xml            |  1 +
 4 files changed, 92 insertions(+)

diff --git a/games-puzzle/brainworkshop/Manifest 
b/games-puzzle/brainworkshop/Manifest
index be952e8902a..8f3e9e3b8c3 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 00000000000..2783a034d99
--- /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 00000000000..0ecf099ff6b
--- /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 c0fd59a2139..91d27f3c24f 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>

Reply via email to