[meta-python][PATCH 3/4] upm: fix removed Python 2 C-API symbol in carrays_uint32_t.i

Khem Raj <[email protected]>
Newsgroups org.openembedded.lists.openembedded-devel
Message-ID <[email protected]>
PyInt_AsLong is a Python 2 C-API name with no fallback definition in
Python 3.14, so any SWIG module that %includes this file (e.g. hmtrp)
fails to compile:

  hmtrpPYTHON_wrap.cxx:7351:14: error: use of undeclared identifier 'PyInt_AsLong'; did you mean 'PyLong_AsLong'?

Signed-off-by: Khem Raj <[email protected]>
---
 ...t.i-use-PyLong_AsLong-instead-of-PyI.patch | 23 +++++++++++++++++++
 meta-oe/recipes-extended/upm/upm_git.bb       |  1 +
 2 files changed, 24 insertions(+)
 create mode 100644 meta-oe/recipes-extended/upm/upm/0002-carrays_uint32_t.i-use-PyLong_AsLong-instead-of-PyI.patch

diff --git a/meta-oe/recipes-extended/upm/upm/0002-carrays_uint32_t.i-use-PyLong_AsLong-instead-of-PyI.patch b/meta-oe/recipes-extended/upm/upm/0002-carrays_uint32_t.i-use-PyLong_AsLong-instead-of-PyI.patch
new file mode 100644
index 0000000000..d2703084ac
--- /dev/null
+++ b/meta-oe/recipes-extended/upm/upm/0002-carrays_uint32_t.i-use-PyLong_AsLong-instead-of-PyI.patch
@@ -0,0 +1,23 @@
+From: Khem Raj <[email protected]>
+Subject: carrays_uint32_t.i: use PyLong_AsLong instead of PyInt_AsLong
+
+PyInt_AsLong is a Python 2 C-API name with no fallback definition in
+Python 3.14, so any SWIG module that %includes this file (e.g. hmtrp)
+fails to compile:
+
+  hmtrpPYTHON_wrap.cxx:7351:14: error: use of undeclared identifier 'PyInt_AsLong'; did you mean 'PyLong_AsLong'?
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+--- a/src/carrays_uint32_t.i
++++ b/src/carrays_uint32_t.i
+@@ -45,7 +45,7 @@
+   long v;
+   int res = SWIG_AsVal_long ($input, &v);
+   if (SWIG_IsOK(res)) {
+-    $1 = PyInt_AsLong($input);
++    $1 = PyLong_AsLong($input);
+   }
+   else {
+     SWIG_exception_fail(SWIG_ArgError(res), "failed to convert uint32");
diff --git a/meta-oe/recipes-extended/upm/upm_git.bb b/meta-oe/recipes-extended/upm/upm_git.bb
index 9b809ce727..0257ae8ed7 100644
--- a/meta-oe/recipes-extended/upm/upm_git.bb
+++ b/meta-oe/recipes-extended/upm/upm_git.bb
@@ -17,6 +17,7 @@ SRC_URI = "git://github.com/eclipse/${BPN}.git;protocol=https;branch=master \
            file://0001-cmake-Disable-Wno-misleading-indentation-with-clang-.patch \
            file://0001-cmake-Disable-using-Wno-maybe-uninitialized.patch \
            file://0001-include-missing-cstdint.patch \
+           file://0002-carrays_uint32_t.i-use-PyLong_AsLong-instead-of-PyI.patch \
            "

 SRC_URI:append:toolchain-clang:x86 = " file://0001-nmea_gps-Link-with-latomic.patch "
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.