Skip to content

Commit

Permalink
Add libcec patch for Python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Nov 12, 2024
1 parent 1d4ee12 commit 9c84be0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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 \
Expand Down
22 changes: 22 additions & 0 deletions patches/libcec-python313.patch
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 9c84be0

Please sign in to comment.