From 9c84be0e6dd424fb3202717e210dc9e4002eb5b1 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:00:50 +0100 Subject: [PATCH] Add libcec patch for Python 3.13 --- Dockerfile | 5 ++++- patches/libcec-python313.patch | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 patches/libcec-python313.patch diff --git a/Dockerfile b/Dockerfile index f691ea164..81edfc5e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,6 +63,7 @@ RUN \ # libcec COPY patches/libcec-fix-null-return.patch /usr/src/ +COPY patches/libcec-python313.patch /usr/src/ RUN apk add --no-cache \ eudev-libs \ p8-platform \ @@ -76,6 +77,7 @@ RUN apk add --no-cache \ && git clone --depth 1 -b "libcec-${LIBCEC_VERSION}" https://github.com/Pulse-Eight/libcec \ && cd libcec \ && git apply ../libcec-fix-null-return.patch \ + && git apply ../libcec-python313.patch \ && mkdir build \ && cd build \ && cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local \ @@ -89,7 +91,8 @@ RUN apk add --no-cache \ && apk del .build-dependencies \ && rm -rf \ /usr/src/libcec \ - /usr/src/libcec-fix-null-return.patch + /usr/src/libcec-fix-null-return.patch \ + /usr/src/libcec-python313.patch # PicoTTS - it has no specific version - commit should be taken from build.json RUN apk add --no-cache \ diff --git a/patches/libcec-python313.patch b/patches/libcec-python313.patch new file mode 100644 index 000000000..7e3f84021 --- /dev/null +++ b/patches/libcec-python313.patch @@ -0,0 +1,22 @@ +--- a/src/libcec/SwigHelper.h ++++ b/src/libcec/SwigHelper.h +@@ -119,7 +119,7 @@ namespace CEC + if (!!m_callbacks[callback]) + { + /** call the callback */ +- result = PyEval_CallObject(m_callbacks[callback], arglist); ++ result = PyObject_CallObject(m_callbacks[callback], arglist); + + /** unref the argument and result */ + if (!!arglist) +--- a/src/libcec/libcec.i ++++ b/src/libcec/libcec.i +@@ -141,7 +141,7 @@ namespace std { + if (!!lib) + { + lib->InitVideoStandalone(); +- PyEval_InitThreads(); ++ // PyEval_InitThreads(); + } + return lib; + }