1
- diff --git a/setup.py b/setup.py
2
- index 761d552..4ddc598 100755
3
- --- a/setup.py
4
- +++ b/setup.py
5
- @@ -136,12 +136,12 @@ except (ImportError, OSError):
1
+ --- Pillow-7.0.0/setup.py.orig 2020-01-02 06:19:26.000000000 +0100
2
+ +++ Pillow-7.0.0/setup.py 2020-02-22 17:33:03.121976748 +0100
3
+ @@ -29,13 +29,13 @@ def get_version():
6
4
7
- NAME = ' Pillow'
5
+ NAME = " Pillow"
8
6
PILLOW_VERSION = get_version()
7
+ - FREETYPE_ROOT = None
8
+ + FREETYPE_ROOT = tuple(os.environ['FREETYPE_ROOT'].split('|')) if 'FREETYPE_ROOT' in os.environ else None
9
+ IMAGEQUANT_ROOT = None
10
+ JPEG2K_ROOT = None
9
11
- JPEG_ROOT = None
10
12
+ JPEG_ROOT = tuple(os.environ['JPEG_ROOT'].split('|')) if 'JPEG_ROOT' in os.environ else None
11
- JPEG2K_ROOT = None
13
+ LCMS_ROOT = None
14
+ TIFF_ROOT = None
12
15
- ZLIB_ROOT = None
13
16
+ ZLIB_ROOT = tuple(os.environ['ZLIB_ROOT'].split('|')) if 'ZLIB_ROOT' in os.environ else None
14
- IMAGEQUANT_ROOT = None
15
- TIFF_ROOT = None
16
- - FREETYPE_ROOT = None
17
- + FREETYPE_ROOT = tuple(os.environ['FREETYPE_ROOT'].split('|')) if 'FREETYPE_ROOT' in os.environ else None
18
- LCMS_ROOT = None
19
17
20
18
21
- @@ -194,7 +194,7 @@ class pil_build_ext(build_ext):
22
- ]
19
+ if sys.platform == "win32" and sys.version_info >= (3, 9):
20
+ @@ -317,7 +317,7 @@ class pil_build_ext(build_ext):
21
+ )
23
22
24
23
def initialize_options(self):
25
24
- self.disable_platform_guessing = None
26
25
+ self.disable_platform_guessing = True
26
+ self.add_imaging_libs = ""
27
27
build_ext.initialize_options(self)
28
28
for x in self.feature:
29
- setattr(self, 'disable_%s' % x, None)
30
- @@ -466,61 +466,6 @@ class pil_build_ext(build_ext):
29
+ @@ -567,62 +567,6 @@ class pil_build_ext(build_ext):
31
30
feature.jpeg = "libjpeg" # alternative name
32
31
33
32
feature.openjpeg_version = None
34
- - if feature.want(' jpeg2000' ):
35
- - _dbg(' Looking for jpeg2000' )
33
+ - if feature.want(" jpeg2000" ):
34
+ - _dbg(" Looking for jpeg2000" )
36
35
- best_version = None
37
36
- best_path = None
38
37
-
39
38
- # Find the best version
40
39
- for directory in self.compiler.include_dirs:
41
- - _dbg(' Checking for openjpeg-#.# in %s' , directory)
40
+ - _dbg(" Checking for openjpeg-#.# in %s" , directory)
42
41
- try:
43
42
- listdir = os.listdir(directory)
44
43
- except Exception:
45
44
- # WindowsError, FileNotFoundError
46
45
- continue
47
46
- for name in listdir:
48
- - if name.startswith(' openjpeg-' ) and \
49
- - os.path.isfile(os.path. join(directory, name,
50
- - 'openjpeg.h') ):
51
- - _dbg(' Found openjpeg.h in %s/%s' , (directory, name))
52
- - version = tuple(int(x) for x in name[9:].split('.' ))
47
+ - if name.startswith(" openjpeg-" ) and os.path.isfile(
48
+ - os.path.join(directory, name, "openjpeg.h")
49
+ - ):
50
+ - _dbg(" Found openjpeg.h in %s/%s" , (directory, name))
51
+ - version = tuple(int(x) for x in name[9:].split("." ))
53
52
- if best_version is None or version > best_version:
54
53
- best_version = version
55
54
- best_path = os.path.join(directory, name)
56
- - _dbg('Best openjpeg version %s so far in %s',
57
- - (best_version, best_path))
55
+ - _dbg(
56
+ - "Best openjpeg version %s so far in %s",
57
+ - (best_version, best_path),
58
+ - )
58
59
-
59
- - if best_version and _find_library_file(self, ' openjp2' ):
60
+ - if best_version and _find_library_file(self, " openjp2" ):
60
61
- # Add the directory to the include path so we can include
61
62
- # <openjpeg.h> rather than having to cope with the versioned
62
63
- # include path
@@ -65,84 +66,95 @@ index 761d552..4ddc598 100755
65
66
- # self.compiler.include_dirs. Should investigate how that is
66
67
- # possible.
67
68
- _add_directory(self.compiler.include_dirs, best_path, 0)
68
- - feature.jpeg2000 = ' openjp2'
69
- - feature.openjpeg_version = '.' .join(str(x) for x in best_version)
69
+ - feature.jpeg2000 = " openjp2"
70
+ - feature.openjpeg_version = "." .join(str(x) for x in best_version)
70
71
-
71
- - if feature.want(' imagequant' ):
72
- - _dbg(' Looking for imagequant' )
73
- - if _find_include_file(self, ' libimagequant.h' ):
72
+ - if feature.want(" imagequant" ):
73
+ - _dbg(" Looking for imagequant" )
74
+ - if _find_include_file(self, " libimagequant.h" ):
74
75
- if _find_library_file(self, "imagequant"):
75
76
- feature.imagequant = "imagequant"
76
77
- elif _find_library_file(self, "libimagequant"):
77
78
- feature.imagequant = "libimagequant"
78
79
-
79
- - if feature.want(' tiff' ):
80
- - _dbg(' Looking for tiff' )
81
- - if _find_include_file(self, ' tiff.h' ):
80
+ - if feature.want(" tiff" ):
81
+ - _dbg(" Looking for tiff" )
82
+ - if _find_include_file(self, " tiff.h" ):
82
83
- if _find_library_file(self, "tiff"):
83
84
- feature.tiff = "tiff"
84
- - if sys.platform == "win32" and _find_library_file(self, "libtiff"):
85
- - feature.tiff = "libtiff"
86
- - if (sys.platform == "darwin" and
87
- - _find_library_file(self, "libtiff")):
85
+ - if sys.platform in ["win32", "darwin"] and _find_library_file(
86
+ - self, "libtiff"
87
+ - ):
88
88
- feature.tiff = "libtiff"
89
89
90
- if feature.want(' freetype' ):
91
- _dbg(' Looking for freetype' )
92
- @@ -546,36 +491 ,6 @@ class pil_build_ext(build_ext):
90
+ if feature.want(" freetype" ):
91
+ _dbg(" Looking for freetype" )
92
+ @@ -647,40 +591 ,6 @@ class pil_build_ext(build_ext):
93
93
if subdir:
94
94
_add_directory(self.compiler.include_dirs, subdir, 0)
95
95
96
- - if feature.want(' lcms' ):
97
- - _dbg(' Looking for lcms' )
96
+ - if feature.want(" lcms" ):
97
+ - _dbg(" Looking for lcms" )
98
98
- if _find_include_file(self, "lcms2.h"):
99
99
- if _find_library_file(self, "lcms2"):
100
100
- feature.lcms = "lcms2"
101
101
- elif _find_library_file(self, "lcms2_static"):
102
102
- # alternate Windows name.
103
103
- feature.lcms = "lcms2_static"
104
104
-
105
- - if feature.want('webp'):
106
- - _dbg('Looking for webp')
107
- - if (_find_include_file(self, "webp/encode.h") and
108
- - _find_include_file(self, "webp/decode.h")):
105
+ - if feature.want("webp"):
106
+ - _dbg("Looking for webp")
107
+ - if _find_include_file(self, "webp/encode.h") and _find_include_file(
108
+ - self, "webp/decode.h"
109
+ - ):
109
110
- # In Google's precompiled zip it is call "libwebp":
110
111
- if _find_library_file(self, "webp"):
111
112
- feature.webp = "webp"
112
113
- elif _find_library_file(self, "libwebp"):
113
114
- feature.webp = "libwebp"
114
115
-
115
- - if feature.want('webpmux'):
116
- - _dbg('Looking for webpmux')
117
- - if (_find_include_file(self, "webp/mux.h") and
118
- - _find_include_file(self, "webp/demux.h")):
119
- - if (_find_library_file(self, "webpmux") and
120
- - _find_library_file(self, "webpdemux")):
116
+ - if feature.want("webpmux"):
117
+ - _dbg("Looking for webpmux")
118
+ - if _find_include_file(self, "webp/mux.h") and _find_include_file(
119
+ - self, "webp/demux.h"
120
+ - ):
121
+ - if _find_library_file(self, "webpmux") and _find_library_file(
122
+ - self, "webpdemux"
123
+ - ):
121
124
- feature.webpmux = "webpmux"
122
- - if (_find_library_file(self, "libwebpmux") and
123
- - _find_library_file(self, "libwebpdemux")):
125
+ - if _find_library_file(self, "libwebpmux") and _find_library_file(
126
+ - self, "libwebpdemux"
127
+ - ):
124
128
- feature.webpmux = "libwebpmux"
125
129
-
126
130
for f in feature:
127
131
if not getattr(feature, f) and feature.require(f):
128
- if f in (' jpeg', ' zlib' ):
129
- @@ -612 ,8 +527,6 @@ class pil_build_ext(build_ext):
132
+ if f in (" jpeg", " zlib" ):
133
+ @@ -717 ,8 +627,8 @@ class pil_build_ext(build_ext):
130
134
defs.append(("HAVE_LIBTIFF", None))
131
135
if sys.platform == "win32":
132
136
libs.extend(["kernel32", "user32", "gdi32"])
133
- - if struct.unpack("h", "\0\1".encode('ascii') )[0] == 1:
137
+ - if struct.unpack("h", b "\0\1")[0] == 1:
134
138
- defs.append(("WORDS_BIGENDIAN", None))
139
+ + # if struct.unpack("h", b"\0\1")[0] == 1:
140
+ + # defs.append(("WORDS_BIGENDIAN", None))
135
141
136
142
if sys.platform == "win32" and not (PLATFORM_PYPY or PLATFORM_MINGW):
137
143
defs.append(("PILLOW_VERSION", '"\\"%s\\""' % PILLOW_VERSION))
138
- @@ -658,10 +571,6 @@ class pil_build_ext(build_ext):
139
- define_macros=defs))
140
-
141
- tk_libs = ['psapi'] if sys.platform == 'win32' else []
142
- - exts.append(Extension("PIL._imagingtk",
143
- - ["src/_imagingtk.c", "src/Tk/tkImaging.c"],
144
- - include_dirs=['src/Tk'],
145
- - libraries=tk_libs))
144
+ @@ -769,16 +679,6 @@ class pil_build_ext(build_ext):
145
+ )
146
+ )
146
147
148
+ - tk_libs = ["psapi"] if sys.platform == "win32" else []
149
+ - exts.append(
150
+ - Extension(
151
+ - "PIL._imagingtk",
152
+ - ["src/_imagingtk.c", "src/Tk/tkImaging.c"],
153
+ - include_dirs=["src/Tk"],
154
+ - libraries=tk_libs,
155
+ - )
156
+ - )
157
+ -
147
158
exts.append(Extension("PIL._imagingmath", ["src/_imagingmath.c"]))
148
159
exts.append(Extension("PIL._imagingmorph", ["src/_imagingmorph.c"]))
160
+
0 commit comments