Skip to content

Commit

Permalink
Update CEC Add-on (home-assistant#2240)
Browse files Browse the repository at this point in the history
* Update CEC Add-on

* cleanup patch

* second cleanup

* fix s6 copy

* set S0 for this kind of finish

* Update cec_scan/CHANGELOG.md

Co-authored-by: Stefan Agner <[email protected]>

Co-authored-by: Stefan Agner <[email protected]>
  • Loading branch information
pvizeli and agners authored Oct 21, 2021
1 parent 9ba546a commit b299ceb
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 940 deletions.
6 changes: 6 additions & 0 deletions cec_scan/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 3.0

- Using the Upstream Linux support only
- Using s6-overlay style
- Update to Alpine 3.14

## 2.4

- Use new `video` feature of Supervisor 199
Expand Down
52 changes: 11 additions & 41 deletions cec_scan/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
ARG BUILD_FROM
FROM $BUILD_FROM

# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Meta
WORKDIR /usr/src
ARG BUILD_ARCH
ARG LIBCEC_VERSION

# Build libcec for HDMI-CEC
COPY data/libcec.patch /usr/src/
ARG LIBCEC_VERSION
WORKDIR /usr/src
RUN \
if [[ "armhf armv7 aarch64" = *"$BUILD_ARCH"* ]]; then \
apk add --no-cache raspberrypi-dev raspberrypi-libs; \
fi \
&& apk add --no-cache \
apk add --no-cache \
eudev-libs\
p8-platform \
&& apk add --no-cache --virtual .build-dependencies \
Expand All @@ -27,38 +17,18 @@ RUN \
swig \
linux-headers \
&& git clone --depth 1 -b libcec-${LIBCEC_VERSION} \
"https://github.com/Pulse-Eight/libcec" /usr/src/libcec \
&& cd /usr/src/libcec \
&& git apply /usr/src/libcec.patch \
&& mkdir -p /usr/src/libcec/build \
&& cd /usr/src/libcec/build \
&& if [[ "armhf armv7 aarch64" = *"$BUILD_ARCH"* ]]; then \
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
-DRPI_INCLUDE_DIR=/opt/vc/include \
-DRPI_LIB_DIR=/opt/vc/lib \
-DHAVE_EXYNOS_API=1 \
-DHAVE_AOCEC_API=1 \
-DHAVE_LINUX_API=1 \
..; \
else \
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
-DHAVE_LINUX_API=1 \
..; \
fi \
"https://github.com/Pulse-Eight/libcec" libcec \
&& mkdir -p libcec/build \
&& cd libcec/build \
&& cmake \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local \
-DHAVE_LINUX_API=1 \
.. \
&& make -j$(nproc) \
&& make install \
&& apk del --no-cache .build-dependencies \
&& if [[ "armhf armv7 aarch64" = *"$BUILD_ARCH"* ]]; then \
apk del --no-cache raspberrypi-dev; \
fi \
&& rm -rf /usr/src/*

ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH}

# Copy data
COPY data/run.sh /

WORKDIR /
CMD [ "/run.sh" ]
COPY rootfs /
12 changes: 6 additions & 6 deletions cec_scan/build.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"build_from": {
"aarch64": "homeassistant/aarch64-base:3.11",
"amd64": "homeassistant/amd64-base:3.11",
"armhf": "homeassistant/armhf-base:3.11",
"armv7": "homeassistant/armv7-base:3.11",
"i386": "homeassistant/i386-base:3.11"
"aarch64": "homeassistant/aarch64-base:3.14",
"amd64": "homeassistant/amd64-base:3.14",
"armhf": "homeassistant/armhf-base:3.14",
"armv7": "homeassistant/armv7-base:3.14",
"i386": "homeassistant/i386-base:3.14"
},
"args": {
"LIBCEC_VERSION": "4.0.3"
"LIBCEC_VERSION": "6.0.2"
}
}
2 changes: 1 addition & 1 deletion cec_scan/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CEC Scanner",
"version": "2.4",
"version": "3.0",
"slug": "cec_scan",
"description": "Scan for HDMI CEC devices",
"url": "https://github.com/home-assistant/hassio-addons/tree/master/cec_scan",
Expand Down
Loading

0 comments on commit b299ceb

Please sign in to comment.