[packages/sip6] - added upstream fix for PyQt5 build

hawk hawk at pld-linux.org
Tue Nov 3 11:29:15 CET 2026


commit 39784c4b3683e84e98502e0c97c275f100ca0509
Author: Marcin Krol <hawk at tld-linux.org>
Date:   Tue Nov 3 11:28:45 2026 +0100

    - added upstream fix for PyQt5 build

 PyQt5.patch | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 sip6.spec   |  2 ++
 2 files changed, 55 insertions(+)
---
diff --git a/sip6.spec b/sip6.spec
index 8615669..e6b685a 100644
--- a/sip6.spec
+++ b/sip6.spec
@@ -11,6 +11,7 @@ License:	GPL v2
 #Source0Download: https://pypi.org/project/sip/
 Source0:	https://files.pythonhosted.org/packages/source/s/sip/sip-%{version}.tar.gz
 # Source0-md5:	3934e640561d3e9f48f9258ea9d89def
+Patch0:		PyQt5.patch
 URL:		https://www.riverbankcomputing.com/software/sip
 BuildRequires:	python3-build
 BuildRequires:	python3-devel >= 1:3.10
@@ -49,6 +50,7 @@ generowania wxPythona - wiązań Pythona do wxWidgets.
 
 %prep
 %setup -q -n sip-%{version}
+%patch -P1 -p1
 
 %build
 %py3_build_pyproject
diff --git a/PyQt5.patch b/PyQt5.patch
new file mode 100644
index 0000000..973ada7
--- /dev/null
+++ b/PyQt5.patch
@@ -0,0 +1,53 @@
+From 8c451945db664385d20e006a35cc56019743b7d7 Mon Sep 17 00:00:00 2001
+From: Bad3r <github at unsigned.sh>
+Date: Thu, 3 Sep 2026 14:27:44 +0300
+Subject: [PATCH] python3Packages.sip: fix legacy ABI bindings without
+ %MinimumABIVersion
+
+sip 6.16.1 (nixpkgs commit 20d260705e61, PR #558075) makes sipbuild's _finalise_abi_version reject any project that
+passes an explicit abi-version for ABI 12 or 13 unless the module's .sip files declare %MinimumABIVersion, a directive
+that only exists since 6.16. PyQt5 5.15.10 passes abi_version '12.13' from project.py and declares nothing, so
+python3Packages.pyqt5 fails in the generator with:
+
+    _in_process.py: ABI v12 is being targeted but the PyQt5.QtCore module doesn't support it
+
+Apply the upstream fix, Python-SIP/sip commit 09598895 (resolves Python-SIP/sip#114), which skips the check for
+ABI <= 13 when no minimum is declared. No sip release contains it yet; drop this patch once one does. Tracked in
+NixOS/nixpkgs#559458.
+
+Validation: nix build -f . python3Packages.sip (patch applies to sipbuild/generator/parser/parser_manager.py);
+nix build -f . python3Packages.pyqt5 gets past "Generating the QtCore bindings" and through the following modules
+(cancelled before the C++ compile stage).
+---
+ pkgs/development/python-modules/sip/default.nix | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/pkgs/development/python-modules/sip/default.nix b/pkgs/development/python-modules/sip/default.nix
+index 5e3fb1bcab78c..8fa287810ccf0 100644
+--- a/pkgs/development/python-modules/sip/default.nix
++++ b/pkgs/development/python-modules/sip/default.nix
+@@ -2,6 +2,7 @@
+   lib,
+   buildPythonPackage,
+   fetchPypi,
++  fetchpatch,
+   setuptools,
+   setuptools-scm,
+   packaging,
+@@ -22,6 +23,16 @@ buildPythonPackage (finalAttrs: {
+     hash = "sha256-CnOcnNKSneTgiERW2Mrzz7IsEFNHV8d5e9jca9ntabw=";
+   };
+ 
++  patches = [
++    # 6.16.1 rejects bindings that target ABI 12/13 without declaring
++    # %MinimumABIVersion, which breaks pyqt5. Fixed upstream after 6.16.1.
++    (fetchpatch {
++      name = "sip-allow-legacy-abi-without-minimum-abi-version.patch";
++      url = "https://github.com/Python-SIP/sip/commit/09598895c607f3e41f0249ade217ace0a4da6437.patch";
++      hash = "sha256-v0YeHyg0ymB0v32gpVRbMBIUk9U2etjs93VuOGPGg2M=";
++    })
++  ];
++
+   build-system = [
+     setuptools
+     setuptools-scm
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/sip6.git/commitdiff/39784c4b3683e84e98502e0c97c275f100ca0509



More information about the pld-cvs-commit mailing list