Merge pull request #2786 from Xotic750/znc-add-icu-option
[feed/packages.git] / lang / pillow / patches / 010-fix-paths.patch
1 diff -rupN Pillow-3.2.0.orig/setup.py Pillow-3.2.0/setup.py
2 --- Pillow-3.2.0.orig/setup.py 2016-04-01 14:17:23.000000000 +0200
3 +++ Pillow-3.2.0/setup.py 2016-04-28 23:24:08.633969175 +0200
4 @@ -90,11 +90,11 @@ except (ImportError, OSError):
5 NAME = 'Pillow'
6 PILLOW_VERSION = '3.2.0'
7 TCL_ROOT = None
8 -JPEG_ROOT = None
9 +JPEG_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
10 JPEG2K_ROOT = None
11 -ZLIB_ROOT = None
12 -TIFF_ROOT = None
13 -FREETYPE_ROOT = None
14 +ZLIB_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
15 +TIFF_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
16 +FREETYPE_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
17 LCMS_ROOT = None
18
19
20 @@ -187,129 +187,6 @@ class pil_build_ext(build_ext):
21 _add_directory(library_dirs, os.path.join(prefix, "lib"))
22 _add_directory(include_dirs, os.path.join(prefix, "include"))
23
24 - #
25 - # add platform directories
26 -
27 - if sys.platform == "cygwin":
28 - # pythonX.Y.dll.a is in the /usr/lib/pythonX.Y/config directory
29 - _add_directory(library_dirs,
30 - os.path.join("/usr/lib", "python%s" %
31 - sys.version[:3], "config"))
32 -
33 - elif sys.platform == "darwin":
34 - # attempt to make sure we pick freetype2 over other versions
35 - _add_directory(include_dirs, "/sw/include/freetype2")
36 - _add_directory(include_dirs, "/sw/lib/freetype2/include")
37 - # fink installation directories
38 - _add_directory(library_dirs, "/sw/lib")
39 - _add_directory(include_dirs, "/sw/include")
40 - # darwin ports installation directories
41 - _add_directory(library_dirs, "/opt/local/lib")
42 - _add_directory(include_dirs, "/opt/local/include")
43 -
44 - # if Homebrew is installed, use its lib and include directories
45 - import subprocess
46 - try:
47 - prefix = subprocess.check_output(['brew', '--prefix']).strip(
48 - ).decode('latin1')
49 - except:
50 - # Homebrew not installed
51 - prefix = None
52 -
53 - ft_prefix = None
54 -
55 - if prefix:
56 - # add Homebrew's include and lib directories
57 - _add_directory(library_dirs, os.path.join(prefix, 'lib'))
58 - _add_directory(include_dirs, os.path.join(prefix, 'include'))
59 - ft_prefix = os.path.join(prefix, 'opt', 'freetype')
60 -
61 - if ft_prefix and os.path.isdir(ft_prefix):
62 - # freetype might not be linked into Homebrew's prefix
63 - _add_directory(library_dirs, os.path.join(ft_prefix, 'lib'))
64 - _add_directory(include_dirs,
65 - os.path.join(ft_prefix, 'include'))
66 - else:
67 - # fall back to freetype from XQuartz if
68 - # Homebrew's freetype is missing
69 - _add_directory(library_dirs, "/usr/X11/lib")
70 - _add_directory(include_dirs, "/usr/X11/include")
71 -
72 - elif sys.platform.startswith("linux"):
73 - arch_tp = (plat.processor(), plat.architecture()[0])
74 - if arch_tp == ("x86_64", "32bit"):
75 - # 32-bit build on 64-bit machine.
76 - _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
77 - else:
78 - for platform_ in arch_tp:
79 -
80 - if not platform_:
81 - continue
82 -
83 - if platform_ in ["x86_64", "64bit"]:
84 - _add_directory(library_dirs, "/lib64")
85 - _add_directory(library_dirs, "/usr/lib64")
86 - _add_directory(library_dirs,
87 - "/usr/lib/x86_64-linux-gnu")
88 - break
89 - elif platform_ in ["i386", "i686", "32bit"]:
90 - _add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
91 - break
92 - elif platform_ in ["aarch64"]:
93 - _add_directory(library_dirs, "/usr/lib64")
94 - _add_directory(library_dirs,
95 - "/usr/lib/aarch64-linux-gnu")
96 - break
97 - elif platform_ in ["arm", "armv7l"]:
98 - _add_directory(library_dirs,
99 - "/usr/lib/arm-linux-gnueabi")
100 - break
101 - elif platform_ in ["ppc64"]:
102 - _add_directory(library_dirs, "/usr/lib64")
103 - _add_directory(library_dirs,
104 - "/usr/lib/ppc64-linux-gnu")
105 - _add_directory(library_dirs,
106 - "/usr/lib/powerpc64-linux-gnu")
107 - break
108 - elif platform_ in ["ppc"]:
109 - _add_directory(library_dirs, "/usr/lib/ppc-linux-gnu")
110 - _add_directory(library_dirs,
111 - "/usr/lib/powerpc-linux-gnu")
112 - break
113 - elif platform_ in ["s390x"]:
114 - _add_directory(library_dirs, "/usr/lib64")
115 - _add_directory(library_dirs,
116 - "/usr/lib/s390x-linux-gnu")
117 - break
118 - elif platform_ in ["s390"]:
119 - _add_directory(library_dirs, "/usr/lib/s390-linux-gnu")
120 - break
121 - else:
122 - raise ValueError(
123 - "Unable to identify Linux platform: `%s`" % platform_)
124 -
125 - # XXX Kludge. Above /\ we brute force support multiarch. Here we
126 - # try Barry's more general approach. Afterward, something should
127 - # work ;-)
128 - self.add_multiarch_paths()
129 -
130 - elif sys.platform.startswith("gnu"):
131 - self.add_multiarch_paths()
132 -
133 - elif sys.platform.startswith("freebsd"):
134 - _add_directory(library_dirs, "/usr/local/lib")
135 - _add_directory(include_dirs, "/usr/local/include")
136 -
137 - elif sys.platform.startswith("netbsd"):
138 - _add_directory(library_dirs, "/usr/pkg/lib")
139 - _add_directory(include_dirs, "/usr/pkg/include")
140 -
141 - elif sys.platform.startswith("sunos5"):
142 - _add_directory(library_dirs, "/opt/local/lib")
143 - _add_directory(include_dirs, "/opt/local/include")
144 -
145 - # FIXME: check /opt/stuff directories here?
146 -
147 # locate tkinter libraries
148
149 if _tkinter:
150 @@ -343,21 +220,6 @@ class pil_build_ext(build_ext):
151 else:
152 TCL_ROOT = None
153
154 - # add standard directories
155 -
156 - # look for tcl specific subdirectory (e.g debian)
157 - if _tkinter:
158 - tcl_dir = "/usr/include/tcl" + TCL_VERSION
159 - if os.path.isfile(os.path.join(tcl_dir, "tk.h")):
160 - _add_directory(include_dirs, tcl_dir)
161 -
162 - # standard locations
163 - _add_directory(library_dirs, "/usr/local/lib")
164 - _add_directory(include_dirs, "/usr/local/include")
165 -
166 - _add_directory(library_dirs, "/usr/lib")
167 - _add_directory(include_dirs, "/usr/include")
168 -
169 # on Windows, look for the OpenJPEG libraries in the location that
170 # the official installer puts them
171 if sys.platform == "win32":
172 @@ -449,7 +311,7 @@ class pil_build_ext(build_ext):
173 # look for freetype2 include files
174 freetype_version = 0
175 for dir in self.compiler.include_dirs:
176 - if os.path.isfile(os.path.join(dir, "ft2build.h")):
177 + if os.path.isfile(os.path.join(dir, "freetype2/ft2build.h")):
178 freetype_version = 21
179 dir = os.path.join(dir, "freetype2")
180 break