Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-puzzle/brainworkshop/files/, games-puzzle/brainworkshop/
Date: Tue, 24 Jul 2018 21:38:40
Message-Id: 1532468178.5b74766ad5f4cf1735009a302a1ad49a0290ffaa.chewi@gentoo
1 commit: 5b74766ad5f4cf1735009a302a1ad49a0290ffaa
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 24 21:36:18 2018 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 24 21:36:18 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b74766a
7
8 games-puzzle/brainworkshop: Version bump to 5_beta20180712
9
10 This has a new upstream.
11
12 Closes: https://bugs.gentoo.org/654510
13 Package-Manager: Portage-2.3.43, Repoman-2.3.10
14
15 games-puzzle/brainworkshop/Manifest | 1 +
16 .../brainworkshop-5_beta20180712.ebuild | 52 ++++++++++++++++++++++
17 .../files/brainworkshop-5-fix-paths.patch | 38 ++++++++++++++++
18 games-puzzle/brainworkshop/metadata.xml | 1 +
19 4 files changed, 92 insertions(+)
20
21 diff --git a/games-puzzle/brainworkshop/Manifest b/games-puzzle/brainworkshop/Manifest
22 index be952e8902a..8f3e9e3b8c3 100644
23 --- a/games-puzzle/brainworkshop/Manifest
24 +++ b/games-puzzle/brainworkshop/Manifest
25 @@ -1 +1,2 @@
26 DIST brainworkshop-4.8.4.zip 9373980 BLAKE2B 85af1f17755f0007f01c1684f4d746de6bab6580ed29c717e9462f8dd57115ce8ed7d2d61a411523e2d92191abe5a49d29b2598e937b014e68b3e1cb9ac3e059 SHA512 d3819036fef98fab9a89637ba01b2d844146babc7cb34b6ec6f4a589c18a7532fd23cf083c867ea1c917df9d7a6507ab51a5942e745d3ab9d01d938812486936
27 +DIST brainworkshop-5_beta20180712.tar.gz 8001699 BLAKE2B 0bf6114d89ab39a79e7659f6fb76d1e1cb21624a014381fc73bf6ca56f2bd721c192bc89e42b147666dd6fb7d0f6df12c60230dc3bf17b75d68f3fba1ea58b99 SHA512 5733daefd79f77c0eadcf7cec03d1cd3658ca8f79b23705f763ba5b15cf44d2f67861852287a3998c101072a7dfae20304508bf68cd728f27e2051271a16464f
28
29 diff --git a/games-puzzle/brainworkshop/brainworkshop-5_beta20180712.ebuild b/games-puzzle/brainworkshop/brainworkshop-5_beta20180712.ebuild
30 new file mode 100644
31 index 00000000000..2783a034d99
32 --- /dev/null
33 +++ b/games-puzzle/brainworkshop/brainworkshop-5_beta20180712.ebuild
34 @@ -0,0 +1,52 @@
35 +# Copyright 1999-2018 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +PYTHON_COMPAT=( python3_6 )
41 +inherit eutils gnome2-utils python-r1
42 +
43 +COMMIT="c5343cb3d828e8181ffff8249f683fce2fcca6db"
44 +DESCRIPTION="Short-term-memory training N-Back game"
45 +HOMEPAGE="https://github.com/samcv/brainworkshop"
46 +SRC_URI="https://github.com/samcv/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
47 +LICENSE="GPL-3"
48 +SLOT="0"
49 +KEYWORDS="~amd64 ~x86"
50 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
51 +
52 +RDEPEND="${PYTHON_DEPS}
53 + || ( >=dev-python/pyglet-1.1.4[${PYTHON_USEDEP},openal]
54 + >=dev-python/pyglet-1.1.4[${PYTHON_USEDEP},alsa] )"
55 +
56 +S="${WORKDIR}/${PN}-${COMMIT}"
57 +
58 +PATCHES=(
59 + "${FILESDIR}"/${PN}-${PV%_*}-fix-paths.patch
60 +)
61 +
62 +src_prepare() {
63 + edos2unix ${PN}.pyw
64 + default
65 +
66 + sed -i \
67 + "s#@GENTOO_DATADIR@#${EPREFIX}/usr/share/${PN}#g" \
68 + ${PN}.pyw || die
69 +}
70 +
71 +src_install() {
72 + newbin ${PN}.pyw ${PN}
73 + python_replicate_script "${ED}"usr/bin/${PN}
74 +
75 + insinto /usr/share/${PN}
76 + doins -r res/*
77 +
78 + dodoc Readme.md Readme-{instructions,resources}.txt data/Readme-stats.txt
79 +
80 + newicon -s 48 res/misc/brain/brain.png ${PN}.png
81 + make_desktop_entry ${PN} "Brain Workshop"
82 +}
83 +
84 +pkg_preinst() { gnome2_icon_savelist; }
85 +pkg_postinst() { gnome2_icon_cache_update; }
86 +pkg_postrm() { gnome2_icon_cache_update; }
87
88 diff --git a/games-puzzle/brainworkshop/files/brainworkshop-5-fix-paths.patch b/games-puzzle/brainworkshop/files/brainworkshop-5-fix-paths.patch
89 new file mode 100644
90 index 00000000000..0ecf099ff6b
91 --- /dev/null
92 +++ b/games-puzzle/brainworkshop/files/brainworkshop-5-fix-paths.patch
93 @@ -0,0 +1,38 @@
94 +diff -Naur a/brainworkshop.pyw b/brainworkshop.pyw
95 +--- a/brainworkshop.pyw 2018-07-14 19:11:17.536581902 +0100
96 ++++ b/brainworkshop.pyw 2018-07-14 19:12:07.582695292 +0100
97 +@@ -41,7 +41,7 @@
98 + error_msg("Expected an argument following %s" % arg)
99 + exit(1)
100 +
101 +-import random, os, sys, imp, socket, webbrowser, time, math, traceback, datetime
102 ++import random, os, sys, imp, socket, webbrowser, time, math, traceback, datetime, errno
103 + if sys.version_info >= (3,0):
104 + import urllib.request, configparser as ConfigParser
105 + from io import StringIO
106 +@@ -173,7 +173,7 @@
107 + if rtrn:
108 + return rtrn
109 + else:
110 +- return os.path.join(get_main_dir(), FOLDER_RES)
111 ++ return '@GENTOO_DATADIR@'
112 + def edit_config_ini():
113 + if sys.platform == 'win32':
114 + cmd = 'notepad'
115 +@@ -823,7 +823,15 @@
116 + f = open(os.path.join(get_data_dir(), STATS_BINARY), 'w')
117 + f.close()
118 +
119 +-check_and_move_user_data()
120 ++try:
121 ++ path = get_data_dir()
122 ++ os.makedirs(path)
123 ++except OSError as exc:
124 ++ if exc.errno == errno.EEXIST and os.path.isdir(path):
125 ++ pass
126 ++ else:
127 ++ raise
128 ++
129 + load_last_user('defaults.ini')
130 +
131 + cfg = parse_config(CONFIGFILE)
132
133 diff --git a/games-puzzle/brainworkshop/metadata.xml b/games-puzzle/brainworkshop/metadata.xml
134 index c0fd59a2139..91d27f3c24f 100644
135 --- a/games-puzzle/brainworkshop/metadata.xml
136 +++ b/games-puzzle/brainworkshop/metadata.xml
137 @@ -6,6 +6,7 @@
138 <name>Gentoo Games Project</name>
139 </maintainer>
140 <upstream>
141 + <remote-id type="github">samcv/brainworkshop</remote-id>
142 <remote-id type="sourceforge">brainworkshop</remote-id>
143 </upstream>
144 </pkgmetadata>