mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 21:24:20 +01:00
Update libCEC (#465)
* Create build.json * Update Dockerfile * Update config.json * Create CHANGELOG.md * Update Dockerfile * Update Dockerfile
This commit is contained in:
5
cec_scan/CHANGELOG.md
Normal file
5
cec_scan/CHANGELOG.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 1
|
||||
- Add support for Raspberry-pi 64bit
|
||||
- Update libCEC to 4.0.3
|
||||
@@ -4,40 +4,53 @@ FROM $BUILD_FROM
|
||||
# Add env
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
WORKDIR /usr/src
|
||||
ARG BUILD_ARCH
|
||||
|
||||
# Build libcec with RPi support for HDMI-CEC on armhf
|
||||
RUN apk add --no-cache build-base cmake eudev-dev git swig \
|
||||
libstdc++ libgcc \
|
||||
&& if [ "$BUILD_ARCH" == "armhf" ]; then \
|
||||
apk add --no-cache raspberrypi-dev raspberrypi raspberrypi-libs; fi \
|
||||
&& git clone --depth 1 -b p8-platform-2.1.0.1 https://github.com/Pulse-Eight/platform /usr/src/platform \
|
||||
&& mkdir -p /usr/src/platform/build \
|
||||
&& cd /usr/src/platform/build \
|
||||
&& cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. \
|
||||
&& make \
|
||||
&& make install \
|
||||
&& cd /usr/src \
|
||||
&& rm -rf platform \
|
||||
&& git clone --depth 1 -b libcec-4.0.2 https://github.com/Pulse-Eight/libcec /usr/src/libcec \
|
||||
##
|
||||
# RPi support for HDMI-CEC on armhf/aarch64
|
||||
RUN if [ "$BUILD_ARCH" == "armhf" ]; then \
|
||||
apk add --no-cache raspberrypi-dev raspberrypi-libs; \
|
||||
elif [ "$BUILD_ARCH" == "aarch64" ]; then \
|
||||
apk add --no-cache --virtual .build-dependencies \
|
||||
cmake make g++ git linux-headers \
|
||||
&& git clone --depth 1 https://github.com/raspberrypi/userland /usr/src/userland \
|
||||
&& mkdir -p /usr/src/userland/build \
|
||||
&& cd /usr/src/userland/build \
|
||||
&& cmake \
|
||||
-DCMAKE_C_FLAGS="$CFLAGS -D_GNU_SOURCE -Wno-error=array-bounds" \
|
||||
-DCMAKE_BUILD_TYPE=Release -DARM64=True -DCMAKE_INSTALL_RPATH=/opt/vc/lib .. \
|
||||
&& make -j$(nproc) \
|
||||
&& make install \
|
||||
&& apk del .build-dependencies \
|
||||
&& rm -rf /usr/src/userland; \
|
||||
fi
|
||||
|
||||
##
|
||||
# Build libcec for HDMI-CEC
|
||||
ARG LIBCEC_VERSION
|
||||
RUN apk add --no-cache p8-platform \
|
||||
&& apk add --no-cache --virtual .build-dependencies \
|
||||
build-base cmake eudev-dev git swig raspberrypi-dev p8-platform-dev \
|
||||
&& git clone --depth 1 -b libcec-${LIBCEC_VERSION} https://github.com/Pulse-Eight/libcec /usr/src/libcec \
|
||||
&& mkdir -p /usr/src/libcec/build \
|
||||
&& cd /usr/src/libcec/build \
|
||||
&& if [ "$BUILD_ARCH" != "armhf" ]; then \
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ..; \
|
||||
else cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \
|
||||
-DRPI_INCLUDE_DIR=/opt/vc/include \
|
||||
-DRPI_LIB_DIR=/opt/vc/lib ..; fi \
|
||||
&& make \
|
||||
&& if [ "$BUILD_ARCH" != "armhf" ] && [ "$BUILD_ARCH" != "aarch64" ]; then \
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ..; \
|
||||
else \
|
||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
|
||||
-DRPI_INCLUDE_DIR=/opt/vc/include \
|
||||
-DRPI_LIB_DIR=/opt/vc/lib ..; \
|
||||
fi \
|
||||
&& make -j$(nproc) \
|
||||
&& make install \
|
||||
&& cd /usr/src \
|
||||
&& rm -rf libcec \
|
||||
&& apk del build-base cmake eudev-dev git swig \
|
||||
&& if [ "$BUILD_ARCH" == "armhf" ]; then \
|
||||
apk del raspberrypi-dev; fi
|
||||
&& apk del .build-dependencies \
|
||||
&& rm -rf /usr/src/libcec
|
||||
ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH}
|
||||
|
||||
# Copy data
|
||||
COPY run.sh /
|
||||
RUN chmod a+x /run.sh
|
||||
|
||||
WORKDIR /
|
||||
CMD [ "/run.sh" ]
|
||||
|
||||
5
cec_scan/build.json
Normal file
5
cec_scan/build.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"args": {
|
||||
"LIBCEC_VERSION": "4.0.3"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "CEC Scanner",
|
||||
"version": "0.2",
|
||||
"version": "1",
|
||||
"slug": "cec_scan",
|
||||
"description": "Scan HDMI CEC devices",
|
||||
"url": "https://home-assistant.io/addons/cec_scan/",
|
||||
|
||||
Reference in New Issue
Block a user