Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
Support for Raspberrypi3+ (#63)
Browse files Browse the repository at this point in the history
* Create raspberrypi3-64

* Update README.md

* Update raspberrypi3-64

* Update raspberrypi3-64

* Update raspberrypi3-64

* Update raspberrypi3-64
  • Loading branch information
pvizeli committed Mar 17, 2018
1 parent c4109b3 commit cfe72e5
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
72 changes: 72 additions & 0 deletions homeassistant/machine/raspberrypi3-64
@@ -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
1 change: 1 addition & 0 deletions install/README.md
Expand Up @@ -33,6 +33,7 @@ curl -sL https://raw.githubusercontent.com/home-assistant/hassio-build/master/in
- raspberrypi
- raspberrypi2
- raspberrypi3
- raspberrypi3-64
- qemuarm
- qemuarm-64
- qemux86-64
Expand Down

0 comments on commit cfe72e5

Please sign in to comment.