1 |
floppym 13/05/28 22:44:34 |
2 |
|
3 |
Added: imaging-1.1.7-no-xv.patch |
4 |
pillow-2.0.0-libm_linking.patch |
5 |
pillow-2.0.0-delete_hardcoded_paths.patch |
6 |
Log: |
7 |
Enable python3, add keywords from dev-python/imaging, apply a few patches. |
8 |
|
9 |
(Portage version: 2.2.0_alpha177/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4) |
10 |
|
11 |
Revision Changes Path |
12 |
1.1 dev-python/pillow/files/imaging-1.1.7-no-xv.patch |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pillow/files/imaging-1.1.7-no-xv.patch?rev=1.1&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pillow/files/imaging-1.1.7-no-xv.patch?rev=1.1&content-type=text/plain |
16 |
|
17 |
Index: imaging-1.1.7-no-xv.patch |
18 |
=================================================================== |
19 |
--- PIL/ImageShow.py.old 2009-11-30 10:28:37.000000000 +0100 |
20 |
+++ PIL/ImageShow.py 2009-11-30 10:29:02.000000000 +0100 |
21 |
@@ -149,13 +149,10 @@ |
22 |
def get_command_ex(self, file, title=None, **options): |
23 |
# note: xv is pretty outdated. most modern systems have |
24 |
# imagemagick's display command instead. |
25 |
- command = executable = "xv" |
26 |
- if title: |
27 |
- # FIXME: do full escaping |
28 |
- command = command + " -name \"%s\"" % title |
29 |
+ command = executable = "xdg-open" |
30 |
return command, executable |
31 |
|
32 |
- if which("xv"): |
33 |
+ if which("xdg-open"): |
34 |
register(XVViewer) |
35 |
|
36 |
if __name__ == "__main__": |
37 |
|
38 |
|
39 |
|
40 |
1.1 dev-python/pillow/files/pillow-2.0.0-libm_linking.patch |
41 |
|
42 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pillow/files/pillow-2.0.0-libm_linking.patch?rev=1.1&view=markup |
43 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pillow/files/pillow-2.0.0-libm_linking.patch?rev=1.1&content-type=text/plain |
44 |
|
45 |
Index: pillow-2.0.0-libm_linking.patch |
46 |
=================================================================== |
47 |
--- setup.py |
48 |
+++ setup.py |
49 |
@@ -197,7 +197,7 @@ |
50 |
for file in _LIB_IMAGING: |
51 |
files.append(os.path.join("libImaging", file + ".c")) |
52 |
|
53 |
- libs = [] |
54 |
+ libs = ["m"] |
55 |
defs = [] |
56 |
if feature.jpeg: |
57 |
libs.append(feature.jpeg) |
58 |
@@ -249,7 +249,7 @@ |
59 |
libraries=[feature.tcl, feature.tk])) |
60 |
|
61 |
if os.path.isfile("_imagingmath.c"): |
62 |
- exts.append(Extension("_imagingmath", ["_imagingmath.c"])) |
63 |
+ exts.append(Extension("_imagingmath", ["_imagingmath.c"], libraries=["m"])) |
64 |
|
65 |
self.extensions[:] = exts |
66 |
|
67 |
|
68 |
|
69 |
|
70 |
1.1 dev-python/pillow/files/pillow-2.0.0-delete_hardcoded_paths.patch |
71 |
|
72 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pillow/files/pillow-2.0.0-delete_hardcoded_paths.patch?rev=1.1&view=markup |
73 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pillow/files/pillow-2.0.0-delete_hardcoded_paths.patch?rev=1.1&content-type=text/plain |
74 |
|
75 |
Index: pillow-2.0.0-delete_hardcoded_paths.patch |
76 |
=================================================================== |
77 |
--- setup.py |
78 |
+++ setup.py |
79 |
@@ -56,11 +56,6 @@ |
80 |
return None |
81 |
|
82 |
|
83 |
-def _lib_include(root): |
84 |
- # map root to (root/lib, root/include) |
85 |
- return os.path.join(root, "lib"), os.path.join(root, "include") |
86 |
- |
87 |
- |
88 |
def _read(file): |
89 |
return open(file, 'rb').read() |
90 |
|
91 |
@@ -105,102 +100,17 @@ |
92 |
_add_directory(include_dirs, include_root) |
93 |
|
94 |
# |
95 |
- # add platform directories |
96 |
- |
97 |
- if sys.platform == "cygwin": |
98 |
- # pythonX.Y.dll.a is in the /usr/lib/pythonX.Y/config directory |
99 |
- _add_directory(library_dirs, os.path.join( |
100 |
- "/usr/lib", "python%s" % sys.version[:3], "config")) |
101 |
- |
102 |
- elif sys.platform == "darwin": |
103 |
- # attempt to make sure we pick freetype2 over other versions |
104 |
- _add_directory(include_dirs, "/sw/include/freetype2") |
105 |
- _add_directory(include_dirs, "/sw/lib/freetype2/include") |
106 |
- # fink installation directories |
107 |
- _add_directory(library_dirs, "/sw/lib") |
108 |
- _add_directory(include_dirs, "/sw/include") |
109 |
- # darwin ports installation directories |
110 |
- _add_directory(library_dirs, "/opt/local/lib") |
111 |
- _add_directory(include_dirs, "/opt/local/include") |
112 |
- # freetype2 ships with X11 |
113 |
- _add_directory(library_dirs, "/usr/X11/lib") |
114 |
- _add_directory(include_dirs, "/usr/X11/include") |
115 |
- |
116 |
- elif sys.platform.startswith("linux"): |
117 |
- for platform_ in (platform.processor(),platform.architecture()[0]): |
118 |
- if not platform_: continue |
119 |
- |
120 |
- if platform_ in ["x86_64", "64bit"]: |
121 |
- _add_directory(library_dirs, "/lib64") |
122 |
- _add_directory(library_dirs, "/usr/lib64") |
123 |
- _add_directory(library_dirs, "/usr/lib/x86_64-linux-gnu") |
124 |
- break |
125 |
- elif platform_ in ["i386", "i686", "32bit"]: |
126 |
- _add_directory(library_dirs, "/usr/lib/i386-linux-gnu") |
127 |
- break |
128 |
- else: |
129 |
- raise ValueError("Unable to identify Linux platform: `%s`" % platform_) |
130 |
- |
131 |
- # XXX Kludge. Above /\ we brute force support multiarch. Here we |
132 |
- # try Barry's more general approach. Afterward, something should |
133 |
- # work ;-) |
134 |
- self.add_multiarch_paths() |
135 |
- |
136 |
- _add_directory(library_dirs, "/usr/local/lib") |
137 |
- # FIXME: check /opt/stuff directories here? |
138 |
- |
139 |
- prefix = sysconfig.get_config_var("prefix") |
140 |
- if prefix: |
141 |
- _add_directory(library_dirs, os.path.join(prefix, "lib")) |
142 |
- _add_directory(include_dirs, os.path.join(prefix, "include")) |
143 |
- |
144 |
- # |
145 |
# locate tkinter libraries |
146 |
|
147 |
|
148 |
if _tkinter: |
149 |
TCL_VERSION = _tkinter.TCL_VERSION[:3] |
150 |
|
151 |
- if _tkinter and not TCL_ROOT: |
152 |
- # we have Tkinter but the TCL_ROOT variable was not set; |
153 |
- # try to locate appropriate Tcl/Tk libraries |
154 |
- PYVERSION = sys.version[0] + sys.version[2] |
155 |
- TCLVERSION = TCL_VERSION[0] + TCL_VERSION[2] |
156 |
- roots = [ |
157 |
- # common installation directories, mostly for Windows |
158 |
- # (for Unix-style platforms, we'll check in well-known |
159 |
- # locations later) |
160 |
- os.path.join("/py" + PYVERSION, "Tcl"), |
161 |
- os.path.join("/python" + PYVERSION, "Tcl"), |
162 |
- "/Tcl", "/Tcl" + TCLVERSION, "/Tcl" + TCL_VERSION, |
163 |
- os.path.join(os.environ.get("ProgramFiles", ""), "Tcl"), |
164 |
- ] |
165 |
- for TCL_ROOT in roots: |
166 |
- TCL_ROOT = os.path.abspath(TCL_ROOT) |
167 |
- if os.path.isfile(os.path.join(TCL_ROOT, "include", "tk.h")): |
168 |
- # FIXME: use distutils logging (?) |
169 |
- print("--- using Tcl/Tk libraries at", TCL_ROOT) |
170 |
- print("--- using Tcl/Tk version", TCL_VERSION) |
171 |
- TCL_ROOT = _lib_include(TCL_ROOT) |
172 |
- break |
173 |
- else: |
174 |
- TCL_ROOT = None |
175 |
- |
176 |
|
177 |
# |
178 |
# add standard directories |
179 |
|
180 |
- # look for tcl specific subdirectory (e.g debian) |
181 |
- if _tkinter: |
182 |
- tcl_dir = "/usr/include/tcl" + TCL_VERSION |
183 |
- if os.path.isfile(os.path.join(tcl_dir, "tk.h")): |
184 |
- _add_directory(include_dirs, tcl_dir) |
185 |
- |
186 |
# standard locations |
187 |
- _add_directory(library_dirs, "/usr/local/lib") |
188 |
- _add_directory(include_dirs, "/usr/local/include") |
189 |
- |
190 |
- _add_directory(library_dirs, "/usr/lib") |
191 |
_add_directory(include_dirs, "/usr/include") |
192 |
|
193 |
# |
194 |
@@ -333,28 +243,7 @@ |
195 |
"_webp", ["_webp.c"], libraries=["webp"])) |
196 |
|
197 |
|
198 |
- if sys.platform == "darwin": |
199 |
- # locate Tcl/Tk frameworks |
200 |
- frameworks = [] |
201 |
- framework_roots = [ |
202 |
- "/Library/Frameworks", |
203 |
- "/System/Library/Frameworks"] |
204 |
- for root in framework_roots: |
205 |
- if (os.path.exists(os.path.join(root, "Tcl.framework")) and |
206 |
- os.path.exists(os.path.join(root, "Tk.framework"))): |
207 |
- print("--- using frameworks at %s" % root) |
208 |
- frameworks = ["-framework", "Tcl", "-framework", "Tk"] |
209 |
- dir = os.path.join(root, "Tcl.framework", "Headers") |
210 |
- _add_directory(self.compiler.include_dirs, dir, 0) |
211 |
- dir = os.path.join(root, "Tk.framework", "Headers") |
212 |
- _add_directory(self.compiler.include_dirs, dir, 1) |
213 |
- break |
214 |
- if frameworks: |
215 |
- exts.append(Extension( |
216 |
- "_imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"], |
217 |
- extra_compile_args=frameworks, extra_link_args=frameworks)) |
218 |
- feature.tcl = feature.tk = 1 # mark as present |
219 |
- elif feature.tcl and feature.tk: |
220 |
+ if feature.tcl and feature.tk: |
221 |
exts.append(Extension( |
222 |
"_imagingtk", ["_imagingtk.c", "Tk/tkImaging.c"], |
223 |
libraries=[feature.tcl, feature.tk])) |
224 |
@@ -445,30 +334,6 @@ |
225 |
if m.group(1) < "1.2.3": |
226 |
return m.group(1) |
227 |
|
228 |
- # http://hg.python.org/users/barry/rev/7e8deab93d5a |
229 |
- def add_multiarch_paths(self): |
230 |
- # Debian/Ubuntu multiarch support. |
231 |
- # https://wiki.ubuntu.com/MultiarchSpec |
232 |
- # self.build_temp |
233 |
- tmpfile = os.path.join(self.build_temp, 'multiarch') |
234 |
- if not os.path.exists(self.build_temp): |
235 |
- os.makedirs(self.build_temp) |
236 |
- ret = os.system('dpkg-architecture -qDEB_HOST_MULTIARCH > %s' % |
237 |
- tmpfile) |
238 |
- ret = os.system( |
239 |
- 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' % |
240 |
- tmpfile) |
241 |
- try: |
242 |
- if ret >> 8 == 0: |
243 |
- fp = open(tmpfile, 'r') |
244 |
- multiarch_path_component = fp.readline().strip() |
245 |
- _add_directory(self.compiler.library_dirs, |
246 |
- '/usr/lib/' + multiarch_path_component) |
247 |
- _add_directory(self.compiler.include_dirs, |
248 |
- '/usr/include/' + multiarch_path_component) |
249 |
- finally: |
250 |
- os.unlink(tmpfile) |
251 |
- |
252 |
setup( |
253 |
name=NAME, |
254 |
version=VERSION, |