diff --git a/python3/3.3-PATH_MAX.patch b/python3/3.3-PATH_MAX.patch new file mode 100644 index 00000000..ea9a6118 --- /dev/null +++ b/python3/3.3-PATH_MAX.patch @@ -0,0 +1,14 @@ +--- Python-3.3.2-orig/Modules/main.c 2013-05-15 20:32:59.000000000 +0400 ++++ Python-3.3.2/Modules/main.c 2013-08-02 00:00:38.549804600 +0400 +@@ -14,9 +14,11 @@ + #include + #ifdef HAVE_FCNTL_H + #include ++#ifndef PATH_MAX + #define PATH_MAX MAXPATHLEN + #endif + #endif ++#endif + + #ifdef _MSC_VER + #include diff --git a/python3/3.3-ctypes-libpython.patch b/python3/3.3-ctypes-libpython.patch new file mode 100644 index 00000000..43a0fd03 --- /dev/null +++ b/python3/3.3-ctypes-libpython.patch @@ -0,0 +1,12 @@ +--- Python-3.3.2-orig/Lib/ctypes/__init__.py 2013-08-02 00:29:33.877929600 +0400 ++++ Python-3.3.2/Lib/ctypes/__init__.py 2013-05-15 20:32:54.000000000 +0400 +@@ -436,7 +436,8 @@ + if _os.name in ("nt", "ce"): + pythonapi = PyDLL("python dll", None, _sys.dllhandle) + elif _sys.platform == "cygwin": +- pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) ++ pythonapi = PyDLL("libpython%d.%d%s.dll" % \ ++ (_sys.version_info[:2] + tuple(_sys.abiflags))) + else: + pythonapi = PyDLL(None) + diff --git a/python3/3.3-ctypes-util-find_library.patch b/python3/3.3-ctypes-util-find_library.patch new file mode 100644 index 00000000..78795cae --- /dev/null +++ b/python3/3.3-ctypes-util-find_library.patch @@ -0,0 +1,39 @@ +--- Python-3.3.2-orig/Lib/ctypes/util.py 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Lib/ctypes/util.py 2013-08-01 23:57:43.715820300 +0400 +@@ -83,6 +83,25 @@ + continue + return None + ++elif sys.platform == "cygwin": ++ def find_library(name): ++ for libdir in ['/usr/lib', '/usr/local/lib']: ++ for libext in ['lib%s.dll.a' % name, 'lib%s.a' % name]: ++ implib = os.path.join(libdir, libext) ++ if not os.path.exists(implib): ++ continue ++ cmd = "dlltool -I " + implib + " 2>/dev/null" ++ f = os.popen(cmd) ++ try: ++ data = f.read() ++ finally: ++ f.close() ++ res = data.replace("\n","") ++ if not res: ++ continue ++ return res ++ return None ++ + elif os.name == "posix": + # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump + import re, tempfile, errno +@@ -256,6 +275,10 @@ + print(cdll.LoadLibrary("libcrypto.dylib")) + print(cdll.LoadLibrary("libSystem.dylib")) + print(cdll.LoadLibrary("System.framework/System")) ++ elif sys.platform == "cygwin": ++ print(cdll.LoadLibrary("cygbz2-1.dll")) ++ print(find_library("crypt")) ++ print(cdll.LoadLibrary("cygcrypt-0.dll")) + else: + print(cdll.LoadLibrary("libm.so")) + print(cdll.LoadLibrary("libcrypt.so")) diff --git a/python3/3.3-cygwin-soname.patch b/python3/3.3-cygwin-soname.patch new file mode 100644 index 00000000..6a78bf2d --- /dev/null +++ b/python3/3.3-cygwin-soname.patch @@ -0,0 +1,46 @@ +--- Python-3.3.2-orig/Lib/distutils/command/build_ext.py 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Lib/distutils/command/build_ext.py 2013-08-02 00:15:05.345703100 +0400 +@@ -730,9 +730,9 @@ + # extensions, it is a reference to the original list + return ext.libraries + [pythonlib] + elif sys.platform[:6] == "cygwin": +- template = "python%d.%d" ++ template = "python%d.%d%s" + pythonlib = (template % +- (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff)) ++ (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff, sys.abiflags)) + # don't extend ext.libraries, it may be shared with other + # extensions, it is a reference to the original list + return ext.libraries + [pythonlib] +--- Python-3.3.2-orig/Modules/makesetup 2013-05-15 20:32:59.000000000 +0400 ++++ Python-3.3.2/Modules/makesetup 2013-08-02 00:17:46.703125000 +0400 +@@ -91,7 +91,7 @@ + else + ExtraLibDir='$(LIBPL)' + fi +- ExtraLibs="-L$ExtraLibDir -lpython\$(VERSION)";; ++ ExtraLibs="-L$ExtraLibDir -lpython\$(LDVERSION)";; + esac + + # Main loop +--- Python-3.3.2-orig/configure.ac 2013-05-15 20:33:00.000000000 +0400 ++++ Python-3.3.2/configure.ac 2013-08-02 00:18:22.859375000 +0400 +@@ -921,6 +921,7 @@ + case $ac_sys_system in + CYGWIN*) + LDLIBRARY='libpython$(LDVERSION).dll.a' ++ BLDLIBRARY='-L. -lpython$(LDVERSION)' + DLLLIBRARY='libpython$(LDVERSION).dll' + ;; + SunOS*) +--- Python-3.3.2-orig/Makefile.pre.in 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Makefile.pre.in 2013-08-02 00:16:23.352539000 +0400 +@@ -560,7 +560,7 @@ + + # This rule builds the Cygwin Python DLL and import library if configured + # for a shared core library; otherwise, this rule is a noop. +-$(DLLLIBRARY) libpython$(VERSION).dll.a: $(LIBRARY_OBJS) ++$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS) + if test -n "$(DLLLIBRARY)"; then \ + $(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \ + $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST); \ diff --git a/python3/3.3-dbm.patch b/python3/3.3-dbm.patch new file mode 100644 index 00000000..effa906a --- /dev/null +++ b/python3/3.3-dbm.patch @@ -0,0 +1,27 @@ +--- Python-3.3.2-orig/setup.py 2013-05-15 20:33:00.000000000 +0400 ++++ Python-3.3.2/setup.py 2013-08-01 23:45:32.806640600 +0400 +@@ -1137,7 +1137,7 @@ + dbm_setup_debug = False # verbose debug prints from this script? + dbm_order = ['gdbm'] + # The standard Unix dbm module: +- if host_platform not in ['cygwin']: ++ if host_platform not in ['win32']: + config_args = [arg.strip("'") + for arg in sysconfig.get_config_var("CONFIG_ARGS").split()] + dbm_args = [arg for arg in config_args +@@ -1192,6 +1192,15 @@ + ], + libraries = gdbm_libs) + break ++ if find_file("ndbm.h", inc_dirs, []) is not None: ++ print("building dbm using gdbm") ++ dbmext = Extension( ++ '_dbm', ['_dbmmodule.c'], ++ define_macros=[ ++ ('HAVE_NDBM_H', None), ++ ], ++ libraries = gdbm_libs) ++ break + elif cand == "bdb": + if db_incs is not None: + if dbm_setup_debug: print("building dbm using bdb") diff --git a/python3/3.3-distutils-shlibext.patch b/python3/3.3-distutils-shlibext.patch new file mode 100644 index 00000000..fe65a661 --- /dev/null +++ b/python3/3.3-distutils-shlibext.patch @@ -0,0 +1,23 @@ +--- Python-3.3.2-orig/Lib/distutils/cygwinccompiler.py 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Lib/distutils/cygwinccompiler.py 2013-08-02 00:24:11.022460900 +0400 +@@ -91,9 +91,7 @@ + compiler_type = 'cygwin' + obj_extension = ".o" + static_lib_extension = ".a" +- shared_lib_extension = ".dll" +- static_lib_format = "lib%s%s" +- shared_lib_format = "%s%s" ++ shared_lib_extension = ".dll.a" + exe_extension = ".exe" + + def __init__(self, verbose=0, dry_run=0, force=0): +--- Python-3.3.2-orig/Lib/distutils/unixccompiler.py 2013-08-01 23:49:16.568359300 +0400 ++++ Python-3.3.2/Lib/distutils/unixccompiler.py 2013-08-02 00:25:54.459960900 +0400 +@@ -79,6 +79,7 @@ + static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" + if sys.platform == "cygwin": + exe_extension = ".exe" ++ dylib_lib_extension = ".dll.a" + + def preprocess(self, source, output_file=None, macros=None, + include_dirs=None, extra_preargs=None, extra_postargs=None): diff --git a/python3/3.3-enable-new-dtags.patch b/python3/3.3-enable-new-dtags.patch new file mode 100644 index 00000000..e9e870e1 --- /dev/null +++ b/python3/3.3-enable-new-dtags.patch @@ -0,0 +1,11 @@ +--- Python-3.3.2-orig/Lib/distutils/unixccompiler.py 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Lib/distutils/unixccompiler.py 2013-08-01 23:49:16.568359300 +0400 +@@ -222,7 +222,7 @@ + # the configuration data stored in the Python installation, so + # we use this hack. + compiler = os.path.basename(sysconfig.get_config_var("CC")) +- if sys.platform[:6] == "darwin": ++ if sys.platform[:6] == "darwin" or sys.platform[:6] == "cygwin": + # MacOSX's linker doesn't understand the -R flag at all + return "-L" + dir + elif sys.platform[:5] == "hp-ux": diff --git a/python3/3.3-export-PyNode_SizeOf.patch b/python3/3.3-export-PyNode_SizeOf.patch new file mode 100644 index 00000000..dc1e66b2 --- /dev/null +++ b/python3/3.3-export-PyNode_SizeOf.patch @@ -0,0 +1,11 @@ +--- Python-3.3.2-orig/Include/node.h 2013-05-15 20:32:53.000000000 +0400 ++++ Python-3.3.2/Include/node.h 2013-08-02 00:11:53.044921800 +0400 +@@ -21,7 +21,7 @@ + char *str, int lineno, int col_offset); + PyAPI_FUNC(void) PyNode_Free(node *n); + #ifndef Py_LIMITED_API +-Py_ssize_t _PyNode_SizeOf(node *n); ++PyAPI_FUNC(Py_ssize_t) _PyNode_SizeOf(node *n); + #endif + + /* Node access functions */ diff --git a/python3/3.3-export-PySignal_SetWakeupFd.patch b/python3/3.3-export-PySignal_SetWakeupFd.patch new file mode 100644 index 00000000..9793acf3 --- /dev/null +++ b/python3/3.3-export-PySignal_SetWakeupFd.patch @@ -0,0 +1,11 @@ +--- Python-3.3.2-orig/Include/pyerrors.h 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Include/pyerrors.h 2013-08-02 00:09:05.202148400 +0400 +@@ -290,7 +290,7 @@ + + /* In signalmodule.c */ + #ifndef Py_LIMITED_API +-int PySignal_SetWakeupFd(int fd); ++PyAPI_FUNC(int) PySignal_SetWakeupFd(int fd); + #endif + + /* Support for adding program text to SyntaxErrors */ diff --git a/python3/3.3-fix-PyAPI-declaration.patch b/python3/3.3-fix-PyAPI-declaration.patch new file mode 100644 index 00000000..e7904280 --- /dev/null +++ b/python3/3.3-fix-PyAPI-declaration.patch @@ -0,0 +1,18 @@ +--- Python-3.3.2-orig/Include/pyport.h 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Include/pyport.h 2013-08-02 11:50:31.637695300 +0400 +@@ -760,7 +760,15 @@ + /* http://docs.python.org/extending/windows.html#a-cookbook-approach */ + # if !defined(__CYGWIN__) + # define PyAPI_FUNC(RTYPE) __declspec(dllimport) RTYPE ++# else ++# define PyAPI_FUNC(RTYPE) RTYPE + # endif /* !__CYGWIN__ */ ++ /* NOTE: The issue3945 "compile error in _fileio.c (cygwin)" ++ * was resolved with modification of code. ++ * This issue was resolved for gcc(mingw) with enabling auto ++ * import feature. Since _fileio.c problem now disappear there ++ * is no more reasons to avoid dllimport for gcc(mingw). ++ */ + # define PyAPI_DATA(RTYPE) extern __declspec(dllimport) RTYPE + /* module init functions outside the core must be exported */ + # if defined(__cplusplus) diff --git a/python3/3.3-fix-sqlite-module.patch b/python3/3.3-fix-sqlite-module.patch new file mode 100644 index 00000000..f77fa5ad --- /dev/null +++ b/python3/3.3-fix-sqlite-module.patch @@ -0,0 +1,15 @@ +--- Python-3.3.2-orig/Modules/_sqlite/connection.c 2013-05-15 20:32:58.000000000 +0400 ++++ Python-3.3.2/Modules/_sqlite/connection.c 2013-08-02 00:49:59.884765600 +0400 +@@ -712,9 +712,12 @@ + } + + error: ++ { + #ifdef WITH_THREAD + PyGILState_Release(threadstate); + #endif ++ ; ++ } + } + + static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self) diff --git a/python3/3.3-ncurses-abi6.patch b/python3/3.3-ncurses-abi6.patch new file mode 100644 index 00000000..1ad66e1b --- /dev/null +++ b/python3/3.3-ncurses-abi6.patch @@ -0,0 +1,16 @@ +--- Python-3.3.2-orig/Include/py_curses.h 2013-05-15 20:32:53.000000000 +0400 ++++ Python-3.3.2/Include/py_curses.h 2013-08-02 00:05:13.842773400 +0400 +@@ -17,6 +17,13 @@ + #define NCURSES_OPAQUE 0 + #endif /* __APPLE__ */ + ++#ifdef __CYGWIN__ ++/* the following define is necessary for Cygwin; without it, the ++ Cygwin-supplied ncurses.h sets NCURSES_OPAQUE to 1, and then Python ++ can't get at the WINDOW flags field. */ ++#define NCURSES_INTERNALS ++#endif /* __CYGWIN__ */ ++ + #ifdef __FreeBSD__ + /* + ** On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards diff --git a/python3/3.3-pep3149.patch b/python3/3.3-pep3149.patch new file mode 100644 index 00000000..5a77debe --- /dev/null +++ b/python3/3.3-pep3149.patch @@ -0,0 +1,21 @@ +--- Python-3.3.2-orig/configure.ac 2013-08-02 00:18:22.859375000 +0400 ++++ Python-3.3.2/configure.ac 2013-08-02 00:35:10.071289000 +0400 +@@ -3945,7 +3945,7 @@ + + AC_SUBST(EXT_SUFFIX) + case $ac_sys_system in +- Linux*|GNU*) ++ Linux*|GNU*|CYGWIN*) + EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};; + *) + EXT_SUFFIX=${SHLIB_SUFFIX};; +--- Python-3.3.2-orig/Python/dynload_shlib.c 2013-05-15 20:33:00.000000000 +0400 ++++ Python-3.3.2/Python/dynload_shlib.c 2013-08-02 00:38:38.291015600 +0400 +@@ -38,6 +38,7 @@ + + const char *_PyImport_DynLoadFiletab[] = { + #ifdef __CYGWIN__ ++ "." SOABI ".dll", + ".dll", + #else /* !__CYGWIN__ */ + #if defined(PYOS_OS2) && defined(PYCC_GCC) diff --git a/python3/3.3-ssl-threads.patch b/python3/3.3-ssl-threads.patch new file mode 100644 index 00000000..210db82a --- /dev/null +++ b/python3/3.3-ssl-threads.patch @@ -0,0 +1,13 @@ +--- Python-3.3.2-orig/Modules/_ssl.c 2013-05-15 20:32:58.000000000 +0400 ++++ Python-3.3.2/Modules/_ssl.c 2013-08-02 00:03:01.190429600 +0400 +@@ -16,6 +16,10 @@ + + #include "Python.h" + ++#ifdef __CYGWIN__ ++#undef WITH_THREAD ++#endif ++ + #ifdef WITH_THREAD + #include "pythread.h" + #define PySSL_BEGIN_ALLOW_THREADS_S(save) \ diff --git a/python3/3.3-thread-cygwin64.patch b/python3/3.3-thread-cygwin64.patch new file mode 100644 index 00000000..5cb433ab --- /dev/null +++ b/python3/3.3-thread-cygwin64.patch @@ -0,0 +1,73 @@ +--- Python-3.3.2-orig/Include/pythread.h 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Include/pythread.h 2013-08-02 00:44:41.784179600 +0400 +@@ -77,11 +77,11 @@ + PyAPI_FUNC(PyObject*) PyThread_GetInfo(void); + + /* Thread Local Storage (TLS) API */ +-PyAPI_FUNC(int) PyThread_create_key(void); +-PyAPI_FUNC(void) PyThread_delete_key(int); +-PyAPI_FUNC(int) PyThread_set_key_value(int, void *); +-PyAPI_FUNC(void *) PyThread_get_key_value(int); +-PyAPI_FUNC(void) PyThread_delete_key_value(int key); ++PyAPI_FUNC(long) PyThread_create_key(void); ++PyAPI_FUNC(void) PyThread_delete_key(long); ++PyAPI_FUNC(int) PyThread_set_key_value(long, void *); ++PyAPI_FUNC(void *) PyThread_get_key_value(long); ++PyAPI_FUNC(void) PyThread_delete_key_value(long key); + + /* Cleanup after a fork */ + PyAPI_FUNC(void) PyThread_ReInitTLS(void); +--- Python-3.3.2-orig/Python/pystate.c 2013-05-15 20:33:00.000000000 +0400 ++++ Python-3.3.2/Python/pystate.c 2013-08-02 00:46:14.940429600 +0400 +@@ -37,7 +37,7 @@ + GILState implementation + */ + static PyInterpreterState *autoInterpreterState = NULL; +-static int autoTLSkey = 0; ++static long autoTLSkey = 0; + #else + #define HEAD_INIT() /* Nothing */ + #define HEAD_LOCK() /* Nothing */ +--- Python-3.3.2-orig/Python/thread_pthread.h 2013-05-15 20:33:00.000000000 +0400 ++++ Python-3.3.2/Python/thread_pthread.h 2013-08-02 00:47:54.674804600 +0400 +@@ -600,7 +600,7 @@ + + #define Py_HAVE_NATIVE_TLS + +-int ++long + PyThread_create_key(void) + { + pthread_key_t key; +@@ -609,19 +609,19 @@ + } + + void +-PyThread_delete_key(int key) ++PyThread_delete_key(long key) + { + pthread_key_delete(key); + } + + void +-PyThread_delete_key_value(int key) ++PyThread_delete_key_value(long key) + { + pthread_setspecific(key, NULL); + } + + int +-PyThread_set_key_value(int key, void *value) ++PyThread_set_key_value(long key, void *value) + { + int fail; + void *oldValue = pthread_getspecific(key); +@@ -632,7 +632,7 @@ + } + + void * +-PyThread_get_key_value(int key) ++PyThread_get_key_value(long key) + { + return pthread_getspecific(key); + } diff --git a/python3/3.3-tkinter.patch b/python3/3.3-tkinter.patch new file mode 100644 index 00000000..7f9edd70 --- /dev/null +++ b/python3/3.3-tkinter.patch @@ -0,0 +1,27 @@ +--- Python-3.3.2-orig/setup.py 2013-08-01 23:45:32.806640600 +0400 ++++ Python-3.3.2/setup.py 2013-08-01 23:54:03.430664000 +0400 +@@ -1696,12 +1696,6 @@ + include_dirs.append('/usr/X11/include') + added_lib_dirs.append('/usr/X11/lib') + +- # If Cygwin, then verify that X is installed before proceeding +- if host_platform == 'cygwin': +- x11_inc = find_file('X11/Xlib.h', [], include_dirs) +- if x11_inc is None: +- return +- + # Check for BLT extension + if self.compiler.find_library_file(lib_dirs + added_lib_dirs, + 'BLT8.0'): +@@ -1719,9 +1713,8 @@ + if host_platform in ['aix3', 'aix4']: + libs.append('ld') + +- # Finally, link with the X11 libraries (not appropriate on cygwin) +- if host_platform != "cygwin": +- libs.append('X11') ++ # Finally, link with the X11 libraries ++ libs.append('X11') + + ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], + define_macros=[('WITH_APPINIT', 1)] + defs, diff --git a/python3/3.3.2-allow-windows-paths-for-executable.patch b/python3/3.3.2-allow-windows-paths-for-executable.patch new file mode 100644 index 00000000..d8baafb8 --- /dev/null +++ b/python3/3.3.2-allow-windows-paths-for-executable.patch @@ -0,0 +1,129 @@ +--- Python-3.3.2/Modules/getpath.c.orig 2013-05-15 20:32:59.000000000 +0400 ++++ Python-3.3.2/Modules/getpath.c 2013-10-21 20:41:43.579800000 +0400 +@@ -10,6 +10,10 @@ + #include + #endif + ++#if defined(MS_WINDOWS) || defined(__CYGWIN__) ++#include ++#endif ++ + /* Search in some common locations for the associated Python libraries. + * + * Two directories must be found, the platform independent directory +@@ -132,7 +136,11 @@ + + static wchar_t prefix[MAXPATHLEN+1]; + static wchar_t exec_prefix[MAXPATHLEN+1]; +-static wchar_t progpath[MAXPATHLEN+1]; ++static wchar_t progpath[MAXPATHLEN+1] = {'\0'}; ++#if defined(MS_WINDOWS) || defined(__CYGWIN__) ++static wchar_t dllpath[MAXPATHLEN+1] = {'\0'}; ++extern HANDLE PyWin_DLLhModule; ++#endif + static wchar_t *module_search_path = NULL; + static int module_search_path_malloced = 0; + static wchar_t *lib_python = L"lib/python" VERSION; +@@ -213,7 +221,11 @@ + joinpath(wchar_t *buffer, wchar_t *stuff) + { + size_t n, k; ++#if defined(MS_WINDOWS) || defined(__CYGWIN__) ++ if (stuff[0] == SEP || (wcslen(stuff)>=2 && stuff[0] != 0 && stuff[1] == ':')) ++#else + if (stuff[0] == SEP) ++#endif + n = 0; + else { + n = wcslen(buffer); +@@ -227,6 +239,13 @@ + k = MAXPATHLEN - n; + wcsncpy(buffer+n, stuff, k); + buffer[n+k] = '\0'; ++#if defined(__CYGWIN__) ++ /* MSYS specific: Turn C:* into /c* */ ++ if (wcslen(buffer)>2 && buffer[0] != 0 && buffer[1] == ':') { ++ buffer[1]=buffer[0]|32; ++ buffer[0]='/'; ++ } ++#endif + } + + /* copy_absolute requires that path be allocated at least +@@ -234,8 +253,21 @@ + static void + copy_absolute(wchar_t *path, wchar_t *p, size_t pathlen) + { +- if (p[0] == SEP) ++#if defined(MS_WINDOWS) || defined(__CYGWIN__) ++ if (p[0] == SEP || (wcslen(p)>=2 && p[0] != 0 && p[1] == ':')) ++#else ++ if (p[0] == SEP) ++#endif ++ { + wcscpy(path, p); ++#if defined(__CYGWIN__) ++ /* MSYS specific: Turn C:* into /c* */ ++ if (wcslen(path)>2 && path[0] != 0 && path[1] == ':') { ++ path[1]=path[0]|32; ++ path[0]='/'; ++ } ++#endif ++ } + else { + if (!_Py_wgetcwd(path, pathlen)) { + /* unable to get the current directory */ +@@ -451,6 +483,42 @@ + return 0; + } + ++#if defined(MS_WINDOWS) || defined(__CYGWIN__) ++/* Calculates dllpath and progpath, replacing \\ with / */ ++int GetWindowsModulePaths() ++{ ++ int result = 0; ++ wchar_t* seps; ++ result = GetModuleFileNameW(NULL, progpath, MAXPATHLEN); ++ seps = wcschr(progpath, '\\'); ++ while(seps) { ++ *seps = '/'; ++ seps = wcschr(seps, '\\'); ++ } ++ dllpath[0] = '\0'; ++#if defined(Py_ENABLE_SHARED) && !defined(__CYGWIN__) ++ // Hmm, cygwin/MSYS2 replacement for PyWin_DLLhModule is needed. ++ if (PyWin_DLLhModule) { ++ if((GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN) > 0)) { ++ result = 1; ++ seps = wcschr(dllpath, '\\'); ++ while(seps) { ++ *seps = '/'; ++ seps = wcschr(seps, '\\'); ++ } ++ } ++ } ++#endif ++ ++ /* Just so that 'MSYS specific: Turn C:* into /c*' ++ is done. */ ++ absolutize(progpath); ++ absolutize(dllpath); ++ ++ return result; ++} ++#endif /* MS_WINDOWS */ ++ + static void + calculate_path(void) + { +@@ -527,6 +595,10 @@ + } + } + #endif /* __APPLE__ */ ++#if defined(MS_WINDOWS) || defined(__CYGWIN__) ++ else if(GetWindowsModulePaths()) { ++ } ++#endif /* MS_WINDOWS */ + else if (path) { + while (1) { + wchar_t *delim = wcschr(path, DELIM); diff --git a/python3/3.3.2-cygwin-siginfo.patch b/python3/3.3.2-cygwin-siginfo.patch new file mode 100644 index 00000000..25ce0848 --- /dev/null +++ b/python3/3.3.2-cygwin-siginfo.patch @@ -0,0 +1,22 @@ +--- Python-3.3.2-orig/Modules/signalmodule.c 2013-05-15 20:32:59.000000000 +0400 ++++ python-3.3.2/Modules/signalmodule.c 2013-10-21 13:17:31.434200000 +0400 +@@ -8,8 +8,18 @@ + #include "posixmodule.h" + #endif + ++#if defined(__CYGWIN__) ++/* Type siginfo_t is different on cygwin. For instance si_band is not ++ * a member of structure, so until fill_siginfo(siginfo_t *si) is ++ * ported properly lets "undef" sigwaitinfo and sigtimedwait to ++ * avoid build failure in fill_siginfo(..). ++ */ ++# undef HAVE_SIGWAITINFO ++# undef HAVE_SIGTIMEDWAIT ++#endif ++ + #ifdef MS_WINDOWS +-#include ++#include + #ifdef HAVE_PROCESS_H + #include + #endif diff --git a/python3/PKGBUILD b/python3/PKGBUILD new file mode 100644 index 00000000..0c5a638f --- /dev/null +++ b/python3/PKGBUILD @@ -0,0 +1,149 @@ +# Maintainer: Alexey Pavlov + +pkgname=python +pkgver=3.3.2 +pkgrel=1 +_pybasever=3.3 +pkgdesc="Next generation of the python high-level scripting language" +arch=('i686' 'x86_64') +license=('custom') +url="http://www.python.org/" +depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib') +makedepends=('tk>=8.6.0' 'sqlite' 'valgrind' 'bluez-libs') +optdepends=('tk: for tkinter' 'sqlite') +provides=('python3') +replaces=('python3') +options=('!makeflags') +source=(http://www.python.org/ftp/python/${pkgver%rc*}/Python-${pkgver}.tar.xz + python-3.3.2-CVE-2013-2099.patch + python-3.3.2-CVE-2013-4238.patch + 3.3-ctypes-libpython.patch + 3.3-ctypes-util-find_library.patch + 3.3-cygwin-soname.patch + 3.3-dbm.patch + 3.3-distutils-shlibext.patch + 3.3-enable-new-dtags.patch + 3.3-export-PyNode_SizeOf.patch + 3.3-export-PySignal_SetWakeupFd.patch + 3.3-fix-PyAPI-declaration.patch + 3.3-fix-sqlite-module.patch + 3.3-ncurses-abi6.patch + 3.3-PATH_MAX.patch + 3.3-pep3149.patch + 3.3-ssl-threads.patch + 3.3-thread-cygwin64.patch + 3.3-tkinter.patch + 3.3.2-allow-windows-paths-for-executable.patch + 3.3.2-cygwin-siginfo.patch + python-3.3.2-msys2.patch + uuid.patch) +sha1sums=('87009d0c156c6e1354dfec5c98c328cae93950ad' + 'bfe07759daacd4ffa0e682e65f0c9fb84f715c73' + 'c30297201ef5cd803b685085ca6defb7ca66d2cd' + 'd1bef43a80fbc99524fe599dabb84977fc4f458d' + '92109d70e398605c075cd969a89a7f16abd1ce59' + 'a815d4c8b1ec8246be47b7eeeabe84cf47c11af8' + 'df5a984858073d75a11500bad9178f842c6a1846' + 'a12a1ed5ea15a34b650d407a7f7c4e8718de670f' + 'a0b1a90f271f28322b0921820ce3cdf0c108e2ea' + 'f505b46785e78c5f23a4228e756795e0e66dd1f3' + '09392741ab3d05d99c977a468ec38c7f94f49429' + 'acf8a9ba965764941809404f2cfc5091af63bf8f' + 'ec8b6015a8c56bd3cc873bc1da300a0517e9a549' + '86a4addb11ef38695b90cc91584b55e1878d21e6' + 'e421f2770a7f7bbb85003b83945c8f5b3c0050d4' + '8295e7731fe1b6623365b4c5a789dec588db5769' + 'bfe2e722693a7314243b494db5170e68fc36c3d5' + '1fb100b187ae64faa1ab15300a84d6e0e75e55c6' + 'b303a2da60abded2ca020dfb63da5d5184c1d92f' + 'd3cbd7286fab191a5a9086cea1a9a3dc386e17da' + '1ec44391e21ad83cd149e83e65b2e77af13b9fbd' + '4f5ef705c8806900313480e13fb8d34c49aeb77a' + '8b2f1bed347e764c2505ed2e9e5bccb790354d76') + +prepare() { + cd "${srcdir}/Python-${pkgver}" + + # FS#23997 + sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python|" Lib/cgi.py + + patch -Np1 -i ${srcdir}/python-3.3.2-CVE-2013-2099.patch + patch -Np1 -i ${srcdir}/python-3.3.2-CVE-2013-4238.patch + + patch -p1 -i ${srcdir}/3.3-dbm.patch + patch -p1 -i ${srcdir}/3.3-enable-new-dtags.patch + patch -p1 -i ${srcdir}/3.3-tkinter.patch + patch -p1 -i ${srcdir}/3.3-ctypes-util-find_library.patch + patch -p1 -i ${srcdir}/3.3-PATH_MAX.patch + patch -p1 -i ${srcdir}/3.3-ssl-threads.patch + patch -p1 -i ${srcdir}/3.3-ncurses-abi6.patch + patch -p1 -i ${srcdir}/3.3-export-PySignal_SetWakeupFd.patch + patch -p1 -i ${srcdir}/3.3-export-PyNode_SizeOf.patch + patch -p1 -i ${srcdir}/3.3-cygwin-soname.patch + patch -p1 -i ${srcdir}/3.3-distutils-shlibext.patch + patch -p1 -i ${srcdir}/3.3-ctypes-libpython.patch + patch -p1 -i ${srcdir}/3.3-pep3149.patch + patch -p1 -i ${srcdir}/3.3-thread-cygwin64.patch + patch -p1 -i ${srcdir}/3.3-fix-sqlite-module.patch + patch -p1 -i ${srcdir}/python-3.3.2-msys2.patch + patch -p1 -i ${srcdir}/uuid.patch + patch -p1 -i ${srcdir}/3.3.2-cygwin-siginfo.patch + # Incomplete patch from Ray Donnelly + # patch -p1 -i ${srcdir}/3.3.2-allow-windows-paths-for-executable.patch + + # Ensure that we are using the system copy of various libraries (expat, zlib and libffi), + # rather than copies shipped in the tarball + rm -r Modules/expat + rm -r Modules/zlib + rm -r Modules/_ctypes/{darwin,libffi}* +} + +build() { + cd "${srcdir}/Python-${pkgver}" + + ./configure --build=${CHOST} \ + --prefix=/usr \ + --build=$MY_TARGET \ + --enable-shared \ + --enable-ipv6 \ + --with-libc= \ + --with-libm= \ + --with-system-expat \ + --with-system-ffi \ + ac_cv_func_bind_textdomain_codeset=yes \ + --with-threads \ + CPPFLAGS="${CPPFLAGS} -I/usr/include/ncursesw" \ + LDFLAGS="${LDFLAGS} -L." + + make +} + +check() { + cd "${srcdir}/Python-${pkgver}" + "${srcdir}/Python-${pkgver}/python" -m test.regrtest -x test_posixpath test_logging +} + +package() { + cd "${srcdir}/Python-${pkgver}" + make DESTDIR="${pkgdir}" install maninstall + + # Why are these not done by default... + ln -sf python3 "${pkgdir}"/usr/bin/python.exe + ln -sf python3-config "${pkgdir}"/usr/bin/python-config + ln -sf idle3 "${pkgdir}"/usr/bin/idle + ln -sf pydoc3 "${pkgdir}"/usr/bin/pydoc + ln -sf python${_pybasever}.1 "${pkgdir}"/usr/share/man/man1/python3.1 + ln -sf python${_pybasever}.1 "${pkgdir}"/usr/share/man/man1/python.1 + + # Fix FS#22552 + cp -f "${pkgdir}"/usr/lib/python${_pybasever}/config-${_pybasever}m/libpython${_pybasever}m.dll.a "${pkgdir}"/usr/lib/libpython${_pybasever}m.dll.a + + # Clean-up reference to build directory + sed -i "s|$srcdir/Python-${pkgver}:||" "$pkgdir/usr/lib/python${_pybasever}/config-${_pybasever}m/Makefile" + + # License + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + + # fix permissons + find ${pkgdir}/usr -type f \( -name *.dll -o -name *.exe \) | xargs chmod 0755 +} diff --git a/python3/python-3.3.2-CVE-2013-2099.patch b/python3/python-3.3.2-CVE-2013-2099.patch new file mode 100644 index 00000000..888b43b0 --- /dev/null +++ b/python3/python-3.3.2-CVE-2013-2099.patch @@ -0,0 +1,49 @@ +# HG changeset patch +# User Antoine Pitrou +# Date 1368892602 -7200 +# Node ID c627638753e2d25a98950585b259104a025937a9 +# Parent 9682241dc8fcb4b1aef083bd30860efa070c3d6d +Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of service using certificates with many wildcards (CVE-2013-2099). + +diff --git a/Lib/ssl.py b/Lib/ssl.py +--- a/Lib/ssl.py ++++ b/Lib/ssl.py +@@ -129,9 +129,16 @@ class CertificateError(ValueError): + pass + + +-def _dnsname_to_pat(dn): ++def _dnsname_to_pat(dn, max_wildcards=1): + pats = [] + for frag in dn.split(r'.'): ++ if frag.count('*') > max_wildcards: ++ # Issue #17980: avoid denials of service by refusing more ++ # than one wildcard per fragment. A survery of established ++ # policy among SSL implementations showed it to be a ++ # reasonable choice. ++ raise CertificateError( ++ "too many wildcards in certificate DNS name: " + repr(dn)) + if frag == '*': + # When '*' is a fragment by itself, it matches a non-empty dotless + # fragment. +diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py +--- a/Lib/test/test_ssl.py ++++ b/Lib/test/test_ssl.py +@@ -349,6 +349,17 @@ class BasicSocketTests(unittest.TestCase + self.assertRaises(ValueError, ssl.match_hostname, None, 'example.com') + self.assertRaises(ValueError, ssl.match_hostname, {}, 'example.com') + ++ # Issue #17980: avoid denials of service by refusing more than one ++ # wildcard per fragment. ++ cert = {'subject': ((('commonName', 'a*b.com'),),)} ++ ok(cert, 'axxb.com') ++ cert = {'subject': ((('commonName', 'a*b.co*'),),)} ++ ok(cert, 'axxb.com') ++ cert = {'subject': ((('commonName', 'a*b*.com'),),)} ++ with self.assertRaises(ssl.CertificateError) as cm: ++ ssl.match_hostname(cert, 'axxbxxc.com') ++ self.assertIn("too many wildcards", str(cm.exception)) ++ + def test_server_side(self): + # server_hostname doesn't work for server sockets + ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) diff --git a/python3/python-3.3.2-CVE-2013-4238.patch b/python3/python-3.3.2-CVE-2013-4238.patch new file mode 100644 index 00000000..2de2ed47 --- /dev/null +++ b/python3/python-3.3.2-CVE-2013-4238.patch @@ -0,0 +1,255 @@ + +# HG changeset patch +# User Christian Heimes +# Date 1376693687 -7200 +# Node ID c9f073e593b037e8a29e386326859537691bcf62 +# Parent 3105b78d34346ea36c52a3b7e635954f4b444120 +Issue #18709: Fix CVE-2013-4238. The SSL module now handles NULL bytes +inside subjectAltName correctly. Formerly the module has used OpenSSL's +GENERAL_NAME_print() function to get the string represention of ASN.1 +strings for rfc822Name (email), dNSName (DNS) and +uniformResourceIdentifier (URI). + +diff --git a/Lib/test/nullbytecert.pem b/Lib/test/nullbytecert.pem +new file mode 100644 +--- /dev/null ++++ b/Lib/test/nullbytecert.pem +@@ -0,0 +1,90 @@ ++Certificate: ++ Data: ++ Version: 3 (0x2) ++ Serial Number: 0 (0x0) ++ Signature Algorithm: sha1WithRSAEncryption ++ Issuer: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev@python.org ++ Validity ++ Not Before: Aug 7 13:11:52 2013 GMT ++ Not After : Aug 7 13:12:52 2013 GMT ++ Subject: C=US, ST=Oregon, L=Beaverton, O=Python Software Foundation, OU=Python Core Development, CN=null.python.org\x00example.org/emailAddress=python-dev@python.org ++ Subject Public Key Info: ++ Public Key Algorithm: rsaEncryption ++ Public-Key: (2048 bit) ++ Modulus: ++ 00:b5:ea:ed:c9:fb:46:7d:6f:3b:76:80:dd:3a:f3: ++ 03:94:0b:a7:a6:db:ec:1d:df:ff:23:74:08:9d:97: ++ 16:3f:a3:a4:7b:3e:1b:0e:96:59:25:03:a7:26:e2: ++ 88:a9:cf:79:cd:f7:04:56:b0:ab:79:32:6e:59:c1: ++ 32:30:54:eb:58:a8:cb:91:f0:42:a5:64:27:cb:d4: ++ 56:31:88:52:ad:cf:bd:7f:f0:06:64:1f:cc:27:b8: ++ a3:8b:8c:f3:d8:29:1f:25:0b:f5:46:06:1b:ca:02: ++ 45:ad:7b:76:0a:9c:bf:bb:b9:ae:0d:16:ab:60:75: ++ ae:06:3e:9c:7c:31:dc:92:2f:29:1a:e0:4b:0c:91: ++ 90:6c:e9:37:c5:90:d7:2a:d7:97:15:a3:80:8f:5d: ++ 7b:49:8f:54:30:d4:97:2c:1c:5b:37:b5:ab:69:30: ++ 68:43:d3:33:78:4b:02:60:f5:3c:44:80:a1:8f:e7: ++ f0:0f:d1:5e:87:9e:46:cf:62:fc:f9:bf:0c:65:12: ++ f1:93:c8:35:79:3f:c8:ec:ec:47:f5:ef:be:44:d5: ++ ae:82:1e:2d:9a:9f:98:5a:67:65:e1:74:70:7c:cb: ++ d3:c2:ce:0e:45:49:27:dc:e3:2d:d4:fb:48:0e:2f: ++ 9e:77:b8:14:46:c0:c4:36:ca:02:ae:6a:91:8c:da: ++ 2f:85 ++ Exponent: 65537 (0x10001) ++ X509v3 extensions: ++ X509v3 Basic Constraints: critical ++ CA:FALSE ++ X509v3 Subject Key Identifier: ++ 88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C ++ X509v3 Key Usage: ++ Digital Signature, Non Repudiation, Key Encipherment ++ X509v3 Subject Alternative Name: ++ ************************************************************* ++ WARNING: The values for DNS, email and URI are WRONG. OpenSSL ++ doesn't print the text after a NULL byte. ++ ************************************************************* ++ DNS:altnull.python.org, email:null@python.org, URI:http://null.python.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1 ++ Signature Algorithm: sha1WithRSAEncryption ++ ac:4f:45:ef:7d:49:a8:21:70:8e:88:59:3e:d4:36:42:70:f5: ++ a3:bd:8b:d7:a8:d0:58:f6:31:4a:b1:a4:a6:dd:6f:d9:e8:44: ++ 3c:b6:0a:71:d6:7f:b1:08:61:9d:60:ce:75:cf:77:0c:d2:37: ++ 86:02:8d:5e:5d:f9:0f:71:b4:16:a8:c1:3d:23:1c:f1:11:b3: ++ 56:6e:ca:d0:8d:34:94:e6:87:2a:99:f2:ae:ae:cc:c2:e8:86: ++ de:08:a8:7f:c5:05:fa:6f:81:a7:82:e6:d0:53:9d:34:f4:ac: ++ 3e:40:fe:89:57:7a:29:a4:91:7e:0b:c6:51:31:e5:10:2f:a4: ++ 60:76:cd:95:51:1a:be:8b:a1:b0:fd:ad:52:bd:d7:1b:87:60: ++ d2:31:c7:17:c4:18:4f:2d:08:25:a3:a7:4f:b7:92:ca:e2:f5: ++ 25:f1:54:75:81:9d:b3:3d:61:a2:f7:da:ed:e1:c6:6f:2c:60: ++ 1f:d8:6f:c5:92:05:ab:c9:09:62:49:a9:14:ad:55:11:cc:d6: ++ 4a:19:94:99:97:37:1d:81:5f:8b:cf:a3:a8:96:44:51:08:3d: ++ 0b:05:65:12:eb:b6:70:80:88:48:72:4f:c6:c2:da:cf:cd:8e: ++ 5b:ba:97:2f:60:b4:96:56:49:5e:3a:43:76:63:04:be:2a:f6: ++ c1:ca:a9:94 ++-----BEGIN CERTIFICATE----- ++MIIE2DCCA8CgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBxTELMAkGA1UEBhMCVVMx ++DzANBgNVBAgMBk9yZWdvbjESMBAGA1UEBwwJQmVhdmVydG9uMSMwIQYDVQQKDBpQ ++eXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEgMB4GA1UECwwXUHl0aG9uIENvcmUg ++RGV2ZWxvcG1lbnQxJDAiBgNVBAMMG251bGwucHl0aG9uLm9yZwBleGFtcGxlLm9y ++ZzEkMCIGCSqGSIb3DQEJARYVcHl0aG9uLWRldkBweXRob24ub3JnMB4XDTEzMDgw ++NzEzMTE1MloXDTEzMDgwNzEzMTI1MlowgcUxCzAJBgNVBAYTAlVTMQ8wDQYDVQQI ++DAZPcmVnb24xEjAQBgNVBAcMCUJlYXZlcnRvbjEjMCEGA1UECgwaUHl0aG9uIFNv ++ZnR3YXJlIEZvdW5kYXRpb24xIDAeBgNVBAsMF1B5dGhvbiBDb3JlIERldmVsb3Bt ++ZW50MSQwIgYDVQQDDBtudWxsLnB5dGhvbi5vcmcAZXhhbXBsZS5vcmcxJDAiBgkq ++hkiG9w0BCQEWFXB5dGhvbi1kZXZAcHl0aG9uLm9yZzCCASIwDQYJKoZIhvcNAQEB ++BQADggEPADCCAQoCggEBALXq7cn7Rn1vO3aA3TrzA5QLp6bb7B3f/yN0CJ2XFj+j ++pHs+Gw6WWSUDpybiiKnPec33BFawq3kyblnBMjBU61ioy5HwQqVkJ8vUVjGIUq3P ++vX/wBmQfzCe4o4uM89gpHyUL9UYGG8oCRa17dgqcv7u5rg0Wq2B1rgY+nHwx3JIv ++KRrgSwyRkGzpN8WQ1yrXlxWjgI9de0mPVDDUlywcWze1q2kwaEPTM3hLAmD1PESA ++oY/n8A/RXoeeRs9i/Pm/DGUS8ZPINXk/yOzsR/XvvkTVroIeLZqfmFpnZeF0cHzL ++08LODkVJJ9zjLdT7SA4vnne4FEbAxDbKAq5qkYzaL4UCAwEAAaOB0DCBzTAMBgNV ++HRMBAf8EAjAAMB0GA1UdDgQWBBSIWlXAUv9hzVKjNQ/qWpwkOCL3XDALBgNVHQ8E ++BAMCBeAwgZAGA1UdEQSBiDCBhYIeYWx0bnVsbC5weXRob24ub3JnAGV4YW1wbGUu ++Y29tgSBudWxsQHB5dGhvbi5vcmcAdXNlckBleGFtcGxlLm9yZ4YpaHR0cDovL251 ++bGwucHl0aG9uLm9yZwBodHRwOi8vZXhhbXBsZS5vcmeHBMAAAgGHECABDbgAAAAA ++AAAAAAAAAAEwDQYJKoZIhvcNAQEFBQADggEBAKxPRe99SaghcI6IWT7UNkJw9aO9 ++i9eo0Fj2MUqxpKbdb9noRDy2CnHWf7EIYZ1gznXPdwzSN4YCjV5d+Q9xtBaowT0j ++HPERs1ZuytCNNJTmhyqZ8q6uzMLoht4IqH/FBfpvgaeC5tBTnTT0rD5A/olXeimk ++kX4LxlEx5RAvpGB2zZVRGr6LobD9rVK91xuHYNIxxxfEGE8tCCWjp0+3ksri9SXx ++VHWBnbM9YaL32u3hxm8sYB/Yb8WSBavJCWJJqRStVRHM1koZlJmXNx2BX4vPo6iW ++RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ= ++-----END CERTIFICATE----- +diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py +--- a/Lib/test/test_ssl.py ++++ b/Lib/test/test_ssl.py +@@ -55,6 +55,7 @@ BADCERT = data_file("badcert.pem") + WRONGCERT = data_file("XXXnonexisting.pem") + BADKEY = data_file("badkey.pem") + NOKIACERT = data_file("nokia.pem") ++NULLBYTECERT = data_file("nullbytecert.pem") + + DHFILE = data_file("dh512.pem") + BYTES_DHFILE = os.fsencode(DHFILE) +@@ -162,6 +163,27 @@ class BasicSocketTests(unittest.TestCase + ('DNS', 'projects.forum.nokia.com')) + ) + ++ def test_parse_cert_CVE_2013_4238(self): ++ p = ssl._ssl._test_decode_cert(NULLBYTECERT) ++ if support.verbose: ++ sys.stdout.write("\n" + pprint.pformat(p) + "\n") ++ subject = ((('countryName', 'US'),), ++ (('stateOrProvinceName', 'Oregon'),), ++ (('localityName', 'Beaverton'),), ++ (('organizationName', 'Python Software Foundation'),), ++ (('organizationalUnitName', 'Python Core Development'),), ++ (('commonName', 'null.python.org\x00example.org'),), ++ (('emailAddress', 'python-dev@python.org'),)) ++ self.assertEqual(p['subject'], subject) ++ self.assertEqual(p['issuer'], subject) ++ self.assertEqual(p['subjectAltName'], ++ (('DNS', 'altnull.python.org\x00example.com'), ++ ('email', 'null@python.org\x00user@example.org'), ++ ('URI', 'http://null.python.org\x00http://example.org'), ++ ('IP Address', '192.0.2.1'), ++ ('IP Address', '2001:DB8:0:0:0:0:0:1\n')) ++ ) ++ + def test_DER_to_PEM(self): + with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f: + pem = f.read() +@@ -294,6 +316,13 @@ class BasicSocketTests(unittest.TestCase + fail(cert, 'foo.a.com') + fail(cert, 'bar.foo.com') + ++ # NULL bytes are bad, CVE-2013-4073 ++ cert = {'subject': ((('commonName', ++ 'null.python.org\x00example.org'),),)} ++ ok(cert, 'null.python.org\x00example.org') # or raise an error? ++ fail(cert, 'example.org') ++ fail(cert, 'null.python.org') ++ + # Slightly fake real-world example + cert = {'notAfter': 'Jun 26 21:41:46 2011 GMT', + 'subject': ((('commonName', 'linuxfrz.org'),),), +diff --git a/Modules/_ssl.c b/Modules/_ssl.c +--- a/Modules/_ssl.c ++++ b/Modules/_ssl.c +@@ -771,12 +771,14 @@ static PyObject * + ext->value->length)); + + for(j = 0; j < sk_GENERAL_NAME_num(names); j++) { +- + /* get a rendering of each name in the set of names */ ++ int gntype; ++ ASN1_STRING *as = NULL; + + name = sk_GENERAL_NAME_value(names, j); +- if (name->type == GEN_DIRNAME) { +- ++ gntype = name-> type; ++ switch (gntype) { ++ case GEN_DIRNAME: + /* we special-case DirName as a tuple of + tuples of attributes */ + +@@ -798,11 +800,62 @@ static PyObject * + goto fail; + } + PyTuple_SET_ITEM(t, 1, v); ++ break; + +- } else { ++ case GEN_EMAIL: ++ case GEN_DNS: ++ case GEN_URI: ++ /* GENERAL_NAME_print() doesn't handle NULL bytes in ASN1_string ++ correctly, CVE-2013-4238 */ ++ t = PyTuple_New(2); ++ if (t == NULL) ++ goto fail; ++ switch (gntype) { ++ case GEN_EMAIL: ++ v = PyUnicode_FromString("email"); ++ as = name->d.rfc822Name; ++ break; ++ case GEN_DNS: ++ v = PyUnicode_FromString("DNS"); ++ as = name->d.dNSName; ++ break; ++ case GEN_URI: ++ v = PyUnicode_FromString("URI"); ++ as = name->d.uniformResourceIdentifier; ++ break; ++ } ++ if (v == NULL) { ++ Py_DECREF(t); ++ goto fail; ++ } ++ PyTuple_SET_ITEM(t, 0, v); ++ v = PyUnicode_FromStringAndSize((char *)ASN1_STRING_data(as), ++ ASN1_STRING_length(as)); ++ if (v == NULL) { ++ Py_DECREF(t); ++ goto fail; ++ } ++ PyTuple_SET_ITEM(t, 1, v); ++ break; + ++ default: + /* for everything else, we use the OpenSSL print form */ +- ++ switch (gntype) { ++ /* check for new general name type */ ++ case GEN_OTHERNAME: ++ case GEN_X400: ++ case GEN_EDIPARTY: ++ case GEN_IPADD: ++ case GEN_RID: ++ break; ++ default: ++ if (PyErr_WarnFormat(PyExc_RuntimeWarning, 1, ++ "Unknown general name type %d", ++ gntype) == -1) { ++ goto fail; ++ } ++ break; ++ } + (void) BIO_reset(biobuf); + GENERAL_NAME_print(biobuf, name); + len = BIO_gets(biobuf, buf, sizeof(buf)-1); +@@ -829,6 +882,7 @@ static PyObject * + goto fail; + } + PyTuple_SET_ITEM(t, 1, v); ++ break; + } + + /* and add that rendering to the list */ + diff --git a/python3/python-3.3.2-msys2.patch b/python3/python-3.3.2-msys2.patch new file mode 100644 index 00000000..b5be90de --- /dev/null +++ b/python3/python-3.3.2-msys2.patch @@ -0,0 +1,1546 @@ +diff -Naur Python-3.3.2-cygwin/config.guess Python-3.3.2/config.guess +--- Python-3.3.2-cygwin/config.guess 2013-05-15 20:33:00.000000000 +0400 ++++ Python-3.3.2/config.guess 2013-08-02 01:07:06.233398400 +0400 +@@ -849,6 +849,9 @@ + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; ++ amd64:MSYS*:*:* | x86_64:MSYS*:*:*) ++ echo x86_64-unknown-msys ++ exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; +diff -Naur Python-3.3.2-cygwin/configure Python-3.3.2/configure +--- Python-3.3.2-cygwin/configure 2013-05-15 20:33:00.000000000 +0400 ++++ Python-3.3.2/configure 2013-08-02 00:57:16.847656200 +0400 +@@ -3264,6 +3264,9 @@ + *-*-cygwin*) + ac_sys_system=Cygwin + ;; ++ *-*-msys*) ++ ac_sys_system=Msys ++ ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" +@@ -3288,6 +3291,7 @@ + case $MACHDEP in + linux*) MACHDEP="linux";; + cygwin*) MACHDEP="cygwin";; ++ msys*) MACHDEP="msys";; + darwin*) MACHDEP="darwin";; + irix646) MACHDEP="irix6";; + '') MACHDEP="unknown";; +@@ -3309,6 +3313,9 @@ + *-*-cygwin*) + _host_cpu= + ;; ++ *-*-msys*) ++ _host_cpu= ++ ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" +@@ -5514,7 +5521,7 @@ + if test -z "$enable_shared" + then + case $ac_sys_system in +- CYGWIN*) ++ CYGWIN*|MSYS*) + enable_shared="yes";; + *) + enable_shared="no";; +@@ -5584,6 +5591,10 @@ + LDLIBRARY='libpython$(LDVERSION).dll.a' + DLLLIBRARY='libpython$(LDVERSION).dll' + ;; ++ MSYS*) ++ LDLIBRARY='libpython$(LDVERSION).dll.a' ++ DLLLIBRARY='msys-python$(LDVERSION).dll' ++ ;; + SunOS*) + LDLIBRARY='libpython$(LDVERSION).so' + BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)' +@@ -5634,7 +5645,7 @@ + esac + else # shared is disabled + case $ac_sys_system in +- CYGWIN*) ++ CYGWIN*|MSYS*) + BLDLIBRARY='$(LIBRARY)' + LDLIBRARY='libpython$(LDVERSION).dll.a' + ;; +@@ -6157,7 +6168,7 @@ + + if test -z "$LN" ; then + case $ac_sys_system in +- CYGWIN*) LN="ln -s";; ++ CYGWIN*|MSYS*) LN="ln -s";; + *) LN=ln;; + esac + fi +@@ -8405,7 +8416,7 @@ + *) SHLIB_SUFFIX=.sl;; + esac + ;; +- CYGWIN*) SHLIB_SUFFIX=.dll;; ++ CYGWIN*|MSYS*) SHLIB_SUFFIX=.dll;; + *) SHLIB_SUFFIX=.so;; + esac + fi +@@ -8541,7 +8552,7 @@ + SCO_SV*) + LDSHARED='$(CC) -Wl,-G,-Bexport' + LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';; +- CYGWIN*) ++ CYGWIN*|MSYS*) + LDSHARED="gcc -shared -Wl,--enable-auto-image-base" + LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";; + *) LDSHARED="ld";; +@@ -8625,7 +8636,7 @@ + LINKFORSHARED="-Xlinker --export-dynamic" + fi;; + esac;; +- CYGWIN*) ++ CYGWIN*|MSYS*) + if test $enable_shared = "no" + then + LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)' +@@ -8649,7 +8660,7 @@ + if test ! "$LIBRARY" = "$LDLIBRARY" + then + case $ac_sys_system in +- CYGWIN*) ++ CYGWIN*|MSYS*) + # Cygwin needs CCSHARED when building extension DLLs + # but not when building the interpreter DLL. + CFLAGSFORSHARED='';; +@@ -9785,7 +9796,7 @@ + #define HAVE_PTHREAD_SIGMASK 1 + _ACEOF + case $ac_sys_system in +- CYGWIN*) ++ CYGWIN*|MSYS*) + + $as_echo "#define HAVE_BROKEN_PTHREAD_SIGMASK 1" >>confdefs.h + +diff -Naur Python-3.3.2-cygwin/configure.ac Python-3.3.2/configure.ac +--- Python-3.3.2-cygwin/configure.ac 2013-08-02 00:35:10.071289000 +0400 ++++ Python-3.3.2/configure.ac 2013-08-02 00:56:22.894531200 +0400 +@@ -364,6 +364,9 @@ + *-*-cygwin*) + ac_sys_system=Cygwin + ;; ++ *-*-msys*) ++ ac_sys_system=Msys ++ ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" +@@ -388,6 +391,7 @@ + case $MACHDEP in + linux*) MACHDEP="linux";; + cygwin*) MACHDEP="cygwin";; ++ msys*) MACHDEP="msys";; + darwin*) MACHDEP="darwin";; + irix646) MACHDEP="irix6";; + '') MACHDEP="unknown";; +@@ -409,6 +413,9 @@ + *-*-cygwin*) + _host_cpu= + ;; ++ *-*-msys*) ++ _host_cpu= ++ ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" +@@ -870,7 +877,7 @@ + if test -z "$enable_shared" + then + case $ac_sys_system in +- CYGWIN*) ++ CYGWIN*|MSYS*) + enable_shared="yes";; + *) + enable_shared="no";; +@@ -924,6 +931,11 @@ + BLDLIBRARY='-L. -lpython$(LDVERSION)' + DLLLIBRARY='libpython$(LDVERSION).dll' + ;; ++ MSYS*) ++ LDLIBRARY='libpython$(LDVERSION).dll.a' ++ BLDLIBRARY='-L. -lpython$(LDVERSION)' ++ DLLLIBRARY='msys-python$(LDVERSION).dll' ++ ;; + SunOS*) + LDLIBRARY='libpython$(LDVERSION).so' + BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(LDVERSION)' +@@ -974,7 +986,7 @@ + esac + else # shared is disabled + case $ac_sys_system in +- CYGWIN*) ++ CYGWIN*|MSYS*) + BLDLIBRARY='$(LIBRARY)' + LDLIBRARY='libpython$(LDVERSION).dll.a' + ;; +@@ -1032,7 +1044,7 @@ + AC_SUBST(LN) + if test -z "$LN" ; then + case $ac_sys_system in +- CYGWIN*) LN="ln -s";; ++ CYGWIN*|MSYS*) LN="ln -s";; + *) LN=ln;; + esac + fi +@@ -1915,7 +1927,7 @@ + *) SHLIB_SUFFIX=.sl;; + esac + ;; +- CYGWIN*) SHLIB_SUFFIX=.dll;; ++ CYGWIN*|MSYS*) SHLIB_SUFFIX=.dll;; + *) SHLIB_SUFFIX=.so;; + esac + fi +@@ -2049,7 +2061,7 @@ + SCO_SV*) + LDSHARED='$(CC) -Wl,-G,-Bexport' + LDCXXSHARED='$(CXX) -Wl,-G,-Bexport';; +- CYGWIN*) ++ CYGWIN*|MSYS*) + LDSHARED="gcc -shared -Wl,--enable-auto-image-base" + LDCXXSHARED="g++ -shared -Wl,--enable-auto-image-base";; + *) LDSHARED="ld";; +@@ -2129,7 +2141,7 @@ + LINKFORSHARED="-Xlinker --export-dynamic" + fi;; + esac;; +- CYGWIN*) ++ CYGWIN*|MSYS*) + if test $enable_shared = "no" + then + LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)' +@@ -2151,7 +2163,7 @@ + if test ! "$LIBRARY" = "$LDLIBRARY" + then + case $ac_sys_system in +- CYGWIN*) ++ CYGWIN*|MSYS*) + # Cygwin needs CCSHARED when building extension DLLs + # but not when building the interpreter DLL. + CFLAGSFORSHARED='';; +@@ -2496,7 +2508,7 @@ + fi + AC_CHECK_FUNCS(pthread_sigmask, + [case $ac_sys_system in +- CYGWIN*) ++ CYGWIN*|MSYS*) + AC_DEFINE(HAVE_BROKEN_PTHREAD_SIGMASK, 1, + [Define if pthread_sigmask() does not work on your system.]) + ;; +@@ -3945,7 +3957,7 @@ + + AC_SUBST(EXT_SUFFIX) + case $ac_sys_system in +- Linux*|GNU*|CYGWIN*) ++ Linux*|GNU*|CYGWIN*|MSYS*) + EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};; + *) + EXT_SUFFIX=${SHLIB_SUFFIX};; +diff -Naur Python-3.3.2-cygwin/Lib/ctypes/__init__.py Python-3.3.2/Lib/ctypes/__init__.py +--- Python-3.3.2-cygwin/Lib/ctypes/__init__.py 2013-08-02 01:03:18.542968700 +0400 ++++ Python-3.3.2/Lib/ctypes/__init__.py 2013-08-02 01:01:40.130859300 +0400 +@@ -1,6 +1,6 @@ + """create and manipulate C data types in Python""" + +-import os as _os, sys as _sys ++import os as _os, sys as _sys, sysconfig as _sysconfig + + __version__ = "1.1.0" + +@@ -435,9 +435,8 @@ + + if _os.name in ("nt", "ce"): + pythonapi = PyDLL("python dll", None, _sys.dllhandle) +-elif _sys.platform == "cygwin": +- pythonapi = PyDLL("libpython%d.%d%s.dll" % \ +- (_sys.version_info[:2] + tuple(_sys.abiflags))) ++elif _sys.platform in ['cygwin', 'msys']: ++ pythonapi = PyDLL(_sysconfig.get_config_var('DLLLIBRARY')) + else: + pythonapi = PyDLL(None) + +diff -Naur Python-3.3.2-cygwin/Lib/ctypes/test/test_loading.py Python-3.3.2/Lib/ctypes/test/test_loading.py +--- Python-3.3.2-cygwin/Lib/ctypes/test/test_loading.py 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Lib/ctypes/test/test_loading.py 2013-08-02 00:54:20.406250000 +0400 +@@ -11,6 +11,8 @@ + libc_name = "coredll" + elif sys.platform == "cygwin": + libc_name = "cygwin1.dll" ++elif sys.platform == "msys": ++ libc_name = "msys-2.0.dll" + else: + libc_name = find_library("c") + +diff -Naur Python-3.3.2-cygwin/Lib/ctypes/util.py Python-3.3.2/Lib/ctypes/util.py +--- Python-3.3.2-cygwin/Lib/ctypes/util.py 2013-08-01 23:57:43.715820300 +0400 ++++ Python-3.3.2/Lib/ctypes/util.py 2013-08-02 00:54:20.406250000 +0400 +@@ -83,7 +83,7 @@ + continue + return None + +-elif sys.platform == "cygwin": ++elif sys.platform in ["cygwin", "msys"]: + def find_library(name): + for libdir in ['/usr/lib', '/usr/local/lib']: + for libext in ['lib%s.dll.a' % name, 'lib%s.a' % name]: +@@ -279,6 +279,10 @@ + print(cdll.LoadLibrary("cygbz2-1.dll")) + print(find_library("crypt")) + print(cdll.LoadLibrary("cygcrypt-0.dll")) ++ elif sys.platform == "msys": ++ print(cdll.LoadLibrary("msys-bz2-1.dll")) ++ print(find_library("crypt")) ++ print(cdll.LoadLibrary("msys-crypt-0.dll")) + else: + print(cdll.LoadLibrary("libm.so")) + print(cdll.LoadLibrary("libcrypt.so")) +diff -Naur Python-3.3.2-cygwin/Lib/distutils/ccompiler.py Python-3.3.2/Lib/distutils/ccompiler.py +--- Python-3.3.2-cygwin/Lib/distutils/ccompiler.py 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Lib/distutils/ccompiler.py 2013-08-02 00:54:20.406250000 +0400 +@@ -926,6 +926,7 @@ + # on a cygwin built python we can use gcc like an ordinary UNIXish + # compiler + ('cygwin.*', 'unix'), ++ ('msys.*', 'unix'), + ('os2emx', 'emx'), + + # OS name mappings +@@ -964,6 +965,8 @@ + "Microsoft Visual C++"), + 'cygwin': ('cygwinccompiler', 'CygwinCCompiler', + "Cygwin port of GNU C Compiler for Win32"), ++ 'msys': ('cygwinccompiler', 'CygwinCCompiler', ++ "Cygwin port of GNU C Compiler for Win32"), + 'mingw32': ('cygwinccompiler', 'Mingw32CCompiler', + "Mingw32 port of GNU C Compiler for Win32"), + 'bcpp': ('bcppcompiler', 'BCPPCompiler', +diff -Naur Python-3.3.2-cygwin/Lib/distutils/command/build_ext.py Python-3.3.2/Lib/distutils/command/build_ext.py +--- Python-3.3.2-cygwin/Lib/distutils/command/build_ext.py 2013-08-02 00:15:05.345703100 +0400 ++++ Python-3.3.2/Lib/distutils/command/build_ext.py 2013-08-02 00:54:20.421875000 +0400 +@@ -237,7 +237,7 @@ + + # for extensions under Cygwin and AtheOS Python's library directory must be + # appended to library_dirs +- if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos': ++ if sys.platform[:6] == 'cygwin' or sys.platform[:4] == 'msys' or sys.platform[:6] == 'atheos': + if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): + # building third party extensions + self.library_dirs.append(os.path.join(sys.prefix, "lib", +@@ -729,7 +729,7 @@ + # don't extend ext.libraries, it may be shared with other + # extensions, it is a reference to the original list + return ext.libraries + [pythonlib] +- elif sys.platform[:6] == "cygwin": ++ elif sys.platform[:6] == "cygwin" or sys.platform[:4] == "msys": + template = "python%d.%d%s" + pythonlib = (template % + (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff, sys.abiflags)) +diff -Naur Python-3.3.2-cygwin/Lib/distutils/tests/support.py Python-3.3.2/Lib/distutils/tests/support.py +--- Python-3.3.2-cygwin/Lib/distutils/tests/support.py 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Lib/distutils/tests/support.py 2013-08-02 00:54:20.421875000 +0400 +@@ -64,7 +64,7 @@ + super().tearDown() + while self.tempdirs: + d = self.tempdirs.pop() +- shutil.rmtree(d, os.name in ('nt', 'cygwin')) ++ shutil.rmtree(d, os.name in ('nt', 'cygwin', 'msys')) + + def mkdtemp(self): + """Create a temporary directory that will be cleaned up. +diff -Naur Python-3.3.2-cygwin/Lib/distutils/unixccompiler.py Python-3.3.2/Lib/distutils/unixccompiler.py +--- Python-3.3.2-cygwin/Lib/distutils/unixccompiler.py 2013-08-02 00:25:54.459960900 +0400 ++++ Python-3.3.2/Lib/distutils/unixccompiler.py 2013-08-02 00:54:20.421875000 +0400 +@@ -77,7 +77,7 @@ + shared_lib_extension = ".so" + dylib_lib_extension = ".dylib" + static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" +- if sys.platform == "cygwin": ++ if sys.platform in ["cygwin", "msys"]: + exe_extension = ".exe" + dylib_lib_extension = ".dll.a" + +@@ -223,7 +223,7 @@ + # the configuration data stored in the Python installation, so + # we use this hack. + compiler = os.path.basename(sysconfig.get_config_var("CC")) +- if sys.platform[:6] == "darwin" or sys.platform[:6] == "cygwin": ++ if sys.platform[:6] == "darwin" or sys.platform[:6] == "cygwin" or sys.platform[:4] == "msys": + # MacOSX's linker doesn't understand the -R flag at all + return "-L" + dir + elif sys.platform[:5] == "hp-ux": +diff -Naur Python-3.3.2-cygwin/Lib/distutils/util.py Python-3.3.2/Lib/distutils/util.py +--- Python-3.3.2-cygwin/Lib/distutils/util.py 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Lib/distutils/util.py 2013-08-02 00:54:20.437500000 +0400 +@@ -97,6 +97,12 @@ + m = rel_re.match(release) + if m: + release = m.group() ++ elif osname[:4] == "msys": ++ osname = "msys" ++ rel_re = re.compile (r'[\d.]+', re.ASCII) ++ m = rel_re.match(release) ++ if m: ++ release = m.group() + elif osname[:6] == "darwin": + import _osx_support, distutils.sysconfig + osname, release, machine = _osx_support.get_platform_osx( +diff -Naur Python-3.3.2-cygwin/Lib/importlib/_bootstrap.py Python-3.3.2/Lib/importlib/_bootstrap.py +--- Python-3.3.2-cygwin/Lib/importlib/_bootstrap.py 2013-05-15 20:32:54.000000000 +0400 ++++ Python-3.3.2/Lib/importlib/_bootstrap.py 2013-08-02 01:10:19.545898400 +0400 +@@ -26,7 +26,7 @@ + + # Bootstrap-related code ###################################################### + +-_CASE_INSENSITIVE_PLATFORMS = 'win', 'cygwin', 'darwin' ++_CASE_INSENSITIVE_PLATFORMS = 'win', 'cygwin', 'msys', 'darwin' + + + def _make_relax_case(): +diff -Naur Python-3.3.2-cygwin/Lib/sysconfig.py Python-3.3.2/Lib/sysconfig.py +--- Python-3.3.2-cygwin/Lib/sysconfig.py 2013-05-15 20:32:55.000000000 +0400 ++++ Python-3.3.2/Lib/sysconfig.py 2013-08-02 00:54:27.156250000 +0400 +@@ -683,6 +683,12 @@ + m = rel_re.match(release) + if m: + release = m.group() ++ elif osname[:4] == "msys": ++ osname = "msys" ++ rel_re = re.compile (r'[\d.]+') ++ m = rel_re.match(release) ++ if m: ++ release = m.group() + elif osname[:6] == "darwin": + import _osx_support + osname, release, machine = _osx_support.get_platform_osx( +diff -Naur Python-3.3.2-cygwin/Lib/tempfile.py Python-3.3.2/Lib/tempfile.py +--- Python-3.3.2-cygwin/Lib/tempfile.py 2013-05-15 20:32:55.000000000 +0400 ++++ Python-3.3.2/Lib/tempfile.py 2013-08-02 00:54:27.156250000 +0400 +@@ -442,7 +442,7 @@ + + return _TemporaryFileWrapper(file, name, delete) + +-if _os.name != 'posix' or _os.sys.platform == 'cygwin': ++if _os.name != 'posix' or _os.sys.platform == 'cygwin' or _os.sys.platform == 'msys': + # On non-POSIX and Cygwin systems, assume that we cannot unlink a file + # while it is open. + TemporaryFile = NamedTemporaryFile +diff -Naur Python-3.3.2-cygwin/Lib/test/regrtest.py Python-3.3.2/Lib/test/regrtest.py +--- Python-3.3.2-cygwin/Lib/test/regrtest.py 2013-05-15 20:32:55.000000000 +0400 ++++ Python-3.3.2/Lib/test/regrtest.py 2013-08-02 01:04:50.530273400 +0400 +@@ -1621,6 +1621,19 @@ + test_ossaudiodev + test_socketserver + """), ++ ('msys', ++ """ ++ test_curses ++ test_dbm ++ test_devpoll ++ test_epoll ++ test_ioctl ++ test_kqueue ++ test_largefile ++ test_locale ++ test_ossaudiodev ++ test_socketserver ++ """), + ('os2emx', + """ + test_audioop +diff -Naur Python-3.3.2-cygwin/Lib/test/test_curses.py Python-3.3.2/Lib/test/test_curses.py +--- Python-3.3.2-cygwin/Lib/test/test_curses.py 2013-05-15 20:32:55.000000000 +0400 ++++ Python-3.3.2/Lib/test/test_curses.py 2013-08-02 00:54:27.171875000 +0400 +@@ -29,7 +29,7 @@ + if not term or term == 'unknown': + raise unittest.SkipTest("$TERM=%r, calling initscr() may cause exit" % term) + +-if sys.platform == "cygwin": ++if sys.platform in ["cygwin", "msys"]: + raise unittest.SkipTest("cygwin's curses mostly just hangs") + + def window_funcs(stdscr): +diff -Naur Python-3.3.2-cygwin/Lib/test/test_importlib/util.py Python-3.3.2/Lib/test/test_importlib/util.py +--- Python-3.3.2-cygwin/Lib/test/test_importlib/util.py 2013-05-15 20:32:56.000000000 +0400 ++++ Python-3.3.2/Lib/test/test_importlib/util.py 2013-08-02 01:11:15.795898400 +0400 +@@ -9,7 +9,7 @@ + CASE_INSENSITIVE_FS = True + # Windows is the only OS that is *always* case-insensitive + # (OS X *can* be case-sensitive). +-if sys.platform not in ('win32', 'cygwin'): ++if sys.platform not in ('win32', 'cygwin', 'msys'): + changed_name = __file__.upper() + if changed_name == __file__: + changed_name = __file__.lower() +diff -Naur Python-3.3.2-cygwin/Lib/test/test_mailbox.py Python-3.3.2/Lib/test/test_mailbox.py +--- Python-3.3.2-cygwin/Lib/test/test_mailbox.py 2013-05-15 20:32:56.000000000 +0400 ++++ Python-3.3.2/Lib/test/test_mailbox.py 2013-08-02 00:54:27.171875000 +0400 +@@ -596,7 +596,7 @@ + + def setUp(self): + TestMailbox.setUp(self) +- if os.name in ('nt', 'os2') or sys.platform == 'cygwin': ++ if os.name in ('nt', 'os2') or sys.platform == 'cygwin' or sys.platform == 'msys': + self._box.colon = '!' + + def assertMailboxEmpty(self): +diff -Naur Python-3.3.2-cygwin/Lib/test/test_netrc.py Python-3.3.2/Lib/test/test_netrc.py +--- Python-3.3.2-cygwin/Lib/test/test_netrc.py 2013-05-15 20:32:56.000000000 +0400 ++++ Python-3.3.2/Lib/test/test_netrc.py 2013-08-02 00:54:27.187500000 +0400 +@@ -11,7 +11,7 @@ + def make_nrc(self, test_data): + test_data = textwrap.dedent(test_data) + mode = 'w' +- if sys.platform != 'cygwin': ++ if sys.platform not in ['cygwin', 'msys']: + mode += 't' + with open(temp_filename, mode) as fp: + fp.write(test_data) +diff -Naur Python-3.3.2-cygwin/Lib/test/test_shutil.py Python-3.3.2/Lib/test/test_shutil.py +--- Python-3.3.2-cygwin/Lib/test/test_shutil.py 2013-05-15 20:32:56.000000000 +0400 ++++ Python-3.3.2/Lib/test/test_shutil.py 2013-08-02 00:54:27.187500000 +0400 +@@ -96,7 +96,7 @@ + super(TestShutil, self).tearDown() + while self.tempdirs: + d = self.tempdirs.pop() +- shutil.rmtree(d, os.name in ('nt', 'cygwin')) ++ shutil.rmtree(d, os.name in ('nt', 'cygwin', 'msys')) + + + def mkdtemp(self): +@@ -196,7 +196,7 @@ + + # See bug #1071513 for why we don't run this on cygwin + # and bug #1076467 for why we don't run this as root. +- if (hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin' ++ if (hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin' and sys.platform[:4] != 'msys' + and not (hasattr(os, 'geteuid') and os.geteuid() == 0)): + def test_on_error(self): + self.errorState = 0 +diff -Naur Python-3.3.2-cygwin/Lib/tkinter/test/test_tkinter/test_loadtk.py Python-3.3.2/Lib/tkinter/test/test_tkinter/test_loadtk.py +--- Python-3.3.2-cygwin/Lib/tkinter/test/test_tkinter/test_loadtk.py 2013-05-15 20:32:56.000000000 +0400 ++++ Python-3.3.2/Lib/tkinter/test/test_tkinter/test_loadtk.py 2013-08-02 00:54:27.187500000 +0400 +@@ -18,7 +18,7 @@ + + def testLoadTkFailure(self): + old_display = None +- if sys.platform.startswith(('win', 'darwin', 'cygwin')): ++ if sys.platform.startswith(('win', 'darwin', 'cygwin', 'msys')): + # no failure possible on windows? + + # XXX Maybe on tk older than 8.4.13 it would be possible, +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/acinclude.m4 Python-3.3.2/Modules/_ctypes/libffi/acinclude.m4 +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/acinclude.m4 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/acinclude.m4 2013-08-02 00:54:27.203125000 +0400 +@@ -37,7 +37,7 @@ + # Systems known to be in this category are Windows (all variants), + # VMS, and Darwin. + case "$host_os" in +- vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) ++ vms* | cygwin* | msys* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) + ac_cv_func_mmap_dev_zero=no ;; + *) + ac_cv_func_mmap_dev_zero=yes;; +@@ -69,7 +69,7 @@ + # above for use of /dev/zero. + # Systems known to be in this category are Windows, VMS, and SCO Unix. + case "$host_os" in +- vms* | cygwin* | pe | mingw* | sco* | udk* ) ++ vms* | cygwin* | msys* | pe | mingw* | sco* | udk* ) + ac_cv_func_mmap_anon=no ;; + *) + ac_cv_func_mmap_anon=yes;; +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/aclocal.m4 Python-3.3.2/Modules/_ctypes/libffi/aclocal.m4 +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/aclocal.m4 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/aclocal.m4 2013-08-02 00:54:27.203125000 +0400 +@@ -724,7 +724,7 @@ + beos*) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" + ;; +-cygwin* | mingw* | os2* | pw32*) ++cygwin* | msys* | mingw* | os2* | pw32*) + AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) + LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" + ;; +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/config.guess Python-3.3.2/Modules/_ctypes/libffi/config.guess +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/config.guess 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/config.guess 2013-08-02 00:54:27.203125000 +0400 +@@ -849,6 +849,9 @@ + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; ++ amd64:MSYS*:*:* | x86_64:MSYS*:*:*) ++ echo x86_64-unknown-msys ++ exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/configure Python-3.3.2/Modules/_ctypes/libffi/configure +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/configure 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/configure 2013-08-02 00:54:27.218750000 +0400 +@@ -5291,7 +5291,7 @@ + lt_cv_sys_max_cmd_len=-1; + ;; + +- cygwin* | mingw* | cegcc*) ++ cygwin* | msys* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, +@@ -5481,7 +5481,7 @@ + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix +@@ -5489,12 +5489,12 @@ + ;; + esac + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix +@@ -5560,7 +5560,7 @@ + esac + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi +@@ -5718,7 +5718,7 @@ + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +-cygwin*) ++cygwin* | msys*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' +@@ -6039,7 +6039,7 @@ + lt_cv_sharedlib_from_linklib_cmd='unknown' + + case $host_os in +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in +@@ -6532,7 +6532,7 @@ + aix*) + symcode='[BCDT]' + ;; +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; + hpux*) +@@ -8629,7 +8629,7 @@ + # PIC is the default for these OSes. + ;; + +- mingw* | cygwin* | pw32* | os2* | cegcc*) ++ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style +@@ -8713,7 +8713,7 @@ + fi + ;; + +- mingw* | cygwin* | pw32* | os2* | cegcc*) ++ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' +@@ -9204,7 +9204,7 @@ + extract_expsyms_cmds= + + case $host_os in +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. +@@ -9319,7 +9319,7 @@ + fi + ;; + +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' +@@ -9776,7 +9776,7 @@ + export_dynamic_flag_spec=-rdynamic + ;; + +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is +@@ -10729,7 +10729,7 @@ + # libtool to hard-code these into programs + ;; + +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no +@@ -10761,6 +10761,12 @@ + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; ++ msys*) ++ # MSYS DLLs use 'msys-' prefix rather than 'lib' ++ soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ ++ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ++ ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' +@@ -10795,7 +10801,7 @@ + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; +- cygwin*) ++ cygwin* | msys*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... +@@ -11460,7 +11466,7 @@ + lt_cv_dlopen_libs= + ;; + +- cygwin*) ++ cygwin* | msys*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; +@@ -13193,7 +13199,7 @@ + # Systems known to be in this category are Windows (all variants), + # VMS, and Darwin. + case "$host_os" in +- vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) ++ vms* | cygwin* | msys* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) + ac_cv_func_mmap_dev_zero=no ;; + *) + ac_cv_func_mmap_dev_zero=yes;; +@@ -13250,7 +13256,7 @@ + # above for use of /dev/zero. + # Systems known to be in this category are Windows, VMS, and SCO Unix. + case "$host_os" in +- vms* | cygwin* | pe | mingw* | sco* | udk* ) ++ vms* | cygwin* | msys* | pe | mingw* | sco* | udk* ) + ac_cv_func_mmap_anon=no ;; + *) + ac_cv_func_mmap_anon=yes;; +@@ -13344,7 +13350,7 @@ + i?86-*-freebsd* | i?86-*-openbsd*) + TARGET=X86_FREEBSD; TARGETDIR=x86 + ;; +- i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix*) ++ i?86-win32* | i?86-*-cygwin* | i?86-*-msys* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix*) + TARGET=X86_WIN32; TARGETDIR=x86 + # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. + # We must also check with_cross_host to decide if this is a native +@@ -13376,7 +13382,7 @@ + TARGET=X86_DARWIN; TARGETDIR=x86 + ;; + +- x86_64-*-cygwin* | x86_64-*-mingw*) ++ x86_64-*-cygwin* | x86_64-*-msys* | x86_64-*-mingw*) + TARGET=X86_WIN64; TARGETDIR=x86 + # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. + # We must also check with_cross_host to decide if this is a native +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/configure.ac Python-3.3.2/Modules/_ctypes/libffi/configure.ac +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/configure.ac 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/configure.ac 2013-08-02 00:54:27.250000000 +0400 +@@ -125,7 +125,7 @@ + i?86-*-freebsd* | i?86-*-openbsd*) + TARGET=X86_FREEBSD; TARGETDIR=x86 + ;; +- i?86-win32* | i?86-*-cygwin* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix*) ++ i?86-win32* | i?86-*-cygwin* | i?86-*-msys* | i?86-*-mingw* | i?86-*-os2* | i?86-*-interix*) + TARGET=X86_WIN32; TARGETDIR=x86 + # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. + # We must also check with_cross_host to decide if this is a native +@@ -157,7 +157,7 @@ + TARGET=X86_DARWIN; TARGETDIR=x86 + ;; + +- x86_64-*-cygwin* | x86_64-*-mingw*) ++ x86_64-*-cygwin* | x86_64-*-msys* | x86_64-*-mingw*) + TARGET=X86_WIN64; TARGETDIR=x86 + # All mingw/cygwin/win32 builds require -no-undefined for sharedlib. + # We must also check with_cross_host to decide if this is a native +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/ltmain.sh Python-3.3.2/Modules/_ctypes/libffi/ltmain.sh +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/ltmain.sh 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/ltmain.sh 2013-08-02 00:54:27.265625000 +0400 +@@ -1180,7 +1180,7 @@ + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in +- *cygwin* | *mingw* | *pw32* | *cegcc*) ++ *cygwin* | *msys* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; +@@ -2123,7 +2123,7 @@ + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in +- cygwin* | mingw* | pw32* | os2* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac +@@ -2992,7 +2992,7 @@ + 'exit $?' + tstripme="$stripme" + case $host_os in +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" +@@ -3098,7 +3098,7 @@ + + # Do a test to see if this is really a libtool program. + case $host in +- *cygwin* | *mingw*) ++ *cygwin* | *msys* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result +@@ -3173,7 +3173,7 @@ + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in +- */usr/bin/install*,*cygwin*) ++ */usr/bin/install*,*cygwin*|*/usr/bin/install*,*msys*) + case $file:$destfile in + *.exe:*.exe) + # this is ok +@@ -3323,7 +3323,7 @@ + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in +- *cygwin* | *mingw* | *cegcc* ) ++ *cygwin* | *msys* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; +@@ -3335,7 +3335,7 @@ + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in +- *cygwin* | *mingw* | *cegcc* ) ++ *cygwin* | *msys* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; +@@ -3349,7 +3349,7 @@ + func_basename "$dlprefile" + name="$func_basename_result" + case $host in +- *cygwin* | *mingw* | *cegcc* ) ++ *cygwin* | *msys* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" +@@ -3502,7 +3502,7 @@ + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in +- *cygwin* | *mingw* | *cegcc* ) ++ *cygwin* | *msys* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` +@@ -4375,7 +4375,7 @@ + { + EOF + case "$host" in +- *mingw* | *cygwin* ) ++ *mingw* | *cygwin* | *msys* ) + # make stdout use "unix" line endings + echo " setmode(1,_O_BINARY);" + ;; +@@ -5094,7 +5094,7 @@ + { + $opt_debug + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra +@@ -5581,7 +5581,7 @@ + ;; + esac + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; +@@ -5601,7 +5601,7 @@ + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; +@@ -5679,7 +5679,7 @@ + + -no-install) + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" +@@ -6545,7 +6545,7 @@ + fi + case "$host" in + # special handling for platforms with PE-DLLs. +- *cygwin* | *mingw* | *cegcc* ) ++ *cygwin* | *msys* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present +@@ -6689,7 +6689,7 @@ + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in +- *cygwin* | *mingw* | *cegcc*) ++ *cygwin* | *msys* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no +@@ -6759,7 +6759,7 @@ + elif test -n "$soname_spec"; then + # bleh windows + case $host in +- *cygwin* | mingw* | *cegcc*) ++ *cygwin* | *msys* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" +@@ -7620,7 +7620,7 @@ + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) +@@ -8134,7 +8134,7 @@ + + orig_export_symbols= + case $host_os in +- cygwin* | mingw* | cegcc*) ++ cygwin* | msys* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then +@@ -8690,7 +8690,7 @@ + + prog) + case $host in +- *cygwin*) func_stripname '' '.exe' "$output" ++ *cygwin* | *msys*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ +@@ -8803,7 +8803,7 @@ + esac + fi + case $host in +- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) ++ *-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; +@@ -8881,7 +8881,7 @@ + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; +- *cygwin* | *mingw* ) ++ *cygwin* | *msys* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi +@@ -9028,14 +9028,14 @@ + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in +- *cygwin*) ++ *cygwin* | *msys*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in +- *cygwin* | *mingw* ) ++ *cygwin* | *msys* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result +@@ -9365,7 +9365,7 @@ + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in +- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) ++ *cygwin*,*lai,yes,no,*.dll | *msys*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/m4/libtool.m4 Python-3.3.2/Modules/_ctypes/libffi/m4/libtool.m4 +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/m4/libtool.m4 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/m4/libtool.m4 2013-08-02 00:54:27.281250000 +0400 +@@ -1623,7 +1623,7 @@ + lt_cv_sys_max_cmd_len=-1; + ;; + +- cygwin* | mingw* | cegcc*) ++ cygwin* | msys* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, +@@ -1871,7 +1871,7 @@ + lt_cv_dlopen_libs= + ;; + +- cygwin*) ++ cygwin* | msys*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; +@@ -2342,7 +2342,7 @@ + # libtool to hard-code these into programs + ;; + +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no +@@ -2374,6 +2374,12 @@ + m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; ++ msys*) ++ # MSYS DLLs use 'msys-' prefix rather than 'lib' ++ soname_spec='`echo ${libname} | sed -e 's/^lib/msys-/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ++m4_if([$1], [],[ ++ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ++ ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +@@ -2408,7 +2414,7 @@ + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; +- cygwin*) ++ cygwin* | msys*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... +@@ -3152,7 +3158,7 @@ + esac + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi +@@ -3208,7 +3214,7 @@ + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +-cygwin*) ++cygwin* | msys*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' +@@ -3518,7 +3524,7 @@ + [lt_cv_sharedlib_from_linklib_cmd='unknown' + + case $host_os in +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in +@@ -3573,7 +3579,7 @@ + [AC_REQUIRE([AC_CANONICAL_HOST])dnl + LIBM= + case $host in +-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) ++*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-msys* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; + *-ncr-sysv4.3*) +@@ -3648,7 +3654,7 @@ + aix*) + symcode='[[BCDT]]' + ;; +-cygwin* | mingw* | pw32* | cegcc*) ++cygwin* | msys* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; + hpux*) +@@ -3916,7 +3922,7 @@ + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; +- mingw* | cygwin* | os2* | pw32* | cegcc*) ++ mingw* | cygwin* | msys* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style +@@ -3987,7 +3993,7 @@ + ;; + esac + ;; +- mingw* | cygwin* | os2* | pw32* | cegcc*) ++ mingw* | cygwin* | msys* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], +@@ -4234,7 +4240,7 @@ + # PIC is the default for these OSes. + ;; + +- mingw* | cygwin* | pw32* | os2* | cegcc*) ++ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style +@@ -4319,7 +4325,7 @@ + fi + ;; + +- mingw* | cygwin* | pw32* | os2* | cegcc*) ++ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], +@@ -4579,7 +4585,7 @@ + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; +- cygwin* | mingw* | cegcc*) ++ cygwin* | msys* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' +@@ -4637,7 +4643,7 @@ + extract_expsyms_cmds= + + case $host_os in +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. +@@ -4752,7 +4758,7 @@ + fi + ;; + +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +@@ -5125,7 +5131,7 @@ + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is +@@ -6126,7 +6132,7 @@ + esac + ;; + +- cygwin* | mingw* | pw32* | cegcc*) ++ cygwin* | msys* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC +@@ -7942,7 +7948,7 @@ + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix +@@ -7950,12 +7956,12 @@ + ;; + esac + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; +- *-*-cygwin* ) ++ *-*-cygwin* | *-*-msys* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/m4/ltoptions.m4 Python-3.3.2/Modules/_ctypes/libffi/m4/ltoptions.m4 +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/m4/ltoptions.m4 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/m4/ltoptions.m4 2013-08-02 00:54:27.281250000 +0400 +@@ -126,7 +126,7 @@ + [enable_win32_dll=yes + + case $host in +-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) ++*-*-cygwin* | *-*-msys* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp Python-3.3.2/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp 2013-08-02 00:54:27.281250000 +0400 +@@ -175,7 +175,7 @@ + } else { + setenv DYLD_LIBRARY_PATH "$ld_library_path" + } +- if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } { ++ if { [istarget *-*-cygwin*] || [istarget *-*-msys*] || [istarget *-*-mingw*] } { + if { $orig_path_saved } { + setenv PATH "$ld_library_path:$orig_path" + } else { +@@ -271,7 +271,7 @@ + + if { [ istarget *-*-darwin* ] } { + set shlib_ext "dylib" +- } elseif { [ istarget *-*-cygwin* ] || [ istarget *-*-mingw* ] } { ++ } elseif { [ istarget *-*-cygwin* ] || [istarget *-*-msys*] || [ istarget *-*-mingw* ] } { + set shlib_ext "dll" + } elseif { [ istarget hppa*-*-hpux* ] } { + set shlib_ext "sl" +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c 2013-08-02 00:54:27.281250000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: */ + +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ ++/* { dg-do run { target i?86-*-cygwin* i?86-*-msys* i?86-*-mingw* } } */ + #include "ffitest.h" + + static void +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c 2013-08-02 00:54:27.296875000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: */ + +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ ++/* { dg-do run { target i?86-*-cygwin* i?86-*-msys* i?86-*-mingw* } } */ + #include "ffitest.h" + + static void +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c 2013-08-02 00:54:27.296875000 +0400 +@@ -4,10 +4,10 @@ + PR: none. + Originator: 20031203 */ + +-/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */ ++/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* x86_64-*-msys* } } */ + /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ + /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ +-/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */ ++/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* x86_64-*-msys* } } */ + + #include "ffitest.h" + +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c 2013-08-02 00:54:27.296875000 +0400 +@@ -5,10 +5,10 @@ + Originator: Blake Chaffin 6/18/2007 + */ + +-/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */ ++/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* x86_64-*-msys* } } */ + /* { dg-do run { xfail strongarm*-*-* } } */ + /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ +-/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */ ++/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* x86_64-*-msys* } } */ + + #include "ffitest.h" + +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c 2013-08-02 00:54:27.312500000 +0400 +@@ -4,12 +4,12 @@ + PR: none. + Originator: Blake Chaffin */ + +-/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */ ++/* { dg-excess-errors "no long double format" { xfail x86_64-*-mingw* x86_64-*-cygwin* x86_64-*-msys* } } */ + /* This test is known to PASS on armv7l-unknown-linux-gnueabihf, so I have + remove the xfail for arm*-*-* below, until we know more. */ + /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ + /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ +-/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */ ++/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* x86_64-*-msys* } } */ + + #include "ffitest.h" + +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c 2013-08-02 00:54:27.312500000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: From the original ffitest.c */ + +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ ++/* { dg-do run { target i?86-*-cygwin* i?86-*-msys* i?86-*-mingw* } } */ + + #include "ffitest.h" + +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c 2013-08-02 00:54:27.312500000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: From the original ffitest.c */ + +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ ++/* { dg-do run { target i?86-*-cygwin* i?86-*-msys* i?86-*-mingw* } } */ + + #include "ffitest.h" + +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c 2013-08-02 00:54:27.328125000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: From the original ffitest.c */ + +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ ++/* { dg-do run { target i?86-*-cygwin* i?86-*-msys* i?86-*-mingw* } } */ + + #include "ffitest.h" + +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c 2013-08-02 00:54:27.328125000 +0400 +@@ -4,8 +4,8 @@ + PR: none. + Originator: From the original ffitest.c */ + +-/* { dg-excess-errors "fails" { target x86_64-*-mingw* x86_64-*-cygwin* } } */ +-/* { dg-do run { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */ ++/* { dg-excess-errors "fails" { target x86_64-*-mingw* x86_64-*-cygwin* x86_64-*-msys* } } */ ++/* { dg-do run { xfail x86_64-*-mingw* x86_64-*-cygwin* x86_64-*-msys* } } */ + + #include "ffitest.h" + #include "float.h" +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c 2013-08-02 00:54:27.328125000 +0400 +@@ -5,11 +5,11 @@ + Originator: Blake Chaffin 6/18/2007 + */ + +-/* { dg-excess-errors "" { target x86_64-*-mingw* x86_64-*-cygwin* } } */ ++/* { dg-excess-errors "" { target x86_64-*-mingw* x86_64-*-cygwin* x86_64-*-msys* } } */ + /* { dg-do run { xfail strongarm*-*-* xscale*-*-* } } */ + /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ + /* { dg-options -Wformat=0 { target moxie*-*-elf } } */ +-/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */ ++/* { dg-output "" { xfail x86_64-*-mingw* x86_64-*-cygwin* x86_64-*-msys* } } */ + + #include "ffitest.h" + +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c 2013-08-02 00:54:27.328125000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: From the original ffitest.c */ + +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ ++/* { dg-do run { target i?86-*-cygwin* i?86-*-msys* i?86-*-mingw* } } */ + + #include "ffitest.h" + #include +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/many2_win32.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/many2_win32.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/many2_win32.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/many2_win32.c 2013-08-02 00:54:27.343750000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: From the original ffitest.c */ + +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ ++/* { dg-do run { target i?86-*-cygwin* i?86-*-msys* i?86-*-mingw* } } */ + + #include "ffitest.h" + #include +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c 2013-08-02 00:54:27.343750000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: 20071113 */ + +-/* { dg-do run { xfail x86_64-*-mingw* x86_64-*-cygwin* } } */ ++/* { dg-do run { xfail x86_64-*-mingw* x86_64-*-cygwin* x86_64-*-msys* } } */ + #include "ffitest.h" + + static long double return_ldl(long double ldl) +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c 2013-08-02 00:54:27.343750000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: From the original ffitest.c */ + +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ ++/* { dg-do run { target i?86-*-cygwin* i?86-*-msys* i?86-*-mingw* } } */ + + #include "ffitest.h" + +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c 2013-08-02 00:54:27.343750000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: From the original ffitest.c */ + +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ ++/* { dg-do run { target i?86-*-cygwin* i?86-*-msys* i?86-*-mingw* } } */ + + #include "ffitest.h" + +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c 2013-08-02 00:54:27.359375000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: From the original ffitest.c */ + +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ ++/* { dg-do run { target i?86-*-cygwin* i?86-*-msys* i?86-*-mingw* } } */ + #include "ffitest.h" + + typedef struct +diff -Naur Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c +--- Python-3.3.2-cygwin/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c 2013-05-15 20:32:57.000000000 +0400 ++++ Python-3.3.2/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c 2013-08-02 00:54:27.359375000 +0400 +@@ -4,7 +4,7 @@ + PR: none. + Originator: From the original ffitest.c */ + +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ ++/* { dg-do run { target i?86-*-cygwin* i?86-*-msys* i?86-*-mingw* } } */ + #include "ffitest.h" + + typedef struct +diff -Naur Python-3.3.2-cygwin/Modules/makesetup Python-3.3.2/Modules/makesetup +--- Python-3.3.2-cygwin/Modules/makesetup 2013-08-02 00:17:46.703125000 +0400 ++++ Python-3.3.2/Modules/makesetup 2013-08-02 00:54:27.359375000 +0400 +@@ -85,7 +85,7 @@ + # Setup to link with extra libraries when makeing shared extensions. + # Currently, only Cygwin needs this baggage. + case `uname -s` in +-CYGWIN*) if test $libdir = . ++CYGWIN*|MSYS*) if test $libdir = . + then + ExtraLibDir=. + else +diff -Naur Python-3.3.2-cygwin/Modules/zlib/configure Python-3.3.2/Modules/zlib/configure +--- Python-3.3.2-cygwin/Modules/zlib/configure 2013-05-15 20:32:59.000000000 +0400 ++++ Python-3.3.2/Modules/zlib/configure 2013-08-02 01:12:14.749023400 +0400 +@@ -121,6 +121,8 @@ + Linux* | linux* | GNU | GNU/* | *BSD | DragonFly) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;; + CYGWIN* | Cygwin* | cygwin* | OS/2*) + EXE='.exe' ;; ++ MSYS* | Msys* | msys* ) ++ EXE='.exe' ;; + MINGW*|mingw*) + # temporary bypass + rm -f $test.[co] $test $test$shared_ext +diff -Naur Python-3.3.2-cygwin/setup.py Python-3.3.2/setup.py +--- Python-3.3.2-cygwin/setup.py 2013-08-01 23:54:03.430664000 +0400 ++++ Python-3.3.2/setup.py 2013-08-02 00:59:36.160156200 +0400 +@@ -308,7 +308,7 @@ + + # Workaround for Cygwin: Cygwin currently has fork issues when many + # modules have been imported +- if host_platform == 'cygwin': ++ if host_platform in ['cygwin', 'msys']: + self.announce('WARNING: skipping import check for Cygwin-based "%s"' + % ext.name) + return +@@ -1235,7 +1235,7 @@ + exts.append( Extension('resource', ['resource.c']) ) + + # Sun yellow pages. Some systems have the functions in libc. +- if (host_platform not in ['cygwin', 'qnx6'] and ++ if (host_platform not in ['cygwin', 'msys', 'qnx6'] and + find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): + if (self.compiler.find_library_file(lib_dirs, 'nsl')): + libs = ['nsl'] +@@ -1470,6 +1470,10 @@ + macros = dict() + libraries = [] + ++ elif host_platform == 'msys': # MSYS ++ macros = dict() ++ libraries = [] ++ + elif host_platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'): + # FreeBSD's P1003.1b semaphore support is very experimental + # and has many known problems. (as of June 2008) diff --git a/python3/uuid.patch b/python3/uuid.patch new file mode 100644 index 00000000..8bbbfc3a --- /dev/null +++ b/python3/uuid.patch @@ -0,0 +1,12 @@ +diff -r 4a318a45c4c3 Lib/uuid.py +--- a/Lib/uuid.py Mon Aug 19 13:07:18 2013 -0400 ++++ b/Lib/uuid.py Mon Aug 19 21:41:08 2013 +0400 +@@ -429,6 +429,8 @@ + _uuid_generate_random = lib.uuid_generate_random + if hasattr(lib, 'uuid_generate_time'): + _uuid_generate_time = lib.uuid_generate_time ++ if _uuid_generate_random is not None: ++ break # found everything we were looking for + + # The uuid_generate_* functions are broken on MacOS X 10.5, as noted + # in issue #8621 the function generates the same sequence of values