Gentoo Archives: gentoo-commits

From: "Julian Ospald (hasufell)" <hasufell@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in games-engines/renpy/files: renpy-6.18.1-multiple-abi.patch
Date: Tue, 23 Sep 2014 16:05:18
Message-Id: 20140923160513.59FD260CB@oystercatcher.gentoo.org
1 hasufell 14/09/23 16:05:13
2
3 Added: renpy-6.18.1-multiple-abi.patch
4 Log:
5 version bump
6
7 (Portage version: 2.2.12-r1/cvs/Linux x86_64, signed Manifest commit with key BDEED020)
8
9 Revision Changes Path
10 1.1 games-engines/renpy/files/renpy-6.18.1-multiple-abi.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-engines/renpy/files/renpy-6.18.1-multiple-abi.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-engines/renpy/files/renpy-6.18.1-multiple-abi.patch?rev=1.1&content-type=text/plain
14
15 Index: renpy-6.18.1-multiple-abi.patch
16 ===================================================================
17 Author: hasufell <hasufell@g.o>
18 Date: Tue Jan 21 01:02:00 2014 +0100
19
20 fix multiple abi support
21
22 --- renpy.py
23 +++ renpy.py
24 @@ -29,92 +29,9 @@
25 import sys
26 import warnings
27
28 -# Functions to be customized by distributors. ################################
29 -
30 -# Given the Ren'Py base directory (usually the directory containing
31 -# this file), this is expected to return the path to the common directory.
32 -def path_to_common(renpy_base):
33 - return renpy_base + "/renpy/common"
34 -
35 -# Given a directory holding a Ren'Py game, this is expected to return
36 -# the path to a directory that will hold save files.
37 -def path_to_saves(gamedir):
38 - import renpy #@UnresolvedImport
39 -
40 - # Makes sure the permissions are right on the save directory.
41 - def test_writable(d):
42 - try:
43 - fn = os.path.join(d, "test.txt")
44 - open(fn, "w").close()
45 - open(fn, "r").close()
46 - os.unlink(fn)
47 - return True
48 - except:
49 - return False
50 -
51 -
52 - # Android.
53 - if renpy.android:
54 - paths = [
55 - os.path.join(os.environ["ANDROID_OLD_PUBLIC"], "game/saves"),
56 - os.path.join(os.environ["ANDROID_PRIVATE"], "saves"),
57 - os.path.join(os.environ["ANDROID_PUBLIC"], "saves"),
58 - ]
59 -
60 - for rv in paths:
61 - if os.path.isdir(rv) and test_writable(rv):
62 - break
63 -
64 - print "Using savedir", rv
65 -
66 - # We return the last path as the default.
67 -
68 - return rv
69 -
70 -
71 - # No save directory given.
72 - if not renpy.config.save_directory:
73 - return gamedir + "/saves"
74 -
75 - # Search the path above Ren'Py for a directory named "Ren'Py Data".
76 - # If it exists, then use that for our save directory.
77 - path = renpy.config.renpy_base
78 -
79 - while True:
80 - if os.path.isdir(path + "/Ren'Py Data"):
81 - return path + "/Ren'Py Data/" + renpy.config.save_directory
82 -
83 - newpath = os.path.dirname(path)
84 - if path == newpath:
85 - break
86 - path = newpath
87 -
88 - # Otherwise, put the saves in a platform-specific location.
89 - if renpy.macintosh:
90 - rv = "~/Library/RenPy/" + renpy.config.save_directory
91 - return os.path.expanduser(rv)
92 -
93 - elif renpy.windows:
94 - if 'APPDATA' in os.environ:
95 - return os.environ['APPDATA'] + "/RenPy/" + renpy.config.save_directory
96 - else:
97 - rv = "~/RenPy/" + renpy.config.save_directory
98 - return os.path.expanduser(rv)
99 -
100 - else:
101 - rv = "~/.renpy/" + renpy.config.save_directory
102 - return os.path.expanduser(rv)
103 -
104 -
105 -# Returns the path to the Ren'Py base directory (containing common and
106 -# the launcher, usually.)
107 -def path_to_renpy_base():
108 - renpy_base = os.path.dirname(os.path.realpath(sys.argv[0]))
109 - renpy_base = os.path.abspath(renpy_base)
110 -
111 - return renpy_base
112 -
113 -##############################################################################
114 +from distutils.sysconfig import get_python_lib
115 +sys.path.append(get_python_lib() + "/renpy@SLOT@")
116 +import renpy.common as common
117
118 # The version of the Mac Launcher and py4renpy that we require.
119 macos_version = (6, 14, 0)
120 @@ -142,7 +59,7 @@
121
122 def main():
123
124 - renpy_base = path_to_renpy_base()
125 + renpy_base = common.path_to_renpy_base()
126
127 # Add paths.
128 if os.path.exists(renpy_base + "/module"):
129 --- /dev/null
130 +++ renpy/common.py
131 @@ -0,0 +1,127 @@
132 +# This file is part of Ren'Py. The license below applies to Ren'Py only.
133 +# Games and other projects that use Ren'Py may use a different license.
134 +
135 +# Copyright 2004-2014 Tom Rothamel <pytom@××××××××.us>
136 +#
137 +# Permission is hereby granted, free of charge, to any person
138 +# obtaining a copy of this software and associated documentation files
139 +# (the "Software"), to deal in the Software without restriction,
140 +# including without limitation the rights to use, copy, modify, merge,
141 +# publish, distribute, sublicense, and/or sell copies of the Software,
142 +# and to permit persons to whom the Software is furnished to do so,
143 +# subject to the following conditions:
144 +#
145 +# The above copyright notice and this permission notice shall be
146 +# included in all copies or substantial portions of the Software.
147 +#
148 +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
149 +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
150 +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
151 +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
152 +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
153 +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
154 +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
155 +
156 +import os
157 +import sys
158 +import warnings
159 +from distutils.sysconfig import get_python_lib
160 +
161 +# Functions to be customized by distributors. ################################
162 +
163 +# Given the Ren'Py base directory (usually the directory containing
164 +# this file), this is expected to return the path to the common directory.
165 +def path_to_common(renpy_base):
166 + return renpy_base + "/renpy/common"
167 +
168 +# Given a directory holding a Ren'Py game, this is expected to return
169 +# the path to a directory that will hold save files.
170 +def path_to_saves(gamedir):
171 + import renpy #@UnresolvedImport
172 +
173 + # Makes sure the permissions are right on the save directory.
174 + def test_writable(d):
175 + try:
176 + fn = os.path.join(d, "test.txt")
177 + open(fn, "w").close()
178 + open(fn, "r").close()
179 + os.unlink(fn)
180 + return True
181 + except:
182 + return False
183 +
184 +
185 + # Makes sure the permissions are right on the save directory.
186 + def test_writable(d):
187 + try:
188 + fn = os.path.join(d, "test.txt")
189 + open(fn, "w").close()
190 + open(fn, "r").close()
191 + os.unlink(fn)
192 + return True
193 + except:
194 + return False
195 +
196 +
197 +
198 + # Android.
199 + if renpy.android:
200 + paths = [
201 + os.path.join(os.environ["ANDROID_OLD_PUBLIC"], "game/saves"),
202 + os.path.join(os.environ["ANDROID_PRIVATE"], "saves"),
203 + os.path.join(os.environ["ANDROID_PUBLIC"], "saves"),
204 + ]
205 +
206 + for rv in paths:
207 + if os.path.isdir(rv) and test_writable(rv):
208 + break
209 +
210 + print "Using savedir", rv
211 +
212 + # We return the last path as the default.
213 +
214 + return rv
215 +
216 +
217 + # No save directory given.
218 + if not renpy.config.save_directory:
219 + return gamedir + "/saves"
220 +
221 + # Search the path above Ren'Py for a directory named "Ren'Py Data".
222 + # If it exists, then use that for our save directory.
223 + path = renpy.config.renpy_base
224 +
225 + while True:
226 + if os.path.isdir(path + "/Ren'Py Data"):
227 + return path + "/Ren'Py Data/" + renpy.config.save_directory
228 +
229 + newpath = os.path.dirname(path)
230 + if path == newpath:
231 + break
232 + path = newpath
233 +
234 + # Otherwise, put the saves in a platform-specific location.
235 + if renpy.macintosh:
236 + rv = "~/Library/RenPy/" + renpy.config.save_directory
237 + return os.path.expanduser(rv)
238 +
239 + elif renpy.windows:
240 + if 'APPDATA' in os.environ:
241 + return os.environ['APPDATA'] + "/RenPy/" + renpy.config.save_directory
242 + else:
243 + rv = "~/RenPy/" + renpy.config.save_directory
244 + return os.path.expanduser(rv)
245 +
246 + else:
247 + rv = "~/.renpy/" + renpy.config.save_directory
248 + return os.path.expanduser(rv)
249 +
250 +
251 +# Returns the path to the Ren'Py base directory (containing common and
252 +# the launcher, usually.)
253 +def path_to_renpy_base():
254 + renpy_base = os.path.dirname(os.path.realpath(sys.argv[0]))
255 + renpy_base = get_python_lib() + "/renpy@SLOT@"
256 + renpy_base = os.path.abspath(renpy_base)
257 +
258 + return renpy_base
259 --- renpy/main.py
260 +++ renpy/main.py
261 @@ -25,7 +25,7 @@ import os
262 import sys
263 import time
264 import zipfile
265 -import __main__
266 +import renpy.common as common
267
268
269 def run(restart):
270 @@ -167,7 +167,7 @@ def main():
271 renpy.config.searchpath = [ renpy.config.gamedir ]
272
273 # Find the common directory.
274 - commondir = __main__.path_to_common(renpy.config.renpy_base) # E1101 @UndefinedVariable
275 + commondir = common.path_to_common(renpy.config.renpy_base) # E1101 @UndefinedVariable
276
277 if os.path.isdir(commondir):
278 renpy.config.searchpath.append(commondir)
279 @@ -230,7 +230,7 @@ def main():
280
281 # Find the save directory.
282 if renpy.config.savedir is None:
283 - renpy.config.savedir = __main__.path_to_saves(renpy.config.gamedir) # E1101 @UndefinedVariable
284 + renpy.config.savedir = common.path_to_saves(renpy.config.gamedir) # E1101 @UndefinedVariable
285
286 if renpy.game.args.savedir: #@UndefinedVariable
287 renpy.config.savedir = renpy.game.args.savedir #@UndefinedVariable