]> git.99rst.org Git - openwrt-packages.git/commitdiff
python-cffi: bump to 2.1.1
authorAlexandru Ardelean <redacted>
Sun, 9 Aug 2026 09:31:53 +0000 (12:31 +0300)
committerAlexandru Ardelean <redacted>
Tue, 11 Aug 2026 10:45:28 +0000 (13:45 +0300)
Refresh sha256 from PyPI sdist. Drop the macOS cross-compile patch;
2.1.1 already carries the sysconfig.get_platform() fix upstream.

Add test-version.sh: 2.1.1 ships the cffi-gen-src console tool, a
subcommand CLI with no version flag, so the generic per-executable
version probe fails the package ("No executables in the package
provided version"). test-version.sh skips that probe, and test.sh now
asserts cffi.__version__ against the packaged version.

Signed-off-by: Alexandru Ardelean <redacted>
lang/python/python-cffi/Makefile
lang/python/python-cffi/patches/001-fix-cross-compilation-on-macos-hosts.patch [deleted file]
lang/python/python-cffi/test-version.sh [new file with mode: 0755]
lang/python/python-cffi/test.sh [changed mode: 0644->0755]

index b6d26b5d9889b4e56c42dec82c1ec4e04e134f72..f41349e609c029c75c492ee4beedb9ef627efb43 100644 (file)
@@ -8,11 +8,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-cffi
-PKG_VERSION:=2.0.0
-PKG_RELEASE:=2
+PKG_VERSION:=2.1.1
+PKG_RELEASE:=1
 
 PYPI_NAME:=cffi
-PKG_HASH:=44d1b5909021139fe36001ae048dbdde8214afa20200eda0f64c068cac5d5529
+PKG_HASH:=dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE
diff --git a/lang/python/python-cffi/patches/001-fix-cross-compilation-on-macos-hosts.patch b/lang/python/python-cffi/patches/001-fix-cross-compilation-on-macos-hosts.patch
deleted file mode 100644 (file)
index 32fb448..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-From 7a3b39e2fbbaa0511789a3231964f61f77fb28a9 Mon Sep 17 00:00:00 2001
-From: Josef Schlehofer <pepe.schlehofer@gmail.com>
-Date: Tue, 9 Jun 2026 04:33:35 +0000
-Subject: [PATCH] setup.py: fix cross-compilation on macOS hosts
-
-When cross-compiling for a non-macOS target (such as Linux) on a macOS host,
-setup.py incorrectly detects the host platform as 'darwin' using sys.platform.
-This adds the macOS-specific flag -iwithsysroot/usr/include/ffi to the compiler
-arguments, which causes the cross-compiler to fail with:
-
-  powerpc-openwrt-linux-musl-gcc: error: unrecognized command-line option
-  '-iwithsysroot/usr/include/ffi'
-
-By using sysconfig.get_platform().startswith('macosx') instead of 'darwin' in
-sys.platform, we correctly check the target platform rather than the build host.
-sysconfig.get_platform() honours _PYTHON_HOST_PLATFORM, which
-python3-package.mk already exports.
-
-Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
----
---- a/setup.py
-+++ b/setup.py
-@@ -154,7 +154,7 @@ else:
-     ask_supports_thread()
-     ask_supports_sync_synchronize()
--if 'darwin' in sys.platform:
-+if sysconfig.get_platform().startswith('macosx'):
-     # priority is given to `pkg_config`, but always fall back on SDK's libffi.
-     extra_compile_args += ['-iwithsysroot/usr/include/ffi']
diff --git a/lang/python/python-cffi/test-version.sh b/lang/python/python-cffi/test-version.sh
new file mode 100755 (executable)
index 0000000..05042b5
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# shellcheck shell=busybox
+
+# cffi 2.x ships the cffi-gen-src console tool, a subcommand CLI with no version
+# flag, so the generic per-executable version check cannot read the version from
+# it. The version is asserted by the import check in test.sh instead.
+case "$PKG_NAME" in
+python3-cffi | python3-cffi-src)
+       exit 0
+       ;;
+*)
+       echo "Untested package: $PKG_NAME" >&2
+       exit 1
+       ;;
+esac
old mode 100644 (file)
new mode 100755 (executable)
index 48ea3ad..63aea59
@@ -2,7 +2,13 @@
 
 [ "$1" = python3-cffi ] || exit 0
 
-python3 - << EOF
+# cffi's cffi-gen-src CLI has no version flag, so assert the version here and
+# build an FFI object to exercise the compiled C extension.
+python3 - "$2" << 'EOF'
+import sys
+import cffi
 from cffi import FFI
+
+assert cffi.__version__ == sys.argv[1], (cffi.__version__, sys.argv[1])
 ffibuilder = FFI()
 EOF
git clone https://git.99rst.org/PROJECT