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