parent
17852b5c42
commit
bd534fbae3
@ -0,0 +1,78 @@
|
||||
diff -rupN --no-dereference Pillow-9.0.1/setup.py Pillow-9.0.1-new/setup.py
|
||||
--- Pillow-9.0.1/setup.py 2022-02-03 00:45:27.000000000 +0100
|
||||
+++ Pillow-9.0.1-new/setup.py 2022-02-23 09:06:33.272472288 +0100
|
||||
@@ -135,7 +135,7 @@ class RequiredDependencyException(Except
|
||||
pass
|
||||
|
||||
|
||||
-PLATFORM_MINGW = os.name == "nt" and "GCC" in sys.version
|
||||
+PLATFORM_MINGW = "mingw32" in os.getenv("CC")
|
||||
PLATFORM_PYPY = hasattr(sys, "pypy_version_info")
|
||||
|
||||
|
||||
@@ -497,7 +497,7 @@ class pil_build_ext(build_ext):
|
||||
#
|
||||
# add platform directories
|
||||
|
||||
- if self.disable_platform_guessing:
|
||||
+ if self.disable_platform_guessing or PLATFORM_MINGW:
|
||||
pass
|
||||
|
||||
elif sys.platform == "cygwin":
|
||||
@@ -589,7 +589,7 @@ class pil_build_ext(build_ext):
|
||||
# FIXME: check /opt/stuff directories here?
|
||||
|
||||
# standard locations
|
||||
- if not self.disable_platform_guessing:
|
||||
+ if not self.disable_platform_guessing and not PLATFORM_MINGW:
|
||||
_add_directory(library_dirs, "/usr/local/lib")
|
||||
_add_directory(include_dirs, "/usr/local/include")
|
||||
|
||||
@@ -835,7 +835,7 @@ class pil_build_ext(build_ext):
|
||||
if feature.xcb:
|
||||
libs.append(feature.xcb)
|
||||
defs.append(("HAVE_XCB", None))
|
||||
- if sys.platform == "win32":
|
||||
+ if sys.platform == "win32" or PLATFORM_MINGW:
|
||||
libs.extend(["kernel32", "user32", "gdi32"])
|
||||
if struct.unpack("h", b"\0\1")[0] == 1:
|
||||
defs.append(("WORDS_BIGENDIAN", None))
|
||||
@@ -857,6 +857,8 @@ class pil_build_ext(build_ext):
|
||||
if feature.freetype:
|
||||
srcs = []
|
||||
libs = ["freetype"]
|
||||
+ if sys.platform == "win32" or PLATFORM_MINGW:
|
||||
+ libs.extend(["dl"])
|
||||
defs = []
|
||||
if feature.raqm:
|
||||
if not feature.want_vendor("raqm"): # using system Raqm
|
||||
@@ -879,7 +881,7 @@ class pil_build_ext(build_ext):
|
||||
|
||||
if feature.lcms:
|
||||
extra = []
|
||||
- if sys.platform == "win32":
|
||||
+ if sys.platform == "win32" or PLATFORM_MINGW:
|
||||
extra.extend(["user32", "gdi32"])
|
||||
self._update_extension("PIL._imagingcms", [feature.lcms] + extra)
|
||||
else:
|
||||
@@ -898,7 +900,7 @@ class pil_build_ext(build_ext):
|
||||
else:
|
||||
self._remove_extension("PIL._webp")
|
||||
|
||||
- tk_libs = ["psapi"] if sys.platform in ("win32", "cygwin") else []
|
||||
+ tk_libs = ["psapi"] if sys.platform in ("win32", "cygwin") or PLATFORM_MINGW else []
|
||||
self._update_extension("PIL._imagingtk", tk_libs)
|
||||
|
||||
build_ext.build_extensions(self)
|
||||
diff -rupN --no-dereference Pillow-9.0.1/src/libImaging/ImPlatform.h Pillow-9.0.1-new/src/libImaging/ImPlatform.h
|
||||
--- Pillow-9.0.1/src/libImaging/ImPlatform.h 2022-02-03 00:45:27.000000000 +0100
|
||||
+++ Pillow-9.0.1-new/src/libImaging/ImPlatform.h 2022-02-23 09:06:33.272472288 +0100
|
||||
@@ -28,7 +28,7 @@
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
-#include <Windows.h>
|
||||
+#include <windows.h>
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
#undef _WIN64
|
Loading…
Reference in new issue