This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create raspberrypi3-64 * Update README.md * Update raspberrypi3-64 * Update raspberrypi3-64 * Update raspberrypi3-64 * Update raspberrypi3-64
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
ARG BUILD_VERSION | ||
FROM homeassistant/aarch64-homeassistant:$BUILD_VERSION | ||
|
||
RUN apk --no-cache add usbutils | ||
|
||
## | ||
# Build Raspberry userland | ||
RUN 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 \ | ||
&& make install \ | ||
&& apk del .build-dependencies \ | ||
&& rm -rf /usr/src/userland | ||
|
||
## | ||
# Set symlinks for raspberry pi binaries. | ||
RUN ln -sv /opt/vc/bin/raspistill /usr/local/bin/raspistill \ | ||
&& ln -sv /opt/vc/bin/raspivid /usr/local/bin/raspivid \ | ||
&& ln -sv /opt/vc/bin/raspividyuv /usr/local/bin/raspividyuv \ | ||
&& ln -sv /opt/vc/bin/raspiyuv /usr/local/bin/raspiyuv | ||
|
||
## | ||
# Build libcec with RPi support for HDMI-CEC | ||
RUN apk del libcec \ | ||
&& apk add --no-cache build-base cmake eudev-dev git \ | ||
python3-dev swig \ | ||
&& 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 \ | ||
&& mkdir -p /usr/src/libcec/build \ | ||
&& cd /usr/src/libcec/build \ | ||
&& cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \ | ||
-DRPI_INCLUDE_DIR=/opt/vc/include \ | ||
-DRPI_LIB_DIR=/opt/vc/lib \ | ||
-DPYTHON_LIBRARY="/usr/lib/libpython3.6m.so" \ | ||
-DPYTHON_INCLUDE_DIR="/usr/include/python3.6m" .. \ | ||
&& make \ | ||
&& make install \ | ||
&& echo "cec" > "/usr/lib/python3.6/site-packages/cec.pth" \ | ||
&& cd /usr/src \ | ||
&& rm -rf libcec \ | ||
&& apk del build-base cmake eudev-dev git \ | ||
python3-dev swig | ||
ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH} | ||
|
||
## | ||
# Install DHT | ||
RUN apk add --no-cache gcc libc-dev python3-dev \ | ||
&& curl -L "https://github.com/adafruit/Adafruit_Python_DHT/archive/da8cddf7fb629c1ef4f046ca44f42523c9cf2d11.zip#Adafruit_DHT==1.3.2" \ | ||
-o /usr/src/Adafruit_DHT-1.3.2.zip \ | ||
&& cd /usr/src \ | ||
&& unzip Adafruit_DHT-1.3.2.zip \ | ||
&& cd Adafruit_Python_DHT-da8cddf7fb629c1ef4f046ca44f42523c9cf2d11 \ | ||
&& sed -i 's/^pi_version\ =\ None/pi_version\ =\ 3/' setup.py \ | ||
&& sed -i 's/^platform\ =\ platform_detect.UNKNOWN/platform\ =\ platform_detect.RASPBERRY_PI/' setup.py \ | ||
&& sed -i 's/platform\ =\ platform_detect.platform_detect()/pass/' \ | ||
setup.py \ | ||
&& pip3 install . \ | ||
&& apk del gcc libc-dev python3-dev \ | ||
&& cd /usr/src \ | ||
&& rm -rf Adafruit_Python_DHT-da8cddf7fb629c1ef4f046ca44f42523c9cf2d11 \ | ||
Adafruit_DHT-1.3.2.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters