Gentoo Archives: gentoo-commits

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-engines/renpy/files/, games-engines/renpy/
Date: Sun, 16 Jul 2017 16:35:52
Message-Id: 1500222786.7976e453eea2bb1c0fb2a404a5b70b976594bb97.bircoph@gentoo
1 commit: 7976e453eea2bb1c0fb2a404a5b70b976594bb97
2 Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 16 16:33:06 2017 +0000
4 Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 16 16:33:06 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7976e453
7
8 games-engines/renpy: fix compat support for old games
9
10 - Katawa Shoujo, see bug 601200: check for window to be on list before removal
11 - Elven Relations: do not create removed style elements
12
13 Package-Manager: Portage-2.3.6, Repoman-2.3.2
14 Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>
15
16 .../renpy/files/renpy-6.99.12.4-compat-style.patch | 43 ++++++++
17 .../files/renpy-6.99.12.4-compat-window.patch | 51 +++++++++
18 games-engines/renpy/renpy-6.99.12.4-r1.ebuild | 116 +++++++++++++++++++++
19 3 files changed, 210 insertions(+)
20
21 diff --git a/games-engines/renpy/files/renpy-6.99.12.4-compat-style.patch b/games-engines/renpy/files/renpy-6.99.12.4-compat-style.patch
22 new file mode 100644
23 index 00000000000..122ebf1e43e
24 --- /dev/null
25 +++ b/games-engines/renpy/files/renpy-6.99.12.4-compat-style.patch
26 @@ -0,0 +1,43 @@
27 +commit 1d350d993d2b51df7880e92b48ed103e059ec385
28 +Author: Andrew Savchenko <bircoph@×××××.com>
29 +Date: Sun Jul 16 17:07:27 2017 +0300
30 +
31 + Fix compatibility problem With ElvenRelations-1.2:
32 +
33 + When starting game:
34 +
35 + Full traceback:
36 + File "/home/andrew/src/_compat/styles.rpymc", line 22, in script
37 + File "/usr/lib64/python2.7/site-packages/renpy699/renpy/ast.py", line 814, in execute
38 + renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
39 + File "/usr/lib64/python2.7/site-packages/renpy699/renpy/python.py", line 1719, in py_exec_bytecode
40 + exec bytecode in globals, locals
41 + File "renpy/common/_compat/styles.rpym", line 374, in <module>
42 + style.selected_button = _SelectedCompat('button')
43 + File "renpy/common/_compat/styles.rpym", line 347, in __init__
44 + self.target = target
45 + File "renpy/style.pyx", line 378, in renpy.style.StyleCore.__setattr__ (gen/renpy.style.c:6236)
46 + raise Exception("Style property {} is not known.".format(name))
47 + Exception: Style property target is not known.
48 +
49 + "button*" properties are no longer present in RenPy, so relevant
50 + code is removed.
51 +
52 +diff --git a/renpy/common/_compat/styles.rpym b/renpy/common/_compat/styles.rpym
53 +index d83eeb0..174f0b6 100644
54 +--- a/renpy/common/_compat/styles.rpym
55 ++++ b/renpy/common/_compat/styles.rpym
56 +@@ -371,13 +371,6 @@ init python:
57 + self.property_updates = [ ]
58 +
59 +
60 +- style.selected_button = _SelectedCompat('button')
61 +- style.selected_button_text = _SelectedCompat('button_text')
62 +- style.gm_nav_selected_button = _SelectedCompat('gm_nav_button')
63 +- style.gm_nav_selected_button_text = _SelectedCompat('gm_nav_button_text')
64 +- style.prefs_selected_button = _SelectedCompat('prefs_button')
65 +- style.prefs_selected_button_text = _SelectedCompat('prefs_button_text')
66 +-
67 + def _apply_selected_compat():
68 + for scs in _selected_compat:
69 + scs.apply()
70
71 diff --git a/games-engines/renpy/files/renpy-6.99.12.4-compat-window.patch b/games-engines/renpy/files/renpy-6.99.12.4-compat-window.patch
72 new file mode 100644
73 index 00000000000..8c8bd21b4f6
74 --- /dev/null
75 +++ b/games-engines/renpy/files/renpy-6.99.12.4-compat-window.patch
76 @@ -0,0 +1,51 @@
77 +commit cf3f7fd4cb69c154f43a5e00c7501463a6d63ff5
78 +Author: Andrew Savchenko <bircoph@×××××.com>
79 +Date: Sun Jul 16 16:59:14 2017 +0300
80 +
81 + Fix compatibility problem with Katawa Shoujo 1.3.1
82 +
83 + The game fails to start with renpy-6.99.12.4:
84 +
85 + I'm sorry, but an uncaught exception occurred.
86 +
87 + While running game code:
88 + File "game/ui_settings.rpy", line 21, in <module>
89 + File "renpy/common/00compat.rpy", line 134, in _set_script_version
90 + config.window_auto_hide.remove("call screen")
91 + ValueError: list.remove(x): x not in list
92 +
93 + -- Full Traceback ------------------------------------------------------------
94 +
95 + Full traceback:
96 + File "/home/rondo/ui_settings.rpyc", line 2, in script
97 + File "/usr/lib64/python2.7/site-packages/renpy699/renpy/ast.py", line 814, in execute
98 + renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
99 + File "/usr/lib64/python2.7/site-packages/renpy699/renpy/python.py", line 1695, in py_exec_bytecode
100 + exec bytecode in globals, locals
101 + File "game/ui_settings.rpy", line 21, in <module>
102 + File "/usr/lib64/python2.7/site-packages/renpy699/renpy/defaultstore.py", line 92, in __setattr__
103 + renpy.store._set_script_version(value) # E1101 @UndefinedVariable
104 + File "renpy/common/00compat.rpy", line 134, in _set_script_version
105 + config.window_auto_hide.remove("call screen")
106 + File "/usr/lib64/python2.7/site-packages/renpy699/renpy/python.py", line 610, in do_mutation
107 + return method(self, *args, **kwargs)
108 + ValueError: list.remove(x): x not in list
109 +
110 + This happens because "call screen" element is being unconditionally
111 + removed from config.window_auto_hide list, though it is not always
112 + present there. A simple if check fixes this.
113 +
114 +diff --git a/renpy/common/00compat.rpy b/renpy/common/00compat.rpy
115 +index c16ad1d..eefb8e0 100644
116 +--- a/renpy/common/00compat.rpy
117 ++++ b/renpy/common/00compat.rpy
118 +@@ -131,7 +131,8 @@ init -1900 python:
119 + if version <= (6, 99, 10):
120 + config.new_translate_order = False
121 + config.old_say_args = True
122 +- config.window_auto_hide.remove("call screen")
123 ++ if "call screen" in config.window_auto_hide:
124 ++ config.window_auto_hide.remove("call screen")
125 + config.quit_action = ui.gamemenus("_quit_prompt")
126 + config.enforce_window_max_size = False
127 + config.splashscreen_suppress_overlay = False
128
129 diff --git a/games-engines/renpy/renpy-6.99.12.4-r1.ebuild b/games-engines/renpy/renpy-6.99.12.4-r1.ebuild
130 new file mode 100644
131 index 00000000000..8049f87073f
132 --- /dev/null
133 +++ b/games-engines/renpy/renpy-6.99.12.4-r1.ebuild
134 @@ -0,0 +1,116 @@
135 +# Copyright 1999-2017 Gentoo Foundation
136 +# Distributed under the terms of the GNU General Public License v2
137 +
138 +EAPI=5
139 +PYTHON_COMPAT=( python2_7 )
140 +DISTUTILS_IN_SOURCE_BUILD=1
141 +inherit eutils games gnome2-utils toolchain-funcs versionator distutils-r1
142 +
143 +DESCRIPTION="Visual novel engine written in python"
144 +HOMEPAGE="http://www.renpy.org"
145 +SRC_URI="http://www.renpy.org/dl/${PV}/${P}-source.tar.bz2"
146 +
147 +LICENSE="MIT"
148 +SLOT="$(get_version_component_range 1-2)"
149 +MYSLOT=$(delete_all_version_separators ${SLOT})
150 +KEYWORDS="~amd64 ~x86"
151 +IUSE="development doc examples"
152 +REQUIRED_USE="examples? ( development )"
153 +
154 +RDEPEND="
155 + >=app-eselect/eselect-renpy-0.6
156 + dev-libs/fribidi
157 + ~dev-python/pygame_sdl2-${PV}[${PYTHON_USEDEP}]
158 + >=dev-lang/python-exec-0.3[${PYTHON_USEDEP}]
159 + media-libs/glew:0
160 + media-libs/libpng:0
161 + media-libs/libsdl2[video]
162 + media-libs/freetype:2
163 + sys-libs/zlib
164 + virtual/ffmpeg"
165 +DEPEND="${RDEPEND}
166 + dev-python/cython[${PYTHON_USEDEP}]
167 + virtual/pkgconfig"
168 +
169 +S=${WORKDIR}/${P}-source
170 +
171 +PATCHES=(
172 + "${FILESDIR}"/${P}-multiple-abi.patch
173 + "${FILESDIR}"/${P}-compat-window.patch #601200
174 + "${FILESDIR}"/${P}-compat-style.patch
175 +)
176 +
177 +pkg_setup() {
178 + games_pkg_setup
179 + export CFLAGS="${CFLAGS} $($(tc-getPKG_CONFIG) --cflags fribidi)"
180 +}
181 +
182 +python_prepare_all() {
183 + distutils-r1_python_prepare_all
184 +
185 + einfo "Deleting precompiled python files"
186 + find . -name '*.py[co]' -print -delete || die
187 +
188 + sed -i \
189 + -e "s/@SLOT@/${MYSLOT}/" \
190 + renpy.py renpy/common.py || die "setting slot failed!"
191 +}
192 +
193 +python_compile() {
194 + cd "${S}"/module || die
195 + distutils-r1_python_compile
196 +}
197 +
198 +python_install() {
199 + cd "${S}"/module || die
200 + distutils-r1_python_install --install-lib="$(python_get_sitedir)/renpy${MYSLOT}"
201 +
202 + cd "${S}" || die
203 + python_scriptinto "${GAMES_BINDIR}"
204 + python_newscript renpy.py ${PN}-${SLOT}
205 +
206 + python_moduleinto renpy${MYSLOT}
207 + python_domodule renpy
208 + if use development ; then
209 + python_domodule launcher templates
210 + fi
211 + if use examples ; then
212 + python_domodule the_question tutorial
213 + fi
214 +}
215 +
216 +python_install_all() {
217 + distutils-r1_python_install_all
218 + if use development; then
219 + newicon -s 32 launcher/game/images/logo32.png ${P}.png
220 + make_desktop_entry ${PN}-${SLOT} "Ren'Py ${PV}" ${P}
221 + fi
222 +
223 + if use doc; then
224 + insinto html
225 + doins -r doc
226 + fi
227 + newman "${FILESDIR}/${PN}.1" "${P}.1"
228 +
229 + prepgamesdirs
230 +}
231 +
232 +pkg_preinst() {
233 + games_pkg_preinst
234 + use development && gnome2_icon_savelist
235 +}
236 +
237 +pkg_postinst() {
238 + games_pkg_postinst
239 + use development && gnome2_icon_cache_update
240 +
241 + einfo "running: eselect renpy update --if-unset"
242 + eselect renpy update --if-unset
243 +}
244 +
245 +pkg_postrm() {
246 + use development && gnome2_icon_cache_update
247 +
248 + einfo "running: eselect renpy update --if-unset"
249 + eselect renpy update --if-unset
250 +}