From b65dfc3161077ba476c9db3a13629d7fc055eda5 Mon Sep 17 00:00:00 2001 From: Mitchell Pleune Date: Tue, 16 Jul 2024 13:09:15 -0400 Subject: [PATCH] Update pyside2/shiboken2 and sip4 to Python 3.12 These are both Python QT 5 modules, which have issues with Python 3.12 that are fixed in never versions, yet many packages depend on them. Sip4 was as simple as installing and switching over to setuptools (to replace the now removed distutils). pyside/shiboken was much more involved. I ended up pulling the required patches from the Ubuntu release repositories. The existing patch to fix clang's include headers needed an update as well, but was still required. There is some unsightly find-and-replace going on to replace distutils with setuptools. This is because, although setuptools now creates the "distutils" import module, it has to be itself imported first before that can happen. I Used this widespread find-and-replace as it does function properly, and should be extremly flexable for future versions (no needing to update patches on each release). --- ...s-to-enable-3.12-wheel-compatibility.patch | 28 ++ .../Modify-sendCommand-signatures.patch | 41 +++ ...-Fix-the-structure-of-class-property.patch | 37 +++ ...upport-running-PySide-on-Python-3.12.patch | 298 ++++++++++++++++++ .../python-modules/pyside2/default.nix | 47 ++- .../pyside2/nix_compile_cflags.patch | 23 ++ ...-Fix-and-simplify-resolveType-helper.patch | 88 ++++++ ...boken2-clang-Fix-build-with-clang-16.patch | 108 +++++++ ...lashes-between-type-name-and-enumera.patch | 92 ++++++ ...d-scope-resolution-of-arguments-func.patch | 178 +++++++++++ ...oken2-clang-Remove-typedef-expansion.patch | 101 ++++++ ...ess-class-scope-look-up-for-paramete.patch | 96 ++++++ ...-scope-resolution-for-all-parameters.patch | 62 ++++ .../python-modules/shiboken2/default.nix | 39 ++- .../shiboken2/nix_compile_cflags.patch | 30 -- pkgs/development/python-modules/sip/4.x.nix | 19 +- 16 files changed, 1238 insertions(+), 49 deletions(-) create mode 100644 pkgs/development/python-modules/pyside2/Final-details-to-enable-3.12-wheel-compatibility.patch create mode 100644 pkgs/development/python-modules/pyside2/Modify-sendCommand-signatures.patch create mode 100644 pkgs/development/python-modules/pyside2/Python-3.12-Fix-the-structure-of-class-property.patch create mode 100644 pkgs/development/python-modules/pyside2/Support-running-PySide-on-Python-3.12.patch create mode 100644 pkgs/development/python-modules/pyside2/nix_compile_cflags.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Fix-and-simplify-resolveType-helper.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Fix-build-with-clang-16.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Fix-clashes-between-type-name-and-enumera.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Record-scope-resolution-of-arguments-func.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Remove-typedef-expansion.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Suppress-class-scope-look-up-for-paramete.patch create mode 100644 pkgs/development/python-modules/pyside2/shiboken2-clang-Write-scope-resolution-for-all-parameters.patch delete mode 100644 pkgs/development/python-modules/shiboken2/nix_compile_cflags.patch diff --git a/pkgs/development/python-modules/pyside2/Final-details-to-enable-3.12-wheel-compatibility.patch b/pkgs/development/python-modules/pyside2/Final-details-to-enable-3.12-wheel-compatibility.patch new file mode 100644 index 000000000000..beab48c54ad1 --- /dev/null +++ b/pkgs/development/python-modules/pyside2/Final-details-to-enable-3.12-wheel-compatibility.patch @@ -0,0 +1,28 @@ +From: =?utf-8?q?Cristi=C3=A1n_Maureira-Fredes?= + +Date: Tue, 10 Oct 2023 15:52:09 +0200 +Subject: Final details to enable 3.12 wheel compatibility + +Change-Id: I0252c4e73e8c214ef8aa418ddf88bc452c0fdf53 +Pick-to: 6.6 +Task-number: PYSIDE-2230 +Reviewed-by: Friedemann Kleint +(cherry picked from commit 6c7bb7b6e1008909e49bc04d2a48024309a784cc) +--- + build_scripts/config.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build_scripts/config.py b/build_scripts/config.py +index 5fc23d4..fb27394 100644 +--- a/build_scripts/config.py ++++ b/build_scripts/config.py +@@ -138,7 +138,7 @@ class Config(object): + setup_kwargs['zip_safe'] = False + setup_kwargs['cmdclass'] = cmd_class_dict + setup_kwargs['version'] = package_version +- setup_kwargs['python_requires'] = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.12" ++ setup_kwargs['python_requires'] = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.13" + + if quiet: + # Tells distutils / setuptools to be quiet, and only print warnings or errors. + diff --git a/pkgs/development/python-modules/pyside2/Modify-sendCommand-signatures.patch b/pkgs/development/python-modules/pyside2/Modify-sendCommand-signatures.patch new file mode 100644 index 000000000000..7465b109f8a4 --- /dev/null +++ b/pkgs/development/python-modules/pyside2/Modify-sendCommand-signatures.patch @@ -0,0 +1,41 @@ +From: Dmitry Shachnev +Date: Sun, 4 Feb 2024 00:29:00 +0300 +Subject: Modify sendCommand signatures to use 0 as default value + +The original default value was QNodeCommand::CommandId(), and shiboken +copies it verbatim from the header file, however it does not work because +we do not generate "using namespace Qt3DCore;". + +0 is the same as QNodeCommand::CommandId(). +--- + sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml b/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml +index 8696a12..310595f 100644 +--- a/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml ++++ b/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml +@@ -58,6 +58,11 @@ + + + ++ ++ ++ ++ ++ + +