From 68761af76e57cde6eb0c13bc7a07efdab840ffeb Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Wed, 6 May 2026 02:41:31 +0200 Subject: [PATCH] gnu: python-zeroc-ice-3.6: Fix build on python@3.12. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/patches/python-zeroc-ice-3.6.5-python-3.12-support.patch: Add patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/python-xyz.scm (python-zeroc-ice-3.6): Use it. Merges: https://codeberg.org/guix/guix/pulls/8389 Change-Id: I73d3b981414474d880a82413dcff2fc11ef04d53 Signed-off-by: Nguyễn Gia Phong --- gnu/local.mk | 1 + ...-zeroc-ice-3.6.5-python-3.12-support.patch | 24 +++++++++++++++++++ gnu/packages/python-xyz.scm | 3 ++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-zeroc-ice-3.6.5-python-3.12-support.patch diff --git a/gnu/local.mk b/gnu/local.mk index 007c743fe49..a3f7a14a62d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2138,6 +2138,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-sphinx-prompt-docutils-0.19.patch \ %D%/packages/patches/python-sshtunnel-pep518.patch \ %D%/packages/patches/python-zeroc-ice-3.6.5-python-3.11-support.patch \ + %D%/packages/patches/python-zeroc-ice-3.6.5-python-3.12-support.patch \ %D%/packages/patches/python-zipfile2-python-3.12-support.patch \ %D%/packages/patches/qcodeeditor-qt6.patch \ %D%/packages/patches/qtdeclarative-5-disable-qmlcache.patch \ diff --git a/gnu/packages/patches/python-zeroc-ice-3.6.5-python-3.12-support.patch b/gnu/packages/patches/python-zeroc-ice-3.6.5-python-3.12-support.patch new file mode 100644 index 00000000000..95d1d19c2d2 --- /dev/null +++ b/gnu/packages/patches/python-zeroc-ice-3.6.5-python-3.12-support.patch @@ -0,0 +1,24 @@ +diff --git a/lib/Ice.py b/lib/Ice.py +--- a/lib/Ice.py ++++ b/lib/Ice.py +@@ -11,7 +11,7 @@ + Ice module + """ + +-import sys, string, imp, os, threading, warnings, datetime ++import sys, string, importlib, os, threading, warnings, datetime + + # + # RTTI problems can occur in C++ code unless we modify Python's dlopen flags. +@@ -373,7 +373,8 @@ def createModule(name): + elif curr in _pendingModules: + mod = _pendingModules[curr] + else: +- nmod = imp.new_module(curr) ++ spec = importlib.util.spec_from_loader(curr, loader=None) ++ nmod = importlib.util.module_from_spec(spec) + _pendingModules[curr] = nmod + mod = nmod + +-- + diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index ae0e22216c7..0732d56856b 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -41675,7 +41675,8 @@ interfaces.") "0mikjfvq26kh8asnn9v55z41pap4c5ypymqnwwi4xkavc3mzyda2")) (patches (search-patches - "python-zeroc-ice-3.6.5-python-3.11-support.patch")))) + "python-zeroc-ice-3.6.5-python-3.11-support.patch" + "python-zeroc-ice-3.6.5-python-3.12-support.patch")))) (arguments (substitute-keyword-arguments arguments ((#:phases phases #~%standard-phases)