39 lines
1.3 KiB
Diff
39 lines
1.3 KiB
Diff
--- a/setup.py
|
|
+++ b/setup.py
|
|
@@ -330,7 +330,7 @@
|
|
|
|
|
|
def load_libraries():
|
|
- if os.getenv("NIX_STORE"):
|
|
+ if os.getenv("NIX_STORE") or os.getenv("MINGW_PREFIX"):
|
|
return LIBRARIES["nix"]
|
|
|
|
try:
|
|
@@ -525,7 +525,8 @@
|
|
openbsd = platform.system() == 'OpenBSD'
|
|
freebsd = platform.system() == 'FreeBSD'
|
|
darwin = platform.system() == 'Darwin'
|
|
-windows = platform.system() == 'Windows' or platform.system().startswith('CYGWIN')
|
|
+windows = (platform.system() == 'Windows' and "MSC" in sys.version) or platform.system().startswith('CYGWIN')
|
|
+mingw = platform.system() == 'Windows' and "MSC" not in sys.version
|
|
|
|
if 'sdist' in sys.argv:
|
|
# Create local mupdf.tgz, for inclusion in sdist.
|
|
@@ -711,6 +712,16 @@
|
|
'harfbuzz',
|
|
]
|
|
|
|
+ elif mingw:
|
|
+ mingw_prefix = os.getenv("MINGW_PREFIX", "/mingw64")
|
|
+ include_dirs.append( f'{mingw_prefix}/include/mupdf')
|
|
+ include_dirs.append( f'{mingw_prefix}/include/freetype2')
|
|
+ extra_compile_args.append( '-Wno-incompatible-pointer-types')
|
|
+ extra_compile_args.append( '-Wno-pointer-sign')
|
|
+ extra_compile_args.append( '-Wno-sign-compare')
|
|
+ libraries = load_libraries()
|
|
+ libraries += ['z']
|
|
+
|
|
elif windows:
|
|
# Windows.
|
|
assert mupdf_local
|