From 4fcc29d0a37f586cb1f616551d25e78bd753cbd5 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 12 Jul 2023 22:21:36 -0600 Subject: [PATCH] Add patch for python 3.12 --- swig-python-3.12.patch | 22 ++++++++++++++++++++++ swig.spec | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 swig-python-3.12.patch diff --git a/swig-python-3.12.patch b/swig-python-3.12.patch new file mode 100644 index 0000000..6958adc --- /dev/null +++ b/swig-python-3.12.patch @@ -0,0 +1,22 @@ +Immortal objects now have a fixed refcount, which makes this test fail: + +checking python testcase langobj (with run test) +Traceback (most recent call last): + File "/builddir/build/BUILD/swig-4.1.1/Examples/test-suite/python/./langobj_runme.py", line 13, in + raise RuntimeError +RuntimeError +make[1]: *** [Makefile:123: langobj.cpptest] Error 1 + +See https://peps.python.org/pep-0683/ for more information. + +--- swig-4.1.1/Examples/test-suite/python/langobj_runme.py.orig 2022-11-30 00:35:05.000000000 -0700 ++++ swig-4.1.1/Examples/test-suite/python/langobj_runme.py 2023-07-12 15:48:18.745852293 -0600 +@@ -2,7 +2,7 @@ import sys + from langobj import * + + +-x = "hello" ++x = (1,2) + rx = sys.getrefcount(x) + v = identity(x) + rv = sys.getrefcount(v) diff --git a/swig.spec b/swig.spec index 67f6ca2..cc49db2 100644 --- a/swig.spec +++ b/swig.spec @@ -81,6 +81,8 @@ Patch1: swig-octave-8.1.patch # OCaml 5.0 support # https://github.com/swig/swig/pull/2649 Patch2: swig-ocaml-5.0.patch +# Fix a test that is broken with python 3.12 +Patch3: swig-python-3.12.patch BuildRequires: coreutils BuildRequires: findutils @@ -367,6 +369,9 @@ install -pm 644 Tools/swig.gdb %{buildroot}%{_datadir}/%{name}/gdb %{_datadir}/%{name}/gdb %changelog +* Wed Jul 12 2023 Jerry James - 4.1.1-8 +- Add patch for python 3.12 + * Tue Jul 11 2023 Richard W.M. Jones - 4.1.1-8 - OCaml 5.0 rebuild for Fedora 39