Skip to content

Commit

Permalink
python-cffi: update to 1.17.1
Browse files Browse the repository at this point in the history
  • Loading branch information
podsvirov committed Oct 13, 2024
1 parent fa7ab00 commit 052b008
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
13 changes: 9 additions & 4 deletions mingw-w64-python-cffi/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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() {
Expand Down
22 changes: 22 additions & 0 deletions mingw-w64-python-cffi/pyunicode_aswidechar-arg-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 3af3a6955414f20dc711991468cbf5dc232908fc Mon Sep 17 00:00:00 2001
From: Armin Rigo <[email protected]>
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;

0 comments on commit 052b008

Please sign in to comment.