diff --git a/python2/2.7.5-FD_SETSIZE.patch b/python2/2.7.5-FD_SETSIZE.patch new file mode 100644 index 00000000..86e89b30 --- /dev/null +++ b/python2/2.7.5-FD_SETSIZE.patch @@ -0,0 +1,42 @@ +diff -urN a/Modules/selectmodule.c b/Modules/selectmodule.c +--- a/Modules/selectmodule.c 2013-10-20 19:30:20.515023800 +0100 ++++ b/Modules/selectmodule.c 2013-10-20 19:30:45.872474100 +0100 +@@ -6,6 +6,21 @@ + >= 0. + */ + ++/* Windows #defines FD_SETSIZE to 64 if FD_SETSIZE isn't already defined. ++ 64 is too small (too many people have bumped into that limit). ++ Here we boost it. ++ ++ Cygwin also defines FD_SETSIZE to 64, so also increase the limit on ++ Cygwin. We must do this before sys/types.h is included, which otherwise ++ sets FD_SETSIZE to the default. ++ ++ Users who want even more than the boosted limit should #define ++ FD_SETSIZE higher before this; e.g., via compiler /D switch. ++*/ ++#if (defined(MS_WINDOWS) || defined(__CYGWIN__)) && !defined(FD_SETSIZE) ++#define FD_SETSIZE 512 ++#endif ++ + #include "Python.h" + #include + +@@ -16,16 +31,6 @@ + #undef HAVE_BROKEN_POLL + #endif + +-/* Windows #defines FD_SETSIZE to 64 if FD_SETSIZE isn't already defined. +- 64 is too small (too many people have bumped into that limit). +- Here we boost it. +- Users who want even more than the boosted limit should #define +- FD_SETSIZE higher before this; e.g., via compiler /D switch. +-*/ +-#if defined(MS_WINDOWS) && !defined(FD_SETSIZE) +-#define FD_SETSIZE 512 +-#endif +- + #if defined(HAVE_POLL_H) + #include + #elif defined(HAVE_SYS_POLL_H) diff --git a/python2/2.7.5-allow-windows-paths-for-executable.patch b/python2/2.7.5-allow-windows-paths-for-executable.patch new file mode 100644 index 00000000..c17d5ee6 --- /dev/null +++ b/python2/2.7.5-allow-windows-paths-for-executable.patch @@ -0,0 +1,129 @@ +diff -urN a/Modules/getpath.c b/Modules/getpath.c +--- a/Modules/getpath.c 2013-10-21 11:14:32.295032500 +0100 ++++ b/Modules/getpath.c 2013-10-21 12:23:00.165259900 +0100 +@@ -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 +@@ -127,7 +131,11 @@ + + static char prefix[MAXPATHLEN+1]; + static char exec_prefix[MAXPATHLEN+1]; +-static char progpath[MAXPATHLEN+1]; ++static char progpath[MAXPATHLEN+1] = {'\0'}; ++#if defined(MS_WINDOWS) || defined(__CYGWIN__) ++static char dllpath[MAXPATHLEN+1] = {'\0'}; ++extern HANDLE PyWin_DLLhModule; ++#endif + static char *module_search_path = NULL; + static char lib_python[] = "lib/python" VERSION; + +@@ -208,7 +216,11 @@ + joinpath(char *buffer, char *stuff) + { + size_t n, k; ++#if defined(MS_WINDOWS) || defined(__CYGWIN__) ++ if (stuff[0] == SEP || (strlen(stuff)>=2 && stuff[0] != 0 && stuff[1] == ':')) ++#else + if (stuff[0] == SEP) ++#endif + n = 0; + else { + n = strlen(buffer); +@@ -222,6 +234,13 @@ + k = MAXPATHLEN - n; + strncpy(buffer+n, stuff, k); + buffer[n+k] = '\0'; ++#if defined(__CYGWIN__) ++ /* MSYS specific: Turn C:* into /c* */ ++ if (strlen(buffer)>2 && buffer[0] != 0 && buffer[1] == ':') { ++ buffer[1]=buffer[0]|32; ++ buffer[0]='/'; ++ } ++#endif + } + + /* copy_absolute requires that path be allocated at least +@@ -229,8 +248,21 @@ + static void + copy_absolute(char *path, char *p) + { ++#if defined(MS_WINDOWS) || defined(__CYGWIN__) ++ if (p[0] == SEP || (strlen(p)>=2 && p[0] != 0 && p[1] == ':')) ++#else + if (p[0] == SEP) ++#endif ++ { + strcpy(path, p); ++#if defined(__CYGWIN__) ++ /* MSYS specific: Turn C:* into /c* */ ++ if (strlen(path)>2 && path[0] != 0 && path[1] == ':') { ++ path[1]=path[0]|32; ++ path[0]='/'; ++ } ++#endif ++ } + else { + if (!getcwd(path, MAXPATHLEN)) { + /* unable to get the current directory */ +@@ -382,6 +414,42 @@ + } + + ++#if defined(MS_WINDOWS) || defined(__CYGWIN__) ++/* Calculates dllpath and progpath, replacing \\ with / */ ++int GetWindowsModulePaths() ++{ ++ int result = 0; ++ char* seps; ++ result = GetModuleFileNameA(NULL, progpath, MAXPATHLEN); ++ seps = strchr(progpath, '\\'); ++ while(seps) { ++ *seps = '/'; ++ seps = strchr(seps, '\\'); ++ } ++ dllpath[0] = '\0'; ++#if defined(Py_ENABLE_SHARED) && !defined(__CYGWIN__) ++ // Hmm, cygwin/MSYS2 replacement for PyWin_DLLhModule is needed. ++ if (PyWin_DLLhModule) { ++ if((GetModuleFileNameA(PyWin_DLLhModule, dllpath, MAXPATHLEN) > 0)) { ++ result = 1; ++ seps = strchr(dllpath, '\\'); ++ while(seps) { ++ *seps = '/'; ++ seps = strchr(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) + { +@@ -433,6 +501,10 @@ + else if(0 == _NSGetExecutablePath(progpath, &nsexeclength) && progpath[0] == SEP) + ; + #endif /* __APPLE__ */ ++#if defined(MS_WINDOWS) || defined(__CYGWIN__) ++ else if(GetWindowsModulePaths()) { ++ } ++#endif /* MS_WINDOWS */ + else if (path) { + while (1) { + char *delim = strchr(path, DELIM); diff --git a/python2/2.7.5-ctypes-util-find_library.patch b/python2/2.7.5-ctypes-util-find_library.patch new file mode 100644 index 00000000..0aa79e73 --- /dev/null +++ b/python2/2.7.5-ctypes-util-find_library.patch @@ -0,0 +1,35 @@ +diff -urN a/Lib/ctypes/util.py b/Lib/ctypes/util.py +--- a/Lib/ctypes/util.py 2013-05-12 04:32:42.000000000 +0100 ++++ b/Lib/ctypes/util.py 2013-10-20 19:27:59.754972700 +0100 +@@ -84,6 +84,20 @@ + 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" ++ res = os.popen(cmd).read().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 +@@ -267,6 +281,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/python2/2.7.5-dbm.patch b/python2/2.7.5-dbm.patch new file mode 100644 index 00000000..065f60bf --- /dev/null +++ b/python2/2.7.5-dbm.patch @@ -0,0 +1,28 @@ +diff -urN a/setup.py b/setup.py +--- a/setup.py 2013-10-20 19:33:02.452286000 +0100 ++++ b/setup.py 2013-10-20 19:33:25.714616600 +0100 +@@ -1230,7 +1230,7 @@ + + 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 +@@ -1285,6 +1285,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: + print "building dbm using bdb" diff --git a/python2/2.7.5-dylib.patch b/python2/2.7.5-dylib.patch new file mode 100644 index 00000000..8b6504a5 --- /dev/null +++ b/python2/2.7.5-dylib.patch @@ -0,0 +1,11 @@ +diff -urN a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py +--- a/Lib/distutils/unixccompiler.py 2013-10-20 19:33:46.896828100 +0100 ++++ b/Lib/distutils/unixccompiler.py 2013-10-20 19:34:22.585869400 +0100 +@@ -82,6 +82,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, diff --git a/python2/2.7.5-export-PyNode_SizeOf.patch b/python2/2.7.5-export-PyNode_SizeOf.patch new file mode 100644 index 00000000..9420f80e --- /dev/null +++ b/python2/2.7.5-export-PyNode_SizeOf.patch @@ -0,0 +1,12 @@ +diff -urN a/Include/node.h b/Include/node.h +--- a/Include/node.h 2013-10-20 19:36:23.352776900 +0100 ++++ b/Include/node.h 2013-10-20 19:36:53.765516400 +0100 +@@ -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/python2/2.7.5-export-PySignal_SetWakeupFd.patch b/python2/2.7.5-export-PySignal_SetWakeupFd.patch new file mode 100644 index 00000000..7237683e --- /dev/null +++ b/python2/2.7.5-export-PySignal_SetWakeupFd.patch @@ -0,0 +1,12 @@ +diff -urN a/Include/pyerrors.h b/Include/pyerrors.h +--- a/Include/pyerrors.h 2013-10-20 19:30:57.390132900 +0100 ++++ b/Include/pyerrors.h 2013-10-20 19:31:33.580202800 +0100 +@@ -231,7 +231,7 @@ + PyAPI_FUNC(void) PyErr_SetInterrupt(void); + + /* In signalmodule.c */ +-int PySignal_SetWakeupFd(int fd); ++PyAPI_FUNC(int) PySignal_SetWakeupFd(int fd); + + /* Support for adding program text to SyntaxErrors */ + PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int); diff --git a/python2/2.7.5-getpath-exe-extension.patch b/python2/2.7.5-getpath-exe-extension.patch new file mode 100644 index 00000000..8f7261b2 --- /dev/null +++ b/python2/2.7.5-getpath-exe-extension.patch @@ -0,0 +1,32 @@ +diff -urN a/Modules/getpath.c b/Modules/getpath.c +--- a/Modules/getpath.c 2013-10-20 19:34:40.007865900 +0100 ++++ b/Modules/getpath.c 2013-10-20 19:35:08.184477500 +0100 +@@ -451,6 +451,28 @@ + if (isxfile(progpath)) + break; + ++#ifdef __CYGWIN__ ++ /* ++ * Cygwin automatically removes the ".exe" extension from argv[0] ++ * to make programs feel like they are in a more Unix-like ++ * environment. Unfortunately, this can make it problemmatic for ++ * Cygwin to distinguish between a directory and an executable with ++ * the same name excluding the ".exe" extension. For example, the ++ * Cygwin Python build directory has a "Python" directory and a ++ * "python.exe" executable. This causes isxfile() to erroneously ++ * return false. If isdir() returns true and there is enough space ++ * to append the ".exe" extension, then we try again with the ++ * extension appended. ++ */ ++#define EXE ".exe" ++ if (isdir(progpath) && strlen(progpath) + strlen(EXE) <= MAXPATHLEN) ++ { ++ strcat(progpath, EXE); ++ if (isxfile(progpath)) ++ break; ++ } ++#endif /* __CYGWIN__ */ ++ + if (!delim) { + progpath[0] = '\0'; + break; diff --git a/python2/2.7.5-ncurses-abi6.patch b/python2/2.7.5-ncurses-abi6.patch new file mode 100644 index 00000000..c2a79a00 --- /dev/null +++ b/python2/2.7.5-ncurses-abi6.patch @@ -0,0 +1,17 @@ +diff -urN a/Include/py_curses.h b/Include/py_curses.h +--- a/Include/py_curses.h 2013-10-20 19:31:55.902479600 +0100 ++++ b/Include/py_curses.h 2013-10-20 19:32:30.732471800 +0100 +@@ -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/python2/2.7.5-no-libm.patch b/python2/2.7.5-no-libm.patch new file mode 100644 index 00000000..a1eb5249 --- /dev/null +++ b/python2/2.7.5-no-libm.patch @@ -0,0 +1,12 @@ +diff -urN a/setup.py b/setup.py +--- a/setup.py 2013-10-20 19:35:36.296085400 +0100 ++++ b/setup.py 2013-10-20 19:36:03.716653800 +0100 +@@ -549,7 +549,7 @@ + + # Check for MacOS X, which doesn't need libm.a at all + math_libs = ['m'] +- if host_platform in ['darwin', 'beos']: ++ if host_platform in ['darwin', 'beos', 'cygwin']: + math_libs = [] + + # XXX Omitted modules: gl, pure, dl, SGI-specific modules diff --git a/python2/2.7.5-ssl-threads.patch b/python2/2.7.5-ssl-threads.patch new file mode 100644 index 00000000..ac518bde --- /dev/null +++ b/python2/2.7.5-ssl-threads.patch @@ -0,0 +1,14 @@ +diff -urN a/Modules/_ssl.c b/Modules/_ssl.c +--- a/Modules/_ssl.c 2013-10-20 19:29:32.975304600 +0100 ++++ b/Modules/_ssl.c 2013-10-20 19:30:00.858899500 +0100 +@@ -16,6 +16,10 @@ + + #include "Python.h" + ++#ifdef __CYGWIN__ ++#undef WITH_THREAD ++#endif ++ + #ifdef WITH_THREAD + #include "pythread.h" + #define PySSL_BEGIN_ALLOW_THREADS { \ diff --git a/python2/2.7.5-tkinter-x11.patch b/python2/2.7.5-tkinter-x11.patch new file mode 100644 index 00000000..a7322551 --- /dev/null +++ b/python2/2.7.5-tkinter-x11.patch @@ -0,0 +1,28 @@ +diff -urN a/setup.py b/setup.py +--- a/setup.py 2013-10-20 19:28:33.249888500 +0100 ++++ b/setup.py 2013-10-20 19:28:56.054192900 +0100 +@@ -1874,12 +1874,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'): +@@ -1897,9 +1891,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/python2/PKGBUILD b/python2/PKGBUILD new file mode 100644 index 00000000..6a606176 --- /dev/null +++ b/python2/PKGBUILD @@ -0,0 +1,157 @@ +# Maintainer: Alexey Pavlov + +pkgname=python2 +pkgver=2.7.5 +pkgrel=1 +_pybasever=2.7 +pkgdesc="A high-level scripting language" +arch=('i686' 'x86_64') +license=('PSF') +url="http://www.python.org/" +depends=('bzip2' 'openssl' 'zlib' 'expat' 'sqlite' 'libffi') +#makedepends=('tk>=8.6.0') +optdepends=('tk: for IDLE') +conflicts=('python<3') +options=('!makeflags') +source=(http://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz + python-2.7.5-CVE-2013-4238.patch + uuid.patch + Python-2.7.5-reorder-bininstall-ln-symlink-creation.patch + python-2.7.5-msys2.patch + Python-2.7.5-fix-sqlite-module.patch + 2.7.5-tkinter-x11.patch + 2.7.5-ssl-threads.patch + 2.7.5-no-libm.patch + 2.7.5-ncurses-abi6.patch + 2.7.5-getpath-exe-extension.patch + 2.7.5-FD_SETSIZE.patch + 2.7.5-export-PySignal_SetWakeupFd.patch + 2.7.5-export-PyNode_SizeOf.patch + 2.7.5-dylib.patch + 2.7.5-dbm.patch + 2.7.5-ctypes-util-find_library.patch + 2.7.5-allow-windows-paths-for-executable.patch) +sha1sums=('b7389791f789625c2ba9d897aa324008ff482daf' + 'fb1f95ca21d9c00eaaea5a58236d1d97300482d7' + '589f93f70c9d51f8ed025d0546ea38312c430d21' + '76474752d5b84ad78d53f418d554b5c706fcbca7' + '2b5f115573d089801f023c16bacc08963f039272' + '6e842d2ac2ef6dae07ca14c75348addf6621bf24' + '53a3a7c2cd5412bc382d94043983362da80aed03' + '7dfd15538406481a1e87edc6d1ad5480c997201a' + '91ed9faad8f4ae97b5a69bfb8690401047f0178f' + 'dbbf0ebb32663740062106bb232157af262767ae' + 'e9764f8c852d7f19a995f2f1cc38d94ba036e007' + 'de7bb49c1e6a34bf3abee109f69bedb4e4e686a9' + 'cfce9aa371d876c7bf47732a4271f1201028ce7a' + 'eee4ce3f7c26b5c69729d2a5033d2f5277bc6868' + 'eaf864af38e8b2bd3952ca9e7fbb6efb6191b792' + 'f6e392723ed2a4b7fe0138522baa0e0f7b8b3660' + 'efbee46e7f1485985409db0f25adbb18ecb4a4ae' + 'fb78069fadcf5394ba380e26e371ad687d344415') + +prepare() { + cd "${srcdir}/Python-${pkgver}" + + # http://bugs.python.org/issue18709 + patch -Np1 -i ${srcdir}/python-2.7.5-CVE-2013-4238.patch + + patch -p1 -i ${srcdir}/2.7.5-ctypes-util-find_library.patch + patch -p1 -i ${srcdir}/2.7.5-tkinter-x11.patch + patch -p1 -i ${srcdir}/2.7.5-ssl-threads.patch + patch -p1 -i ${srcdir}/2.7.5-FD_SETSIZE.patch + patch -p1 -i ${srcdir}/2.7.5-export-PySignal_SetWakeupFd.patch + patch -p1 -i ${srcdir}/2.7.5-ncurses-abi6.patch + patch -p1 -i ${srcdir}/2.7.5-dbm.patch + patch -p1 -i ${srcdir}/2.7.5-dylib.patch + patch -p1 -i ${srcdir}/2.7.5-getpath-exe-extension.patch + patch -p1 -i ${srcdir}/2.7.5-no-libm.patch + patch -p1 -i ${srcdir}/2.7.5-export-PyNode_SizeOf.patch + patch -p1 -i ${srcdir}/Python-2.7.5-fix-sqlite-module.patch + patch -p1 -i ${srcdir}/python-2.7.5-msys2.patch + patch -p1 -i ${srcdir}/Python-2.7.5-reorder-bininstall-ln-symlink-creation.patch + patch -p1 -i ${srcdir}/uuid.patch + + # Incomplete patch from Ray Donnelly + # patch -p1 -i ${srcdir}/2.7.5-allow-windows-paths-for-executable.patch + + # Temporary workaround for FS#22322 + # See http://bugs.python.org/issue10835 for upstream report + sed -i "/progname =/s/python/python${_pybasever}/" Python/pythonrun.c + + # Enable built-in SQLite module to load extensions (fix FS#22122) + sed -i "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py + + # FS#23997 + sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python2|" Lib/cgi.py + + sed -i "s/python2.3/python2/g" Lib/distutils/tests/test_build_scripts.py \ + Lib/distutils/tests/test_install_scripts.py Tools/scripts/gprof2html.py + + # 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}" + + export OPT="${CFLAGS}" + ./configure --build=${CHOST} \ + --prefix=/usr \ + --enable-shared \ + --enable-ipv6 \ + --with-libc= \ + --with-libm= \ + --with-system-expat \ + --with-system-ffi \ + --with-threads \ + ac_cv_func_bind_textdomain_codeset=yes \ + CPPFLAGS="${CPPFLAGS} -I/usr/include/ncursesw" \ + LDFLAGS="${LDFLAGS} -L." + + make +} + +package() { + cd "${srcdir}/Python-${pkgver}" + make DESTDIR="${pkgdir}" altinstall maninstall + + rm "${pkgdir}"/usr/share/man/man1/python.1 + + ln -sf python${_pybasever} "${pkgdir}"/usr/bin/python2.exe + ln -sf python${_pybasever}-config "${pkgdir}"/usr/bin/python2-config + ln -sf python${_pybasever}.1 "${pkgdir}"/usr/share/man/man1/python2.1 + + # FS#33954 + ln -sf python-${_pybasever}.pc "${pkgdir}"/usr/lib/pkgconfig/python2.pc + + cp -f "${pkgdir}"/usr/lib/python${_pybasever}/config/libpython${_pybasever}.dll.a "${pkgdir}"/usr/lib/libpython${_pybasever}.dll.a + + mv "${pkgdir}"/usr/bin/smtpd.py "${pkgdir}"/usr/lib/python${_pybasever}/ + + # some useful "stuff" + install -dm755 "${pkgdir}"/usr/lib/python${_pybasever}/Tools/{i18n,scripts} + install -m755 Tools/i18n/{msgfmt,pygettext}.py "${pkgdir}"/usr/lib/python${_pybasever}/Tools/i18n/ + install -m755 Tools/scripts/{README,*py} "${pkgdir}"/usr/lib/python${_pybasever}/Tools/scripts/ + + # fix conflicts with python + mv "${pkgdir}"/usr/bin/idle{,2} + mv "${pkgdir}"/usr/bin/pydoc{,2} + mv "${pkgdir}"/usr/bin/2to3{,-2.7} + + # clean up #!s + find "${pkgdir}"/usr/lib/python${_pybasever}/ -name '*.py' | \ + xargs sed -i "s|#[ ]*![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" + + # clean-up reference to build directory + sed -i "s#${srcdir}/Python-${pkgver}:##" "${pkgdir}"/usr/lib/python${_pybasever}/config/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/python2/Python-2.7.5-fix-sqlite-module.patch b/python2/Python-2.7.5-fix-sqlite-module.patch new file mode 100644 index 00000000..01663cf2 --- /dev/null +++ b/python2/Python-2.7.5-fix-sqlite-module.patch @@ -0,0 +1,16 @@ +diff -urN a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c +--- a/Modules/_sqlite/connection.c 2013-10-20 19:37:19.768003700 +0100 ++++ b/Modules/_sqlite/connection.c 2013-10-20 19:37:56.224088800 +0100 +@@ -781,9 +781,12 @@ + } + + error: ++ { + #ifdef WITH_THREAD + PyGILState_Release(threadstate); + #endif ++ ; ++ } + } + + static void _pysqlite_drop_unused_statement_references(pysqlite_Connection* self) diff --git a/python2/Python-2.7.5-reorder-bininstall-ln-symlink-creation.patch b/python2/Python-2.7.5-reorder-bininstall-ln-symlink-creation.patch new file mode 100644 index 00000000..12ff4e49 --- /dev/null +++ b/python2/Python-2.7.5-reorder-bininstall-ln-symlink-creation.patch @@ -0,0 +1,14 @@ +diff -urN a/Makefile.pre.in b/Makefile.pre.in +--- a/Makefile.pre.in 2013-10-20 19:39:13.666518300 +0100 ++++ b/Makefile.pre.in 2013-10-20 19:39:42.365159700 +0100 +@@ -850,9 +850,9 @@ + then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON); \ + else true; \ + fi +- (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON)) + -rm -f $(DESTDIR)$(BINDIR)/python2$(EXE) + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python2$(EXE)) ++ (cd $(DESTDIR)$(BINDIR); $(LN) -s python2$(EXE) $(PYTHON)) + -rm -f $(DESTDIR)$(BINDIR)/python2-config + (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python2-config) + -rm -f $(DESTDIR)$(BINDIR)/python-config diff --git a/python2/python-2.7.5-CVE-2013-4238.patch b/python2/python-2.7.5-CVE-2013-4238.patch new file mode 100644 index 00000000..c3719018 --- /dev/null +++ b/python2/python-2.7.5-CVE-2013-4238.patch @@ -0,0 +1,267 @@ + +# HG changeset patch +# User Christian Heimes +# Date 1376693687 -7200 +# Node ID bd2360476bdbb1477b81b0e18b8d86b3452ba77b +# Parent 87fcc13ade91874971ad577efaa2254c744a2b07 +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 +@@ -25,6 +25,7 @@ ssl = test_support.import_module("ssl") + HOST = test_support.HOST + CERTFILE = None + SVN_PYTHON_ORG_ROOT_CERT = None ++NULLBYTECERT = None + + def handle_error(prefix): + exc_format = ' '.join(traceback.format_exception(*sys.exc_info())) +@@ -123,6 +124,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 test_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() +@@ -1360,7 +1382,7 @@ else: + + + def test_main(verbose=False): +- global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT ++ global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT, NULLBYTECERT + CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, + "keycert.pem") + SVN_PYTHON_ORG_ROOT_CERT = os.path.join( +@@ -1368,10 +1390,13 @@ def test_main(verbose=False): + "https_svn_python_org_root.pem") + NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir, + "nokia.pem") ++ NULLBYTECERT = os.path.join(os.path.dirname(__file__) or os.curdir, ++ "nullbytecert.pem") + + if (not os.path.exists(CERTFILE) or + not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or +- not os.path.exists(NOKIACERT)): ++ not os.path.exists(NOKIACERT) or ++ not os.path.exists(NULLBYTECERT)): + raise test_support.TestFailed("Can't read certificate files!") + + tests = [BasicTests, BasicSocketTests] +diff --git a/Modules/_ssl.c b/Modules/_ssl.c +--- a/Modules/_ssl.c ++++ b/Modules/_ssl.c +@@ -738,13 +738,16 @@ 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) { +- +- /* we special-case DirName as a tuple of tuples of attributes */ ++ gntype = name-> type; ++ switch (gntype) { ++ case GEN_DIRNAME: ++ /* we special-case DirName as a tuple of ++ tuples of attributes */ + + t = PyTuple_New(2); + if (t == NULL) { +@@ -764,11 +767,61 @@ 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 = PyString_FromString("email"); ++ as = name->d.rfc822Name; ++ break; ++ case GEN_DNS: ++ v = PyString_FromString("DNS"); ++ as = name->d.dNSName; ++ break; ++ case GEN_URI: ++ v = PyString_FromString("URI"); ++ as = name->d.uniformResourceIdentifier; ++ break; ++ } ++ if (v == NULL) { ++ Py_DECREF(t); ++ goto fail; ++ } ++ PyTuple_SET_ITEM(t, 0, v); ++ v = PyString_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_Warn(PyExc_RuntimeWarning, ++ "Unknown general name type") == -1) { ++ goto fail; ++ } ++ break; ++ } + (void) BIO_reset(biobuf); + GENERAL_NAME_print(biobuf, name); + len = BIO_gets(biobuf, buf, sizeof(buf)-1); +@@ -794,6 +847,7 @@ static PyObject * + goto fail; + } + PyTuple_SET_ITEM(t, 1, v); ++ break; + } + + /* and add that rendering to the list */ + diff --git a/python2/python-2.7.5-msys2.patch b/python2/python-2.7.5-msys2.patch new file mode 100644 index 00000000..f4f11c86 --- /dev/null +++ b/python2/python-2.7.5-msys2.patch @@ -0,0 +1,1489 @@ +diff -urN a/config.guess b/config.guess +--- a/config.guess 2013-10-20 19:38:14.026107000 +0100 ++++ b/config.guess 2013-10-20 19:38:53.250350500 +0100 +@@ -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 -urN a/configure b/configure +--- a/configure 2013-10-20 19:38:14.028107200 +0100 ++++ b/configure 2013-10-20 19:38:53.321354600 +0100 +@@ -3174,6 +3174,9 @@ + *-*-cygwin*) + ac_sys_system=Cygwin + ;; ++ *-*-msys*) ++ ac_sys_system=Msys ++ ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" +@@ -3198,6 +3201,7 @@ + case $MACHDEP in + linux*) MACHDEP="linux2";; + cygwin*) MACHDEP="cygwin";; ++ msys*) MACHDEP="msys";; + darwin*) MACHDEP="darwin";; + atheos*) MACHDEP="atheos";; + irix646) MACHDEP="irix6";; +@@ -3217,7 +3221,7 @@ + _host_cpu=$host_cpu + esac + ;; +- *-*-cygwin*) ++ *-*-cygwin*|*-*-msys*) + _host_cpu= + ;; + *) +@@ -5263,7 +5267,7 @@ + if test -z "$enable_shared" + then + case $ac_sys_system in +- CYGWIN* | atheos*) ++ CYGWIN* | atheos* | MSYS*) + enable_shared="yes";; + *) + enable_shared="no";; +@@ -5336,6 +5340,10 @@ + LDLIBRARY='libpython$(VERSION).dll.a' + DLLLIBRARY='libpython$(VERSION).dll' + ;; ++ MSYS*) ++ LDLIBRARY='libpython$(VERSION).dll.a' ++ DLLLIBRARY='msys-python$(VERSION).dll' ++ ;; + SunOS*) + LDLIBRARY='libpython$(VERSION).so' + BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)' +@@ -5388,7 +5396,7 @@ + esac + else # shared is disabled + case $ac_sys_system in +- CYGWIN*) ++ CYGWIN* | MSYS*) + BLDLIBRARY='$(LIBRARY)' + LDLIBRARY='libpython$(VERSION).dll.a' + ;; +@@ -5865,6 +5873,7 @@ + case $ac_sys_system in + BeOS*) LN="ln -s";; + CYGWIN*) LN="ln -s";; ++ MSYS*) LN="cp -pR";; + atheos*) LN="ln -s";; + *) LN=ln;; + esac +@@ -8133,7 +8142,7 @@ + *) SO=.sl;; + esac + ;; +- CYGWIN*) SO=.dll;; ++ CYGWIN* | MSYS*) SO=.dll;; + *) SO=.so;; + esac + else +@@ -8290,7 +8299,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";; + atheos*) +@@ -8386,7 +8395,7 @@ + LINKFORSHARED="-Xlinker --export-dynamic" + fi;; + esac;; +- CYGWIN*) ++ CYGWIN* | MSYS*) + if test $enable_shared = "no" + then + LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)' +@@ -8410,7 +8419,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='';; +@@ -9621,7 +9630,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 -urN a/configure.ac b/configure.ac +--- a/configure.ac 2013-10-20 19:38:14.057108800 +0100 ++++ b/configure.ac 2013-10-20 19:38:53.356356600 +0100 +@@ -318,6 +318,9 @@ + *-*-cygwin*) + ac_sys_system=Cygwin + ;; ++ *-*-msys*) ++ ac_sys_system=Msys ++ ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" +@@ -342,6 +345,7 @@ + case $MACHDEP in + linux*) MACHDEP="linux2";; + cygwin*) MACHDEP="cygwin";; ++ msys*) MACHDEP="msys";; + darwin*) MACHDEP="darwin";; + atheos*) MACHDEP="atheos";; + irix646) MACHDEP="irix6";; +@@ -361,7 +365,7 @@ + _host_cpu=$host_cpu + esac + ;; +- *-*-cygwin*) ++ *-*-cygwin*|*-*-msys*) + _host_cpu= + ;; + *) +@@ -820,7 +824,7 @@ + if test -z "$enable_shared" + then + case $ac_sys_system in +- CYGWIN* | atheos*) ++ CYGWIN* | atheos* | MSYS*) + enable_shared="yes";; + *) + enable_shared="no";; +@@ -876,6 +880,10 @@ + LDLIBRARY='libpython$(VERSION).dll.a' + DLLLIBRARY='libpython$(VERSION).dll' + ;; ++ MSYS*) ++ LDLIBRARY='libpython$(VERSION).dll.a' ++ DLLLIBRARY='msys-python$(VERSION).dll' ++ ;; + SunOS*) + LDLIBRARY='libpython$(VERSION).so' + BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)' +@@ -928,7 +936,7 @@ + esac + else # shared is disabled + case $ac_sys_system in +- CYGWIN*) ++ CYGWIN* | MSYS*) + BLDLIBRARY='$(LIBRARY)' + LDLIBRARY='libpython$(VERSION).dll.a' + ;; +@@ -1007,6 +1015,7 @@ + case $ac_sys_system in + BeOS*) LN="ln -s";; + CYGWIN*) LN="ln -s";; ++ MSYS*) LN="cp -pR";; + atheos*) LN="ln -s";; + *) LN=ln;; + esac +@@ -1917,7 +1926,7 @@ + *) SO=.sl;; + esac + ;; +- CYGWIN*) SO=.dll;; ++ CYGWIN* | MSYS*) SO=.dll;; + *) SO=.so;; + esac + else +@@ -2068,7 +2077,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";; + atheos*) +@@ -2160,7 +2169,7 @@ + LINKFORSHARED="-Xlinker --export-dynamic" + fi;; + esac;; +- CYGWIN*) ++ CYGWIN* | MSYS*) + if test $enable_shared = "no" + then + LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)' +@@ -2182,7 +2191,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='';; +@@ -2564,7 +2573,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.]) + ;; +diff -urN a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py +--- a/Lib/ctypes/__init__.py 2013-10-20 19:38:17.309294800 +0100 ++++ b/Lib/ctypes/__init__.py 2013-10-20 19:38:53.393358700 +0100 +@@ -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,8 +435,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]) ++elif _sys.platform in ['cygwin', 'msys']: ++ pythonapi = PyDLL(_sysconfig.get_config_var('DLLLIBRARY')) + else: + pythonapi = PyDLL(None) + +diff -urN a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py +--- a/Lib/ctypes/test/test_loading.py 2013-10-20 19:38:17.127284400 +0100 ++++ b/Lib/ctypes/test/test_loading.py 2013-10-20 19:39:02.914903300 +0100 +@@ -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 -urN a/Lib/ctypes/util.py b/Lib/ctypes/util.py +--- a/Lib/ctypes/util.py 2013-10-20 19:38:17.305294600 +0100 ++++ b/Lib/ctypes/util.py 2013-10-20 19:39:02.922903800 +0100 +@@ -84,7 +84,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]: +@@ -284,7 +284,11 @@ + elif sys.platform == "cygwin": + print cdll.LoadLibrary("cygbz2-1.dll") + print find_library("crypt") +- print cdll.LoadLibrary("cygcrypt-0.dll") ++ 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 -urN a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py +--- a/Lib/distutils/ccompiler.py 2013-10-20 19:38:17.357297600 +0100 ++++ b/Lib/distutils/ccompiler.py 2013-10-20 19:39:02.941904900 +0100 +@@ -895,6 +895,7 @@ + # on a cygwin built python we can use gcc like an ordinary UNIXish + # compiler + ('cygwin.*', 'unix'), ++ ('msys.*', 'unix'), + ('os2emx', 'emx'), + + # OS name mappings +@@ -934,6 +935,8 @@ + "Microsoft Visual C++"), + 'cygwin': ('cygwinccompiler', 'CygwinCCompiler', + "Cygwin port of GNU C Compiler for Win32"), ++ 'msys': ('cygwinccompiler', 'CygwinCCompiler', ++ "MSYS port of GNU C Compiler for Win32"), + 'mingw32': ('cygwinccompiler', 'Mingw32CCompiler', + "Mingw32 port of GNU C Compiler for Win32"), + 'bcpp': ('bcppcompiler', 'BCPPCompiler', +diff -urN a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py +--- a/Lib/distutils/command/build_ext.py 2013-10-20 19:38:17.407300400 +0100 ++++ b/Lib/distutils/command/build_ext.py 2013-10-20 19:39:02.949905300 +0100 +@@ -221,7 +221,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", +@@ -725,7 +725,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" + pythonlib = (template % + (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff)) +diff -urN a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py +--- a/Lib/distutils/tests/support.py 2013-10-20 19:38:17.654314600 +0100 ++++ b/Lib/distutils/tests/support.py 2013-10-20 19:39:02.955905700 +0100 +@@ -73,7 +73,7 @@ + super(TempdirManager, 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): + """Create a temporary directory that will be cleaned up. +diff -urN a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py +--- a/Lib/distutils/unixccompiler.py 2013-10-20 19:38:17.770321200 +0100 ++++ b/Lib/distutils/unixccompiler.py 2013-10-20 19:39:02.960906000 +0100 +@@ -80,7 +80,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" + +diff -urN a/Lib/distutils/util.py b/Lib/distutils/util.py +--- a/Lib/distutils/util.py 2013-10-20 19:38:17.771321300 +0100 ++++ b/Lib/distutils/util.py 2013-10-20 19:39:02.969906500 +0100 +@@ -96,6 +96,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, distutils.sysconfig + osname, release, machine = _osx_support.get_platform_osx( +diff -urN a/Lib/lib-tk/test/test_tkinter/test_loadtk.py b/Lib/lib-tk/test/test_tkinter/test_loadtk.py +--- a/Lib/lib-tk/test/test_tkinter/test_loadtk.py 2013-10-20 19:38:19.047394200 +0100 ++++ b/Lib/lib-tk/test/test_tkinter/test_loadtk.py 2013-10-20 19:39:02.976906900 +0100 +@@ -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 -urN a/Lib/sysconfig.py b/Lib/sysconfig.py +--- a/Lib/sysconfig.py 2013-10-20 19:38:20.145457100 +0100 ++++ b/Lib/sysconfig.py 2013-10-20 19:39:02.987907500 +0100 +@@ -598,6 +598,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 -urN a/Lib/tempfile.py b/Lib/tempfile.py +--- a/Lib/tempfile.py 2013-10-20 19:38:20.147457200 +0100 ++++ b/Lib/tempfile.py 2013-10-20 19:39:03.003908400 +0100 +@@ -459,7 +459,7 @@ + file = _os.fdopen(fd, mode, bufsize) + 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 -urN a/Lib/test/regrtest.py b/Lib/test/regrtest.py +--- a/Lib/test/regrtest.py 2013-10-20 19:38:20.303466100 +0100 ++++ b/Lib/test/regrtest.py 2013-10-20 19:39:03.008908700 +0100 +@@ -1357,6 +1357,20 @@ + test_ossaudiodev + test_socketserver + """, ++ 'msys': ++ """ ++ test_bsddb185 ++ test_bsddb3 ++ test_curses ++ test_dbm ++ test_epoll ++ test_ioctl ++ test_kqueue ++ test_largefile ++ test_locale ++ test_ossaudiodev ++ test_socketserver ++ """, + 'os2emx': + """ + test_audioop +diff -urN a/Lib/test/test_curses.py b/Lib/test/test_curses.py +--- a/Lib/test/test_curses.py 2013-10-20 19:38:20.351468800 +0100 ++++ b/Lib/test/test_curses.py 2013-10-20 19:39:03.010908800 +0100 +@@ -27,7 +27,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 -urN a/Lib/test/test_dl.py b/Lib/test/test_dl.py +--- a/Lib/test/test_dl.py 2013-10-20 19:38:20.358469200 +0100 ++++ b/Lib/test/test_dl.py 2013-10-20 19:39:03.015909100 +0100 +@@ -10,6 +10,7 @@ + ('/usr/lib/libc.so', 'getpid'), + ('/lib/libc.so.6', 'getpid'), + ('/usr/bin/cygwin1.dll', 'getpid'), ++ ('/usr/bin/msys-2.0.dll', 'getpid'), + ('/usr/lib/libc.dylib', 'getpid'), + ] + +diff -urN a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py +--- a/Lib/test/test_mailbox.py 2013-10-20 19:38:20.402471800 +0100 ++++ b/Lib/test/test_mailbox.py 2013-10-20 19:39:03.018909300 +0100 +@@ -501,7 +501,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 test_add_MM(self): +diff -urN a/Lib/test/test_netrc.py b/Lib/test/test_netrc.py +--- a/Lib/test/test_netrc.py 2013-10-20 19:38:20.411472300 +0100 ++++ b/Lib/test/test_netrc.py 2013-10-20 19:39:03.023909600 +0100 +@@ -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 -urN a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py +--- a/Lib/test/test_shutil.py 2013-10-20 19:38:20.442474000 +0100 ++++ b/Lib/test/test_shutil.py 2013-10-20 19:39:03.026909700 +0100 +@@ -49,7 +49,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 write_file(self, path, content='xxx'): + """Writes a file in the given path. +@@ -80,7 +80,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 -urN a/Modules/_ctypes/libffi/acinclude.m4 b/Modules/_ctypes/libffi/acinclude.m4 +--- a/Modules/_ctypes/libffi/acinclude.m4 2013-10-20 19:38:20.797494300 +0100 ++++ b/Modules/_ctypes/libffi/acinclude.m4 2013-10-20 19:39:03.030910000 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/aclocal.m4 b/Modules/_ctypes/libffi/aclocal.m4 +--- a/Modules/_ctypes/libffi/aclocal.m4 2013-10-20 19:38:20.798494400 +0100 ++++ b/Modules/_ctypes/libffi/aclocal.m4 2013-10-20 19:39:03.033910100 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/config.guess b/Modules/_ctypes/libffi/config.guess +--- a/Modules/_ctypes/libffi/config.guess 2013-10-20 19:38:20.801494600 +0100 ++++ b/Modules/_ctypes/libffi/config.guess 2013-10-20 19:39:03.037910400 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure +--- a/Modules/_ctypes/libffi/configure 2013-10-20 19:38:20.802494600 +0100 ++++ b/Modules/_ctypes/libffi/configure 2013-10-20 19:39:03.051911200 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/configure.ac b/Modules/_ctypes/libffi/configure.ac +--- a/Modules/_ctypes/libffi/configure.ac 2013-10-20 19:38:20.803494700 +0100 ++++ b/Modules/_ctypes/libffi/configure.ac 2013-10-20 19:39:03.067912100 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/ltmain.sh b/Modules/_ctypes/libffi/ltmain.sh +--- a/Modules/_ctypes/libffi/ltmain.sh 2013-10-20 19:38:20.813495300 +0100 ++++ b/Modules/_ctypes/libffi/ltmain.sh 2013-10-20 19:39:03.075912500 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/m4/libtool.m4 b/Modules/_ctypes/libffi/m4/libtool.m4 +--- a/Modules/_ctypes/libffi/m4/libtool.m4 2013-10-20 19:38:20.821495700 +0100 ++++ b/Modules/_ctypes/libffi/m4/libtool.m4 2013-10-20 19:39:03.089913300 +0100 +@@ -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}' +@@ -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 +@@ -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 -urN a/Modules/_ctypes/libffi/m4/ltoptions.m4 b/Modules/_ctypes/libffi/m4/ltoptions.m4 +--- a/Modules/_ctypes/libffi/m4/ltoptions.m4 2013-10-20 19:38:20.821495700 +0100 ++++ b/Modules/_ctypes/libffi/m4/ltoptions.m4 2013-10-20 19:39:03.149916800 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp b/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp +--- a/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp 2013-10-20 19:38:20.877498900 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/lib/target-libpath.exp 2013-10-20 19:39:03.179918500 +0100 +@@ -175,7 +175,7 @@ + } else { + setenv DYLD_LIBRARY_PATH "$ld_library_path" + } +- if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } { ++ if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] || [istarget *-*-msys*] } { + 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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c 2013-10-20 19:38:20.885499400 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c 2013-10-20 19:39:03.223921000 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c 2013-10-20 19:38:20.886499400 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c 2013-10-20 19:39:03.256922900 +0100 +@@ -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-*-mingw* i?86-*-msys* } } */ + #include "ffitest.h" + + static void +diff -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c 2013-10-20 19:38:20.905500500 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split.c 2013-10-20 19:39:03.299925300 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c 2013-10-20 19:38:20.905500500 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c 2013-10-20 19:39:03.328927000 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c 2013-10-20 19:38:20.911500900 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble.c 2013-10-20 19:39:03.357928700 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c 2013-10-20 19:38:20.926501700 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c 2013-10-20 19:39:03.383930200 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c 2013-10-20 19:38:20.927501800 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c 2013-10-20 19:39:03.432933000 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c 2013-10-20 19:38:20.927501800 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c 2013-10-20 19:39:03.476935500 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c b/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c 2013-10-20 19:38:20.929501900 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/float2.c 2013-10-20 19:39:03.505937100 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c b/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c 2013-10-20 19:38:20.933502100 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/huge_struct.c 2013-10-20 19:39:03.539939100 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c 2013-10-20 19:38:20.935502200 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c 2013-10-20 19:39:03.569940800 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c 2013-10-20 19:38:20.944502800 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/return_ldl.c 2013-10-20 19:39:03.580941400 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c 2013-10-20 19:38:20.950503100 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c 2013-10-20 19:39:03.626944000 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c 2013-10-20 19:38:20.949503000 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c 2013-10-20 19:39:03.649945400 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c 2013-10-20 19:38:20.951503200 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c 2013-10-20 19:39:03.674946800 +0100 +@@ -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 -urN a/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c b/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c 2013-10-20 19:38:20.951503200 +0100 ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c 2013-10-20 19:39:03.705948600 +0100 +@@ -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 -urN a/Modules/makesetup b/Modules/makesetup +--- a/Modules/makesetup 2013-10-20 19:38:20.741491100 +0100 ++++ b/Modules/makesetup 2013-10-20 19:39:03.736950300 +0100 +@@ -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 -urN a/Modules/zlib/configure b/Modules/zlib/configure +--- a/Modules/zlib/configure 2013-10-20 19:38:20.776493100 +0100 ++++ b/Modules/zlib/configure 2013-10-20 19:39:03.802954100 +0100 +@@ -77,7 +77,7 @@ + CFLAGS="$cflags" + case `(uname -s || echo unknown) 2>/dev/null` in + Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};; +- CYGWIN* | Cygwin* | cygwin* | OS/2* ) ++ CYGWIN* | Cygwin* | cygwin* | OS/2* | MSYS* | Msys* ) + EXE='.exe';; + QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 + # (alain.bonnefoy@icbt.com) +diff -urN a/setup.py b/setup.py +--- a/setup.py 2013-10-20 19:38:22.086568100 +0100 ++++ b/setup.py 2013-10-20 19:39:03.831955800 +0100 +@@ -314,7 +314,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 +@@ -549,7 +549,7 @@ + + # Check for MacOS X, which doesn't need libm.a at all + math_libs = ['m'] +- if host_platform in ['darwin', 'beos', 'cygwin']: ++ if host_platform in ['darwin', 'beos', 'cygwin', 'msys']: + math_libs = [] + + # XXX Omitted modules: gl, pure, dl, SGI-specific modules +@@ -1331,7 +1331,7 @@ + missing.append('resource') + + # Sun yellow pages. Some systems have the functions in libc. +- if (host_platform not in ['cygwin', 'atheos', 'qnx6'] and ++ if (host_platform not in ['cygwin', 'msys', 'atheos', 'qnx6'] and + find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): + if (self.compiler.find_library_file(lib_dirs, 'nsl')): + libs = ['nsl'] +@@ -1546,7 +1546,7 @@ + macros = dict() + libraries = [] + +- elif host_platform == 'cygwin': # Cygwin ++ elif host_platform in ['cygwin', 'msys']: # Cygwin + macros = dict() + libraries = [] + diff --git a/python2/uuid.patch b/python2/uuid.patch new file mode 100644 index 00000000..f05f2851 --- /dev/null +++ b/python2/uuid.patch @@ -0,0 +1,12 @@ +diff -urN a/Lib/uuid.py b/Lib/uuid.py +--- a/Lib/uuid.py 2013-10-20 19:40:07.732610700 +0100 ++++ b/Lib/uuid.py 2013-10-20 19:40:39.586432600 +0100 +@@ -408,6 +408,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