user [email protected]
usertags 1145402 python3.15
tags 1145402 patch
thanks

Hi!

While rebuilding the python related packages against the Python 3.15rc2
version I ran into this FTBFS.
To solve the problem, I had to add the missing parts of upstream patch
3bb8b0cb9a30f7d9cc5287c2aec3620724dfd9b8 Support swig 4.5 (#9324)

Additionally, I had trouble building this package because it uses too
many workers that are memory hungry in arm64, using guess-concurrency to
limit them makes this problem go away.

I've applied these fixes in the sandbox [1] to verify that it builds
successfully, these should be applied in Debian to get the package back
to a healthy state.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/
--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
#!/usr/bin/make -f
BUILDDIR = $(CURDIR)/debian/build
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_BUILD_PARALLEL ?= $(shell guess_concurrency --require-mem 8G)
PY3VERS := $(shell py3versions -sv)
PY3VER_DEFAULT := $(shell py3versions -dv)

CMAKE_FLAGS = \
      -DCOLLADA_SUPPORT=Off \
      -DBUILD_SHARED_LIBS=On \
      -DHDF5_SUPPORT=Off \
      -DCGAL_INCLUDE_DIR=/usr/include \
      -DGMP_INCLUDE_DIR=/usr/include \
      -DMPFR_INCLUDE_DIR=/usr/include \
      -DPCRE_LIBRARY_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
      -DGMP_LIBRARY_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
      -DMPFR_LIBRARY_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
      -DJSON_INCLUDE_DIR=/usr/include \
      -DEIGEN_DIR=/usr/include/eigen3

%:
        dh $@ --buildsystem=cmake --sourcedirectory=cmake 
--builddirectory=$(BUILDDIR)/$(PY3VER_DEFAULT) 
--max-parallel=$(DEB_BUILD_PARALLEL)

override_dh_auto_configure:
        set -e; for pyver in $(PY3VERS); do \
                dh_auto_configure \
                    --sourcedirectory=cmake \
                    --builddirectory=$(BUILDDIR)/$$pyver \
                    -- $(CMAKE_FLAGS) \
                    -DPYTHON_INCLUDE_DIR=/usr/include/python$$pyver \
                    
-DPYTHON_LIBRARY=/usr/lib/$(DEB_HOST_MULTIARCH)/libpython$$pyver.so; \
        done

override_dh_auto_build:
        set -e; for pyver in $(PY3VERS); do \
                dh_auto_build --builddirectory=$(BUILDDIR)/$$pyver 
--max-parallel=$(DEB_BUILD_PARALLEL); \
        done

override_dh_auto_test:
        set -e; for pyver in $(PY3VERS); do \
                dh_auto_test --builddirectory=$(BUILDDIR)/$$pyver 
--max-parallel=$(DEB_BUILD_PARALLEL); \
        done

override_dh_auto_install:
        dh_auto_install --builddirectory=$(BUILDDIR)/$(PY3VER_DEFAULT)
        set -e; for pyver in $(PY3VERS); do \
                if [ "$$pyver" != "$(PY3VER_DEFAULT)" ]; then \
                        find $(BUILDDIR)/$$pyver/ifcwrap -name 
"_ifcopenshell_wrapper.cpython-*.so" \
                            -exec install -m 644 {} \
                            
$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/ifcopenshell/ \; ; \
                fi; \
        done

override_dh_dwz:

execute_after_dh_clean:
        rm -rf $(BUILDDIR)
From: Bruno Postle <[email protected]>
Date: Fri, 28 Aug 2026 19:35:23 +0100
Subject: Support swig 4.5 (#9324)

Current swig has removed support for python2 macros, breaking the build.
See: https://github.com/swig/swig/blob/5872e9b4176cf59ce4e31b010c29a4cebf32960f/CHANGES#L391

Origin: upstream, https://github.com/IfcOpenShell/IfcOpenShell/commit/3bb8b0cb9a30f7d9cc5287c2aec3620724dfd9b8
Bug-Debian: https://bugs.debian.org/1145402
---
 .../cityjson/IfcOpenShell/src/ifcwrap/utils/type_conversion.i | 6 +++---
 .../cityjson/IfcOpenShell/src/ifcwrap/utils/typemaps_out.i    | 4 ++--
 src/ifcwrap/utils/type_conversion.i                           | 6 +++---
 src/ifcwrap/utils/typemaps_out.i                              | 4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

--- a/src/ifcconvert/cityjson/IfcOpenShell/src/ifcwrap/utils/type_conversion.i
+++ b/src/ifcconvert/cityjson/IfcOpenShell/src/ifcwrap/utils/type_conversion.i
@@ -56,7 +56,7 @@
 
 	template <>
 	int cast_pyobject(PyObject* element) {
-		return static_cast<int>(PyInt_AsLong(element));
+		return static_cast<int>(PyLong_AsLong(element));
 	}
 
 	template <>
@@ -118,8 +118,8 @@
 		}
 	}
 
