public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/swig] rawhide: 4.5.0 bump (rhbz#2511871)
@ 2026-08-06 8:52 Jitka Plesnikova
0 siblings, 0 replies; only message in thread
From: Jitka Plesnikova @ 2026-08-06 8:52 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/swig
Branch : rawhide
Commit : ce4070cb3940043f337619684013822373760dcc
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date : 2026-08-06T10:52:15+02:00
Stats : +8/-287 in 5 file(s)
URL : https://src.fedoraproject.org/rpms/swig/c/ce4070cb3940043f337619684013822373760dcc?branch=rawhide
Log:
4.5.0 bump (rhbz#2511871)
---
diff --git a/.gitignore b/.gitignore
index 8cec1dc..8fa74bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,3 +33,4 @@ swig-2.0.0.tar.gz
/swig-4.3.1.tar.gz
/swig-4.4.0.tar.gz
/swig-4.4.1.tar.gz
+/swig-4.5.0.tar.gz
diff --git a/sources b/sources
index f6fe3ce..492a70d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (swig-4.4.1.tar.gz) = 103ddb4a5914f28e6739a006d35042c701e55ba05066acff3f3609befb5f43f253ea717fc41d06c93d8fb187ded4399c12c94665b93dc06d0fb835069391c7c7
+SHA512 (swig-4.5.0.tar.gz) = fef7c3db99d2894064ac8cded989dc574fc15b8a497db6239e278e326616c905df8c2d2a28848f6e0874c1732af958772d504da84c5f068b719a4d192a472e96
diff --git a/swig-R-Fix-compilation-with-R-4.6.0-which-removed-non-API.patch b/swig-R-Fix-compilation-with-R-4.6.0-which-removed-non-API.patch
deleted file mode 100644
index eb9a999..0000000
--- a/swig-R-Fix-compilation-with-R-4.6.0-which-removed-non-API.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-From 0601b9ca9401aed5bcf1b018be922b15a8cee92a Mon Sep 17 00:00:00 2001
-From: Bradley Lowekamp <blowekamp@mail.nih.gov>
-Date: Thu, 30 Apr 2026 16:09:54 +0000
-Subject: [PATCH] [R] Fix compilation with R 4.6.0 which removed non-API macros
- #3407
-
-R 4.6.0 (April 2025) removed the non-API macro SET_S4_OBJECT and made
-CHARACTER_POINTER return a const pointer, breaking compilation of SWIG
-generated R code.
-
-Replace with proper R API equivalents:
-- SET_S4_OBJECT(x) -> x = Rf_asS4(x, TRUE, 0) (3 sites in rrun.swg)
-- CHARACTER_POINTER(v)[i] = ... -> SET_STRING_ELT(v, i, ...) (2 sites in std_vector.i)
-- CHARACTER_POINTER() via pstr -> STRING_ELT(, i) directly (argcargv.i)
-
-All replacement APIs have been available since R 2.x so no version
-guards are required.
-
-Assisted-by: GitHub Copilot (Claude Sonnet 4.6)
----
- CHANGES.current | 6 ++++++
- Lib/r/argcargv.i | 4 +---
- Lib/r/rrun.swg | 6 +++---
- Lib/r/std_vector.i | 4 ++--
- 4 files changed, 12 insertions(+), 8 deletions(-)
-
-#diff --git a/CHANGES.current b/CHANGES.current
-#index a92aff2f2..287a795ba 100644
-#--- a/CHANGES.current
-#+++ b/CHANGES.current
-#@@ -7,6 +7,12 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
-# Version 4.5.0 (in progress)
-# ===========================
-#
-#+2026-05-15: blowekamp
-#+ [R] #3407 Fix compilation with R 4.6.0 which removed the non-API macro
-#+ SET_S4_OBJECT and made CHARACTER_POINTER return a const pointer.
-#+ Use Rf_asS4, SET_STRING_ELT and STRING_ELT instead. These replacement
-#+ APIs have been available since R 2.x so no version guards are required.
-#+
-# 2026-05-12: wsfulton
-# C++20: %template can now instantiate abbreviated function templates
-# that mix 'auto' parameters with a variadic explicit template pack,
-diff --git a/Lib/r/argcargv.i b/Lib/r/argcargv.i
-index 73380f4e2..af7aa14d6 100644
---- a/Lib/r/argcargv.i
-+++ b/Lib/r/argcargv.i
-@@ -14,7 +14,6 @@
- %}
- %typemap(in) (int ARGC, char **ARGV) {
- $1_ltype i;
-- SEXP *pstr;
- if ($input == R_NilValue) {
- /* Empty array */
- $1 = 0;
-@@ -22,14 +21,13 @@
- SWIG_exception_fail(SWIG_RuntimeError, "Wrong array type.");
- } else {
- $1 = Rf_length($input);
-- pstr = CHARACTER_POINTER($input);
- }
- $2 = ($2_ltype) malloc(($1+1)*sizeof($*2_ltype));
- if ($2 == NULL) {
- SWIG_exception_fail(SWIG_MemoryError, "Memory allocation failed.");
- }
- for (i = 0; i < $1; i++) {
-- $2[i] = ($*2_ltype)STRING_VALUE(pstr[i]);
-+ $2[i] = ($*2_ltype)STRING_VALUE(STRING_ELT($input, i));
- }
- $2[i] = NULL;
- }
-diff --git a/Lib/r/rrun.swg b/Lib/r/rrun.swg
-index 4c03d5884..5dee391f3 100644
---- a/Lib/r/rrun.swg
-+++ b/Lib/r/rrun.swg
-@@ -267,7 +267,7 @@ SWIG_MakePtr(void *ptr, const char *typeName, int flags)
- R_RegisterCFinalizer(external, R_SWIG_ReferenceFinalizer);
-
- r_obj = SET_SLOT(r_obj, Rf_mkString((char *) "ref"), external);
-- SET_S4_OBJECT(r_obj);
-+ r_obj = Rf_asS4(r_obj, TRUE, 0);
- Rf_unprotect(2);
-
- return(r_obj);
-@@ -285,7 +285,7 @@ R_SWIG_create_SWIG_R_Array(const char *typeName, SEXP ref, int len)
- Rf_protect(arr = R_do_slot_assign(arr, Rf_mkString("dims"), Rf_ScalarInteger(len)));
-
- Rf_unprotect(3);
-- SET_S4_OBJECT(arr);
-+ arr = Rf_asS4(arr, TRUE, 0);
- return arr;
- }
-
-@@ -308,7 +308,7 @@ SWIG_R_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
- }
- rptr = R_MakeExternalPtr(ptr,
- R_MakeExternalPtr(type, R_NilValue, R_NilValue), R_NilValue);
-- SET_S4_OBJECT(rptr);
-+ rptr = Rf_asS4(rptr, TRUE, 0);
- return rptr;
- }
-
-diff --git a/Lib/r/std_vector.i b/Lib/r/std_vector.i
-index 6b32c9f6f..7db6d3814 100644
---- a/Lib/r/std_vector.i
-+++ b/Lib/r/std_vector.i
-@@ -203,7 +203,7 @@
- PROTECT(result = Rf_allocVector(STRSXP, val->size()));
- for (unsigned pos = 0; pos < val->size(); pos++)
- {
-- CHARACTER_POINTER(result)[pos] = Rf_mkChar(((*val)[pos]).c_str());
-+ SET_STRING_ELT(result, pos, Rf_mkChar(((*val)[pos]).c_str()));
- }
- UNPROTECT(1);
- return(result);
-@@ -669,7 +669,7 @@
- // Fill the R vector
- for (unsigned vpos = 0; vpos < val->at(pos).size(); ++vpos)
- {
-- CHARACTER_POINTER(VECTOR_ELT(result, pos))[vpos] = Rf_mkChar(val->at(pos).at(vpos).c_str());
-+ SET_STRING_ELT(VECTOR_ELT(result, pos), vpos, Rf_mkChar(val->at(pos).at(vpos).c_str()));
- }
- }
- UNPROTECT(1);
---
-2.54.0
-
diff --git a/swig-python-Python-3.14-support.patch b/swig-python-Python-3.14-support.patch
deleted file mode 100644
index ceee305..0000000
--- a/swig-python-Python-3.14-support.patch
+++ /dev/null
@@ -1,153 +0,0 @@
-From 50e1cc8bc0d090164762ec166439f8b0f3855308 Mon Sep 17 00:00:00 2001
-From: Julien Schueller <schueller@phimeca.com>
-Date: Thu, 10 Apr 2025 17:22:15 +0200
-Subject: [PATCH 1/3] Python: Handle __package__ removal
-
-Closes #2967
----
- Doc/Manual/Python.html | 6 +++---
- Source/Modules/python.cxx | 8 +++++---
- 2 files changed, 8 insertions(+), 6 deletions(-)
-
-diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html
-index 23587e5dbcc..01fc449a68a 100644
---- a/Doc/Manual/Python.html
-+++ b/Doc/Manual/Python.html
-@@ -6552,7 +6552,7 @@ <H4><a name="Python_package_search_both_package_modules">33.11.6.1 Both modules
-
- <p>
- In this configuration, the pure Python module, foo.py, tries to load the C/C++ module, _foo, from the same package foo.py is
--located in. The package name is determined from the <tt>__package__</tt>
-+located in. The package name is determined from the <tt>__spec__.parent</tt> (or <tt>__package__</tt> before Python 3.4)
- attribute if available, see <a href="https://www.python.org/dev/peps/pep-0366/">PEP 366</a>. Otherwise it is derived from the <tt>__name__</tt>
- attribute given to foo.py by the Python loader that imported foo.py.
- The interface file for this configuration would contain:
-@@ -6675,7 +6675,7 @@ <H4><a name="Python_custom_module_import">33.11.6.4 More on customizing the modu
-
- <div class="targetlang">
- <pre>
--if __package__ or '.' in __name__:
-+if getattr(__spec__, "parent", None) or '.' in __name__:
- from . import _foo
- else:
- import _foo
-@@ -6760,7 +6760,7 @@ <H4><a name="Python_custom_module_import">33.11.6.4 More on customizing the modu
-
- <div class="targetlang">
- <pre>
--if __package__ or '.' in __name__:
-+if getattr(__spec__, "parent", None) or '.' in __name__:
- from ._foo import *
- else:
- from _foo import *
-diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx
-index 86daf131c8b..a71fc3cdb25 100644
---- a/Source/Modules/python.cxx
-+++ b/Source/Modules/python.cxx
-@@ -703,20 +703,22 @@ class PYTHON:public Language {
- * onwards (implicit relative imports raised a DeprecationWarning in 2.6,
- * and fail in 2.7 onwards).
- *
-- * First check for __package__ which is available from 2.6 onwards, see PEP366.
-+ * First check for __spec__.parent which is available from 3.4 onwards,
-+ * see https://docs.python.org/3/reference/import.html#spec. If not,
-+ * check for __package__, which was set before 3.14.
- * Next try determine the shadow wrapper's package based on the __name__ it
- * was given by the importer that loaded it.
- * If the module is in a package, load the low-level C/C++ module from the
- * same package, otherwise load it as a global module.
- */
- Printv(default_import_code, "# Import the low-level C/C++ module\n", NULL);
-- Printv(default_import_code, "if __package__ or \".\" in __name__:\n", NULL);
-+ Printv(default_import_code, "if getattr(globals().get(\"__spec__\"), \"parent\", None) or globals().get(\"__package__\") or \".\" in __name__:\n", NULL);
- Printv(default_import_code, tab4, "from . import ", module, "\n", NULL);
- Printv(default_import_code, "else:\n", NULL);
- Printv(default_import_code, tab4, "import ", module, "\n", NULL);
- } else {
- Printv(default_import_code, "# Pull in all the attributes from the low-level C/C++ module\n", NULL);
-- Printv(default_import_code, "if __package__ or \".\" in __name__:\n", NULL);
-+ Printv(default_import_code, "if getattr(globals().get(\"__spec__\"), \"parent\", None) or globals().get(\"__package__\") or \".\" in __name__:\n", NULL);
- Printv(default_import_code, tab4, "from .", module, " import *\n", NULL);
- Printv(default_import_code, "else:\n", NULL);
- Printv(default_import_code, tab4, "from ", module, " import *\n", NULL);
-
-From 3bfdf13c602f877860a9949ba751a5b5a9ba70aa Mon Sep 17 00:00:00 2001
-From: Julien Schueller <schueller@phimeca.com>
-Date: Thu, 10 Apr 2025 18:35:25 +0200
-Subject: [PATCH 2/3] Python: Add ht_token
-
----
- Source/Modules/python.cxx | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx
-index a71fc3cdb25..3070a94face 100644
---- a/Source/Modules/python.cxx
-+++ b/Source/Modules/python.cxx
-@@ -4374,6 +4374,11 @@ class PYTHON:public Language {
- Printv(f, "#if PY_VERSION_HEX >= 0x030b0000\n", NIL);
- printSlot(f, getSlot(n, "feature:python:_ht_tpname"), "_ht_tpname", "char *");
-
-+ // void *ht_token;
-+ Printv(f, "#if PY_VERSION_HEX >= 0x030e0000\n", NIL);
-+ printSlot(f, getSlot(n, "feature:python:ht_token"), "ht_token", "void *");
-+ Printv(f, "#endif\n", NIL);
-+
- // struct _specialization_cache _spec_cache;
- Printf(f, " {\n");
- printSlot(f, getSlot(n, "feature:python:getitem"), "getitem", "PyObject *");
-
-From 55237efa7219f65a04e0ffc69a81c574b5f5e162 Mon Sep 17 00:00:00 2001
-From: Julien Schueller <schueller@phimeca.com>
-Date: Thu, 10 Apr 2025 17:47:59 +0200
-Subject: [PATCH 3/3] Python: Amend annotations test
-
----
- .../python_annotations_variable_c_runme.py | 24 +++++++++++++------
- 1 file changed, 17 insertions(+), 7 deletions(-)
-
-diff --git a/Examples/test-suite/python/python_annotations_variable_c_runme.py b/Examples/test-suite/python/python_annotations_variable_c_runme.py
-index 153852d05e6..d1f359bbbd0 100644
---- a/Examples/test-suite/python/python_annotations_variable_c_runme.py
-+++ b/Examples/test-suite/python/python_annotations_variable_c_runme.py
-@@ -1,4 +1,17 @@
- import sys
-+import inspect
-+
-+
-+def get_annotations(cls):
-+ # Python >=3.14 removed the __annotations__ attribute
-+ # retrieve it via inspect (see also annotationlib)
-+ if hasattr(inspect, "get_annotations"):
-+ # Python >=3.10
-+ return inspect.get_annotations(cls)
-+ else:
-+ # Python <3.10
-+ return getattr(cls, "__annotations__", {})
-+
-
- # Variable annotations for properties is only supported in python-3.6 and later (PEP 526)
- if sys.version_info[0:2] >= (3, 6):
-@@ -8,17 +21,14 @@
- annotations_supported = not(is_python_builtin() or is_python_fastproxy())
-
- if annotations_supported:
-- ts = TemplateShort()
-- anno = ts.__annotations__
-+ anno = get_annotations(TemplateShort)
- if anno != {'member_variable': 'int'}:
- raise RuntimeError("annotations mismatch: {}".format(anno))
-
-- ts = StructWithVar()
-- anno = ts.__annotations__
-+ anno = get_annotations(StructWithVar)
- if anno != {'member_variable': 'int'}:
- raise RuntimeError("annotations mismatch: {}".format(anno))
-
-- ts = StructWithVarNotAnnotated()
-- if getattr(ts, "__annotations__", None) != None:
-- anno = ts.__annotations__
-+ anno = get_annotations(StructWithVarNotAnnotated)
-+ if anno != {}:
- raise RuntimeError("annotations mismatch: {}".format(anno))
-
diff --git a/swig.spec b/swig.spec
index 4b4d5eb..2323831 100644
--- a/swig.spec
+++ b/swig.spec
@@ -46,8 +46,7 @@
%else
%{!?guile:%global guile 1}
%{!?octave:%global octave 1}
-# R-core requires tcl < 9.0.0
-%{!?Rlang:%global Rlang 0}
+%{!?Rlang:%global Rlang 1}
%bcond_without build_ccache_swig
%endif
@@ -68,8 +67,8 @@
Summary: Connects C/C++/Objective C to some high-level programming languages
Name: swig
-Version: 4.4.1
-Release: 8%{?dist}
+Version: 4.5.0
+Release: 1%{?dist}
License: GPL-3.0-or-later AND BSD-3-Clause
URL: https://www.swig.org/
Source0: http://downloads.sourceforge.net/project/swig/swig/swig-%{version}/swig-%{version}.tar.gz
@@ -81,8 +80,6 @@ Source3: ccache-swig.sh
Source4: ccache-swig.csh
%endif
-Patch0: swig-R-Fix-compilation-with-R-4.6.0-which-removed-non-API.patch
-
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: make
@@ -400,6 +397,9 @@ _EOF
%endif
%changelog
+* Thu Aug 06 2026 Jitka Plesnikova <jplesnik@redhat.com> - 4.5.0-1
+- 4.5.0 bump (rhbz#2511871)
+
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-06 8:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-06 8:52 [rpms/swig] rawhide: 4.5.0 bump (rhbz#2511871) Jitka Plesnikova
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox