diff --git a/mingw-w64-python3/1900-ctypes-dont-depend-on-internal-libffi.patch b/mingw-w64-python3/1900-ctypes-dont-depend-on-internal-libffi.patch new file mode 100644 index 0000000000000..e4c3fa16a516f --- /dev/null +++ b/mingw-w64-python3/1900-ctypes-dont-depend-on-internal-libffi.patch @@ -0,0 +1,23 @@ +See https://github.com/python/cpython/pull/9258 +--- Python-3.7.1/Modules/_ctypes/callproc.c.orig 2018-10-20 08:04:19.000000000 +0200 ++++ Python-3.7.1/Modules/_ctypes/callproc.c 2018-10-21 20:15:23.737316400 +0200 +@@ -701,6 +701,19 @@ + } + } + ++/* ++Per: https://msdn.microsoft.com/en-us/library/7572ztz4.aspx ++To be returned by value in RAX, user-defined types must have a length ++of 1, 2, 4, 8, 16, 32, or 64 bits ++*/ ++static int can_return_struct_as_int(size_t s) ++{ ++ return s == 1 || s == 2 || s == 4; ++} ++static int can_return_struct_as_sint64(size_t s) ++{ ++ return s == 8; ++} + + ffi_type *_ctypes_get_ffi_type(PyObject *obj) + { diff --git a/mingw-w64-python3/PKGBUILD b/mingw-w64-python3/PKGBUILD index b544eae8cb254..2367a4fe74bfa 100644 --- a/mingw-w64-python3/PKGBUILD +++ b/mingw-w64-python3/PKGBUILD @@ -18,7 +18,7 @@ pkgbase="mingw-w64-${_realname}" pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" _pybasever=3.7 pkgver=${_pybasever}.1 -pkgrel=1 +pkgrel=2 pkgdesc="A high-level scripting language (mingw-w64)" arch=('any') license=('PSF') @@ -125,6 +125,7 @@ source=("https://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz 1850-disable-readline.patch 1860-fix-isselectable.patch 2000-warnings-fixes.patch + 1900-ctypes-dont-depend-on-internal-libffi.patch smoketests.py) # Helper macros to help make tasks easier # @@ -281,6 +282,9 @@ prepare() { apply_patch_with_msg 2000-warnings-fixes.patch + # https://github.com/python/cpython/pull/9258 + apply_patch_with_msg 1900-ctypes-dont-depend-on-internal-libffi.patch + autoreconf -vfi # Temporary workaround for FS#22322 @@ -525,4 +529,5 @@ sha256sums=('fa7e2b8e8c9402f192ad56dc4f814089d1c4466c97d780f5e5acc02c04243d6d' '3262ce24714dc6cfea5b18d528d7f1a333128eadf5aa9c3a026131c34f082e1f' 'bd9b934e8c1f92573115efaef6b6b04966e3222ba769511e006366d1217d34d6' 'e91f897e43063e0c4e52d971f5de4b5e193d9eb6a35fc3acfca1dc057a2fcd65' + '82ed4056649149cdfd7d76693864b07857b87ba36f628af321ee7d8ede8ed1a9' 'ea41f389324bf56277ef27a02f3510d22e5c88becbdb465468bdad9c15e0d229')