public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jitka Plesnikova <jplesnik@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/gdcm] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
Date: Wed, 29 Jul 2026 08:42:20 GMT [thread overview]
Message-ID: <178531454023.1.7947826924603116595.rpms-gdcm-494405130139@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/gdcm
Branch : rawhide
Commit : 494405130139a01e899dc52dc0b50143ea37eddf
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date : 2026-07-28T15:29:18+02:00
Stats : +41/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/gdcm/c/494405130139a01e899dc52dc0b50143ea37eddf?branch=rawhide
Log:
Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
---
diff --git a/gdcm-swig45.patch b/gdcm-swig45.patch
new file mode 100644
index 0000000..eb24a38
--- /dev/null
+++ b/gdcm-swig45.patch
@@ -0,0 +1,38 @@
+diff -up GDCM-3.0.24/Wrapping/Python/gdcmswig.i.swig45 GDCM-3.0.24/Wrapping/Python/gdcmswig.i
+--- GDCM-3.0.24/Wrapping/Python/gdcmswig.i.swig45 2026-07-27 17:29:11.335129955 +0200
++++ GDCM-3.0.24/Wrapping/Python/gdcmswig.i 2026-07-27 17:29:11.338741795 +0200
+@@ -338,11 +338,11 @@ EXTEND_CLASS_PRINT(gdcm::ByteValue)
+ %template(SmartPtrSQ) gdcm::SmartPointer<gdcm::SequenceOfItems>;
+ %template(SmartPtrFrag) gdcm::SmartPointer<gdcm::SequenceOfFragments>;
+ %typemap(in) (const char* array, uint32_t length) {
+- $1 = PyString_AsString($input);
++ $1 = PyBytes_AsString($input);
+ if ($1 == NULL) {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '$symname', argument $argnum expected byte string.");
+ }
+- Py_ssize_t length = PyString_Size($input);
++ Py_ssize_t length = PyBytes_Size($input);
+ if (static_cast<size_t>(length) > std::numeric_limits<uint32_t>::max()) {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_OverflowError), "in method '$symname', array in argument $argnum is too large.");
+ }
+@@ -408,7 +408,7 @@ EXTEND_CLASS_PRINT(gdcm::File)
+ int n = arg1->GetNumberOfDimensions();
+ $result = PyList_New(n);
+ for (i = 0; i < n; i++) {
+- PyObject *o = PyInt_FromLong((long) $1[i]);
++ PyObject *o = PyLong_FromLong((long) $1[i]);
+ PyList_SetItem($result,i,o);
+ }
+ }
+diff -up GDCM-3.0.24/Wrapping/SWIGCommon/gdcmcommon.i.swig45 GDCM-3.0.24/Wrapping/SWIGCommon/gdcmcommon.i
+--- GDCM-3.0.24/Wrapping/SWIGCommon/gdcmcommon.i.swig45 2026-07-27 17:29:11.336129976 +0200
++++ GDCM-3.0.24/Wrapping/SWIGCommon/gdcmcommon.i 2026-07-27 17:29:11.340094631 +0200
+@@ -403,7 +403,7 @@ using namespace gdcm;
+ int n = arg1->GetNumberOfDimensions();
+ $result = PyList_New(n);
+ for (i = 0; i < n; i++) {
+- PyObject *o = PyInt_FromLong((long) $1[i]);
++ PyObject *o = PyLong_FromLong((long) $1[i]);
+ PyList_SetItem($result,i,o);
+ }
+ }
diff --git a/gdcm.spec b/gdcm.spec
index 3b44844..96e9b43 100644
--- a/gdcm.spec
+++ b/gdcm.spec
@@ -25,6 +25,9 @@ Patch2: 0002-Fix-export-variables.patch
Patch3: 0003-fix-set-C-23-for-poppler-usage.patch
# Sent upstream: https://github.com/malaterre/GDCM/pull/205
Patch4: 0004-fix-GooString-use-std-string-size.patch
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch5: gdcm-swig45.patch
BuildRequires: CharLS-devel >= 2.2
BuildRequires: cmake
reply other threads:[~2026-07-29 8:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178531454023.1.7947826924603116595.rpms-gdcm-494405130139@fedoraproject.org \
--to=jplesnik@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox