diff --git a/mingw-w64-python-cffi/PKGBUILD b/mingw-w64-python-cffi/PKGBUILD index 20379e84e5517..520b31ef40157 100644 --- a/mingw-w64-python-cffi/PKGBUILD +++ b/mingw-w64-python-cffi/PKGBUILD @@ -6,10 +6,11 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") -pkgver=1.16.0 +pkgver=1.17.1 pkgrel=1 pkgdesc="Foreign Function Interface for Python calling C code (mingw-w64)" url='https://cffi.readthedocs.io/' +msys2_repository_url='https://github.com/python-cffi/cffi' license=('MIT') arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') @@ -21,15 +22,19 @@ depends=("${MINGW_PACKAGE_PREFIX}-libffi" makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools" "${MINGW_PACKAGE_PREFIX}-cc") checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest-runner") source=("https://pypi.org/packages/source/${_realname:0:1}/${_realname}/${_realname}-${pkgver}.tar.gz" - "mingw-non-x86.patch") -sha256sums=('bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0' - 'c8a8ea2d65932ea0b62eae56dbc8afd6baacaadc7cb284ca0e4edf7ed1460c52') + 'mingw-non-x86.patch' + 'pyunicode_aswidechar-arg-fix.patch') +sha256sums=('1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824' + 'c8a8ea2d65932ea0b62eae56dbc8afd6baacaadc7cb284ca0e4edf7ed1460c52' + '5a091f36037700c85e9f92acdf723cb929b0a5bcd324d96fa999bb5f865d11bf') prepare() { cd "${srcdir}" cp -r "${_realname}-${pkgver}" "python-build-${CARCH}" cd "python-build-${CARCH}" patch -Np1 -i "${srcdir}"/mingw-non-x86.patch + # https://github.com/python-cffi/cffi/pull/91 + patch -Np1 -i "${srcdir}"/pyunicode_aswidechar-arg-fix.patch } build() { diff --git a/mingw-w64-python-cffi/pyunicode_aswidechar-arg-fix.patch b/mingw-w64-python-cffi/pyunicode_aswidechar-arg-fix.patch new file mode 100644 index 0000000000000..4cb5cc3d76c0c --- /dev/null +++ b/mingw-w64-python-cffi/pyunicode_aswidechar-arg-fix.patch @@ -0,0 +1,22 @@ +From 3af3a6955414f20dc711991468cbf5dc232908fc Mon Sep 17 00:00:00 2001 +From: Armin Rigo +Date: Wed, 26 Jun 2024 18:10:49 +0200 +Subject: [PATCH] PyUnicode_AsWideChar takes a 'PyObject *' argument + +--- + src/c/_cffi_backend.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/c/_cffi_backend.c b/src/c/_cffi_backend.c +index 602117e3..7b288ef2 100644 +--- a/src/c/_cffi_backend.c ++++ b/src/c/_cffi_backend.c +@@ -4565,7 +4565,7 @@ static void *b_do_dlopen(PyObject *args, const char **p_printable_filename, + sz1 = PyText_GetSize(filename_unicode) + 1; + sz1 *= 2; /* should not be needed, but you never know */ + w1 = alloca(sizeof(wchar_t) * sz1); +- sz1 = PyUnicode_AsWideChar((PyUnicodeObject *)filename_unicode, ++ sz1 = PyUnicode_AsWideChar(filename_unicode, + w1, sz1 - 1); + if (sz1 < 0) + return NULL;