MINGW-packages/mingw-w64-python-pyzmq/001-mingw-python.patch
2023-08-09 20:38:18 +05:30

40 lines
1.5 KiB
Diff

diff --git a/setup.py b/setup.py
index 049771d..619588c 100644
--- a/setup.py
+++ b/setup.py
@@ -30,6 +30,7 @@
from subprocess import PIPE, CalledProcessError, Popen, check_call
from sysconfig import get_config_var
from traceback import print_exc
+from sysconfig import _POSIX_BUILD
from packaging.version import Version as V
from setuptools import Command, setup
@@ -152,7 +153,7 @@
# is this necessary?
if sys.platform.startswith('freebsd'):
settings['libraries'].append('pthread')
- elif sys.platform.startswith('win'):
+ elif sys.platform.startswith('win') and not _POSIX_BUILD:
# link against libzmq in build dir:
if sys.version_info < (3, 9, 2):
# bpo-39825: EXT_SUFFIX is wrong from sysconfig prior to 3.9.2 / 3.8.7
@@ -513,7 +514,7 @@
)
line()
- if sys.platform.startswith('win'):
+ if sys.platform.startswith('win') and not _POSIX_BUILD:
# fetch libzmq.dll into local dir
local_dll = localpath('zmq', libzmq_name + '.dll')
if not zmq_prefix and not os.path.exists(local_dll):
@@ -609,7 +610,7 @@
libzmq.define_macros.append(('ZMQ_IOTHREADS_USE_POLL', 1))
libzmq.define_macros.append(('ZMQ_POLL_BASED_ON_POLL', 1))
- if sys.platform.startswith('win'):
+ if sys.platform.startswith('win') and not _POSIX_BUILD:
# include defines from zeromq msvc project:
libzmq.define_macros.append(('FD_SETSIZE', 16384))
libzmq.define_macros.append(('DLL_EXPORT', 1))