Gianfranco Costamagna pushed to branch master at Debian Med / gdcm
Commits: 41d3be18 by Rafael Laboissière at 2026-08-24T14:38:44+02:00 Add patch for fixing FTBFS with swig 4.5.0 Closes: #1145354 - - - - - 2 changed files: - + debian/patches/build-with-swig-4.5.0.patch - debian/patches/series Changes: ===================================== debian/patches/build-with-swig-4.5.0.patch ===================================== @@ -0,0 +1,48 @@ +Description: Build with swig 4.5.0 + Without this patch, the package FTBFS with swig 4.5.0. This is due to + the removal of the Python 2 compatibility macros in version 4.5.0. + According to the SWIG authors, these macros were retained in the + generated code (pyhead.swg) solely for user typemaps. All typemap + using these macros are updated to call the Python 3 C API + directly. +Author: Rafael Laboissière <[email protected]> +Bug-Debian: https://bugs.debian.org/1145354 +Forwarded: no +Last-Update: 2026-08-24 + +--- gdcm-3.0.24.orig/Wrapping/Python/gdcmswig.i ++++ gdcm-3.0.24/Wrapping/Python/gdcmswig.i +@@ -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); + } + } +--- gdcm-3.0.24.orig/Wrapping/SWIGCommon/gdcmcommon.i ++++ gdcm-3.0.24/Wrapping/SWIGCommon/gdcmcommon.i +@@ -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); + } + } ===================================== debian/patches/series ===================================== @@ -16,3 +16,4 @@ CVE-2025-48429.patch CVE-2026-3650.patch fix-ftbfs-with-vtk-9.6-and-gcc-15.patch fix-ftbfs-with-poppler-26.07.patch +build-with-swig-4.5.0.patch View it on GitLab: https://salsa.debian.org/med-team/gdcm/-/commit/41d3be1856fc497016c7640c90dd46e215523ce0 -- View it on GitLab: https://salsa.debian.org/med-team/gdcm/-/commit/41d3be1856fc497016c7640c90dd46e215523ce0 You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
_______________________________________________ debian-med-commit mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit
