Files
MINGW-packages/mingw-w64-python3/0390-MINGW-exclude-unix-only-modules.patch
2016-07-12 14:49:26 +03:00

69 lines
2.7 KiB
Diff

diff -Naur Python-3.5.2-orig/setup.py Python-3.5.2/setup.py
--- Python-3.5.2-orig/setup.py 2016-07-12 14:21:24.401800700 +0300
+++ Python-3.5.2/setup.py 2016-07-12 14:21:24.724300700 +0300
@@ -668,11 +668,20 @@
if (config_h_vars.get('FLOCK_NEEDS_LIBBSD', False)):
# May be necessary on AIX for flock function
libs = ['bsd']
- exts.append( Extension('fcntl', ['fcntlmodule.c'], libraries=libs) )
+ if not host_platform.startswith(('mingw', 'win')):
+ exts.append( Extension('fcntl', ['fcntlmodule.c'], libraries=libs) )
+ else:
+ missing.append('fcntl')
# pwd(3)
- exts.append( Extension('pwd', ['pwdmodule.c']) )
+ if not host_platform.startswith(('mingw', 'win')):
+ exts.append( Extension('pwd', ['pwdmodule.c']) )
+ else:
+ missing.append('pwd')
# grp(3)
- exts.append( Extension('grp', ['grpmodule.c']) )
+ if not host_platform.startswith(('mingw', 'win')):
+ exts.append( Extension('grp', ['grpmodule.c']) )
+ else:
+ missing.append('grp')
# spwd, shadow passwords
if (config_h_vars.get('HAVE_GETSPNAM', False) or
config_h_vars.get('HAVE_GETSPENT', False)):
@@ -695,7 +704,10 @@
# Lance Ellinghaus's syslog module
# syslog daemon interface
- exts.append( Extension('syslog', ['syslogmodule.c']) )
+ if not host_platform.startswith(('mingw', 'win')):
+ exts.append( Extension('syslog', ['syslogmodule.c']) )
+ else:
+ missing.append('syslog')
#
# Here ends the simple stuff. From here on, modules need certain
@@ -799,17 +811,23 @@
# crypt module.
- if self.compiler.find_library_file(lib_dirs, 'crypt'):
- libs = ['crypt']
+ if not host_platform.startswith(('mingw', 'win')):
+ if self.compiler.find_library_file(lib_dirs, 'crypt'):
+ libs = ['crypt']
+ else:
+ libs = []
+ exts.append( Extension('_crypt', ['_cryptmodule.c'], libraries=libs) )
else:
- libs = []
- exts.append( Extension('_crypt', ['_cryptmodule.c'], libraries=libs) )
+ missing.append('_crypt')
# CSV files
exts.append( Extension('_csv', ['_csv.c']) )
# POSIX subprocess module helper.
- exts.append( Extension('_posixsubprocess', ['_posixsubprocess.c']) )
+ if not host_platform.startswith(('mingw', 'win')):
+ exts.append( Extension('_posixsubprocess', ['_posixsubprocess.c']) )
+ else:
+ missing.append('_posixsubprocess')
# socket(2)
socket_libs = []