Skip to content

Commit

Permalink
Remove DHT from Raspberry Pi machine builds (home-assistant#49829)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Apr 28, 2021
1 parent 105504c commit 14af6d3
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 91 deletions.
15 changes: 0 additions & 15 deletions machine/raspberrypi
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,3 @@ RUN apk add --no-cache \
&& apk del .build-dependencies \
&& rm -rf /usr/src/libcec
ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH}

##
# Install DHT
RUN apk add --no-cache --virtual .build-dependencies \
gcc libc-dev raspberrypi-dev \
&& export DHT_VERSION="$(cat /usr/src/homeassistant/requirements_all.txt | sed -n 's|.*Adafruit-DHT==\([0-9\.]*\).*|\1|p')" \
&& git clone --depth 1 -b ${DHT_VERSION} https://github.com/adafruit/Adafruit_Python_DHT /usr/src/dht \
&& cd /usr/src/dht \
&& sed -i 's/^pi_version\ =\ None/pi_version\ =\ 1/' 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 \
&& export MAKEFLAGS="-j$(nproc)" \
&& pip3 install . \
&& apk del .build-dependencies \
&& rm -rf /usr/src/dht
15 changes: 0 additions & 15 deletions machine/raspberrypi2
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,3 @@ RUN apk add --no-cache \
&& apk del .build-dependencies \
&& rm -rf /usr/src/libcec
ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH}

##
# Install DHT
RUN apk add --no-cache --virtual .build-dependencies \
gcc libc-dev raspberrypi-dev \
&& export DHT_VERSION="$(cat /usr/src/homeassistant/requirements_all.txt | sed -n 's|.*Adafruit-DHT==\([0-9\.]*\).*|\1|p')" \
&& git clone --depth 1 -b ${DHT_VERSION} https://github.com/adafruit/Adafruit_Python_DHT /usr/src/dht \
&& cd /usr/src/dht \
&& sed -i 's/^pi_version\ =\ None/pi_version\ =\ 2/' 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 \
&& export MAKEFLAGS="-j$(nproc)" \
&& pip3 install . \
&& apk del .build-dependencies \
&& rm -rf /usr/src/dht
15 changes: 0 additions & 15 deletions machine/raspberrypi3
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,3 @@ RUN apk add --no-cache \
&& apk del .build-dependencies \
&& rm -rf /usr/src/libcec
ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH}

##
# Install DHT
RUN apk add --no-cache --virtual .build-dependencies \
gcc libc-dev raspberrypi-dev \
&& export DHT_VERSION="$(cat /usr/src/homeassistant/requirements_all.txt | sed -n 's|.*Adafruit-DHT==\([0-9\.]*\).*|\1|p')" \
&& git clone --depth 1 -b ${DHT_VERSION} https://github.com/adafruit/Adafruit_Python_DHT /usr/src/dht \
&& cd /usr/src/dht \
&& 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 \
&& export MAKEFLAGS="-j$(nproc)" \
&& pip3 install . \
&& apk del .build-dependencies \
&& rm -rf /usr/src/dht
15 changes: 0 additions & 15 deletions machine/raspberrypi3-64
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,3 @@ RUN apk add --no-cache \
&& apk del .build-dependencies \
&& rm -rf /usr/src/libcec
ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH}

##
# Install DHT
RUN apk add --no-cache --virtual .build-dependencies \
gcc libc-dev raspberrypi-dev \
&& export DHT_VERSION="$(cat /usr/src/homeassistant/requirements_all.txt | sed -n 's|.*Adafruit-DHT==\([0-9\.]*\).*|\1|p')" \
&& git clone --depth 1 -b ${DHT_VERSION} https://github.com/adafruit/Adafruit_Python_DHT /usr/src/dht \
&& cd /usr/src/dht \
&& 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 \
&& export MAKEFLAGS="-j$(nproc)" \
&& pip3 install . \
&& apk del .build-dependencies \
&& rm -rf /usr/src/dht
15 changes: 0 additions & 15 deletions machine/raspberrypi4
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,3 @@ RUN apk add --no-cache \
&& apk del .build-dependencies \
&& rm -rf /usr/src/libcec
ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH}

##
# Install DHT
RUN apk add --no-cache --virtual .build-dependencies \
gcc libc-dev raspberrypi-dev \
&& export DHT_VERSION="$(cat /usr/src/homeassistant/requirements_all.txt | sed -n 's|.*Adafruit-DHT==\([0-9\.]*\).*|\1|p')" \
&& git clone --depth 1 -b ${DHT_VERSION} https://github.com/adafruit/Adafruit_Python_DHT /usr/src/dht \
&& cd /usr/src/dht \
&& 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 \
&& export MAKEFLAGS="-j$(nproc)" \
&& pip3 install . \
&& apk del .build-dependencies \
&& rm -rf /usr/src/dht
15 changes: 0 additions & 15 deletions machine/raspberrypi4-64
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,3 @@ RUN apk add --no-cache \
&& apk del .build-dependencies \
&& rm -rf /usr/src/libcec
ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH}

##
# Install DHT
RUN apk add --no-cache --virtual .build-dependencies \
gcc libc-dev raspberrypi-dev \
&& export DHT_VERSION="$(cat /usr/src/homeassistant/requirements_all.txt | sed -n 's|.*Adafruit-DHT==\([0-9\.]*\).*|\1|p')" \
&& git clone --depth 1 -b ${DHT_VERSION} https://github.com/adafruit/Adafruit_Python_DHT /usr/src/dht \
&& cd /usr/src/dht \
&& 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 \
&& export MAKEFLAGS="-j$(nproc)" \
&& pip3 install . \
&& apk del .build-dependencies \
&& rm -rf /usr/src/dht
1 change: 0 additions & 1 deletion script/gen_requirements_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

COMMENT_REQUIREMENTS = (
"Adafruit_BBIO",
"Adafruit-DHT",
"avea", # depends on bluepy
"avion",
"beacontools",
Expand Down

0 comments on commit 14af6d3

Please sign in to comment.