MINGW-packages/mingw-w64-python-pycurl/001-pycurl-setup-fix.patch
2021-11-21 22:00:30 +08:00

78 lines
3.3 KiB
Diff

diff -urN pycurl-REL_7_44_1-orig/setup.py pycurl-REL_7_44_1/setup.py
--- pycurl-REL_7_44_1-orig/setup.py 2021-08-16 03:31:12 +0800
+++ pycurl-REL_7_44_1/setup.py 2021-11-21 21:58:50 +0800
@@ -119,7 +119,7 @@
fail("FATAL: bad directory %s in environment variable %s" % (dir, envvar))
def detect_features(self):
- p = subprocess.Popen((self.curl_config(), '--features'),
+ p = subprocess.Popen(('sh', self.curl_config(), '--features'),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
if p.wait() != 0:
@@ -231,7 +231,7 @@
self.include_dirs.append(os.path.join(OPENSSL_DIR, "include"))
self.library_dirs.append(os.path.join(OPENSSL_DIR, "lib"))
try:
- p = subprocess.Popen((self.curl_config(), '--version'),
+ p = subprocess.Popen(('sh', self.curl_config(), '--version'),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except OSError:
exc = sys.exc_info()[1]
@@ -245,7 +245,7 @@
raise ConfigurationError(msg)
libcurl_version = stdout.decode().strip()
print("Using %s (%s)" % (self.curl_config(), libcurl_version))
- p = subprocess.Popen((self.curl_config(), '--cflags'),
+ p = subprocess.Popen(('sh', self.curl_config(), '--cflags'),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
if p.wait() != 0:
@@ -286,8 +286,8 @@
optbuf = ''
sslhintbuf = ''
errtext = ''
- for option in ["--libs", "--static-libs"]:
- p = subprocess.Popen((self.curl_config(), option),
+ if sys.platform == 'win32':
+ p = subprocess.Popen(('pkg-config', '--libs', '--static', 'libcurl'),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
if p.wait() == 0:
@@ -389,7 +389,7 @@
def detect_ssl_lib_using_curl_config(self):
ssl_lib_detected = None
- p = subprocess.Popen((self.curl_config(), '--ssl-backends'),
+ p = subprocess.Popen(('sh', self.curl_config(), '--ssl-backends'),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
if p.wait() != 0:
@@ -478,7 +478,7 @@
# connect.microsoft.com/VisualStudio/feedback/details/475896/link-fatal-error-lnk1117-syntax-error-in-option-opt-nowin98/
self.extra_link_args.append("/opt:nowin98") # use small section alignment
- if sys.platform == "win32":
+ if str.find(sys.version, "MSC") >= 0:
configure = configure_windows
else:
configure = configure_unix
@@ -532,7 +532,7 @@
def using_openssl(self):
self.define_macros.append(('HAVE_CURL_OPENSSL', 1))
- if sys.platform == "win32":
+ if str.find(sys.version, "MSC") >= 0:
# CRYPTO_num_locks is defined in libeay32.lib
# for openssl < 1.1.0; it is a noop for openssl >= 1.1.0
self.extra_link_args.append(self.openssl_lib_name)
@@ -607,7 +607,7 @@
def strip_pycurl_options(argv):
- if sys.platform == 'win32':
+ if str.find(sys.version, "MSC") >= 0:
options = [
'--curl-dir=', '--libcurl-lib-name=', '--use-libcurl-dll',
'--avoid-stdio', '--with-openssl',