-	PyObject* pythonize(const int& t)                   { return PyInt_FromLong(t);                                                                  }
-	PyObject* pythonize(const unsigned int& t)          { return PyInt_FromLong(t);                                                                  }
+	PyObject* pythonize(const int& t)                   { return PyLong_FromLong(t);                                                                  }
+	PyObject* pythonize(const unsigned int& t)          { return PyLong_FromLong(t);                                                                  }
 	PyObject* pythonize(const bool& t)                  { return PyBool_FromLong(t);                                                                 }
 	PyObject* pythonize(const double& t)                { return PyFloat_FromDouble(t);                                                              }
 	PyObject* pythonize(const std::string& t)           { return PyUnicode_FromString(t.c_str());                                                    }
--- a/src/ifcconvert/cityjson/IfcOpenShell/src/ifcwrap/utils/typemaps_out.i
+++ b/src/ifcconvert/cityjson/IfcOpenShell/src/ifcwrap/utils/typemaps_out.i
@@ -7,7 +7,7 @@
 }
 
 %typemap(out) IfcUtil::ArgumentType {
-	$result = SWIG_Python_str_FromChar(IfcUtil::ArgumentTypeToString($1));
+	$result = PyUnicode_FromString(IfcUtil::ArgumentTypeToString($1));
 }
 
 %typemap(out) IfcParse::declaration* {
@@ -26,7 +26,7 @@
 
 %typemap(out) IfcParse::simple_type::data_type {
 	static const char* const data_type_strings[] = {"binary", "boolean", "integer", "logical", "number", "real", "string"};
-	$result = SWIG_Python_str_FromChar(data_type_strings[(int)$1]);
+	$result = PyUnicode_FromString(data_type_strings[(int)$1]);
 }
 
 %typemap(out) std::pair<IfcUtil::ArgumentType, Argument*> {
--- a/src/ifcwrap/utils/type_conversion.i
+++ b/src/ifcwrap/utils/type_conversion.i
@@ -62,7 +62,7 @@
 
 	template <>
 	int cast_pyobject(PyObject* element) {
-		return static_cast<int>(PyInt_AsLong(element));
+		return static_cast<int>(PyLong_AsLong(element));
 	}
 
 	template <>
@@ -156,8 +156,8 @@
 		}
 	}
 
-	PyObject* pythonize(const int& t)                   { return PyInt_FromLong(t);                                                                  }
-	PyObject* pythonize(const unsigned int& t)          { return PyInt_FromLong(t);                                                                  }
+	PyObject* pythonize(const int& t)                   { return PyLong_FromLong(t);                                                                  }
+	PyObject* pythonize(const unsigned int& t)          { return PyLong_FromLong(t);                                                                  }
 	PyObject* pythonize(const bool& t)                  { return PyBool_FromLong(t);                                                                 }
 	PyObject* pythonize(const boost::logic::tribool& t) { return boost::logic::indeterminate(t) ? PyUnicode_FromString("UNKNOWN") : PyBool_FromLong((bool)t) ;}
 	PyObject* pythonize(const double& t)                { return PyFloat_FromDouble(t);                                                              }
--- a/src/ifcwrap/utils/typemaps_out.i
+++ b/src/ifcwrap/utils/typemaps_out.i
@@ -7,7 +7,7 @@
 }
 
 %typemap(out) IfcUtil::ArgumentType {
-	$result = SWIG_Python_str_FromChar(IfcUtil::ArgumentTypeToString($1));
+	$result = PyUnicode_FromString(IfcUtil::ArgumentTypeToString($1));
 }
 
 %typemap(out) IfcParse::declaration* {
@@ -28,7 +28,7 @@
 
 %typemap(out) IfcParse::simple_type::data_type {
 	static const char* const data_type_strings[] = {"binary", "boolean", "integer", "logical", "number", "real", "string"};
-	$result = SWIG_Python_str_FromChar(data_type_strings[(int)$1]);
+	$result = PyUnicode_FromString(data_type_strings[(int)$1]);
 }
 
 %typemap(out) AttributeValue {
-- 
debian-science-maintainers mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-science-maintainers

Reply via email to