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