diff --git a/generic/Dockerfile b/generic/Dockerfile index b17dedec19..a402389809 100644 --- a/generic/Dockerfile +++ b/generic/Dockerfile @@ -34,6 +34,7 @@ RUN apk add --no-cache \ && pip3 install --no-cache-dir -r homeassistant/requirements_all.txt -c homeassistant/homeassistant/package_constraints.txt \ && pip3 install --no-cache-dir ./homeassistant \ && apk del .build-dependencies \ + && cp -f homeassistant/requirements_all.txt /root/ \ && rm -r homeassistant # Run Home Assistant diff --git a/machine/raspberrypi b/machine/raspberrypi index 60120567b6..6ac2a7c0da 100644 --- a/machine/raspberrypi +++ b/machine/raspberrypi @@ -34,8 +34,9 @@ ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH} ## # Install DHT RUN apk add --no-cache --virtual .build-dependencies \ - gcc libc-dev git \ - && git clone --depth 1 -b 1.3.4 https://github.com/adafruit/Adafruit_Python_DHT /usr/src/dht \ + gcc libc-dev git raspberrypi-dev \ + && export DHT_VERSION="$(cat /root/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 \ diff --git a/machine/raspberrypi2 b/machine/raspberrypi2 index 59ef488403..20b9661a49 100644 --- a/machine/raspberrypi2 +++ b/machine/raspberrypi2 @@ -34,8 +34,9 @@ ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH} ## # Install DHT RUN apk add --no-cache --virtual .build-dependencies \ - gcc libc-dev git \ - && git clone --depth 1 -b 1.3.4 https://github.com/adafruit/Adafruit_Python_DHT /usr/src/dht \ + gcc libc-dev git raspberrypi-dev \ + && export DHT_VERSION="$(cat /root/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 \ diff --git a/machine/raspberrypi3 b/machine/raspberrypi3 index e580e783b8..65f307cd7f 100644 --- a/machine/raspberrypi3 +++ b/machine/raspberrypi3 @@ -34,8 +34,9 @@ ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH} ## # Install DHT RUN apk add --no-cache --virtual .build-dependencies \ - gcc libc-dev git \ - && git clone --depth 1 -b 1.3.4 https://github.com/adafruit/Adafruit_Python_DHT /usr/src/dht \ + gcc libc-dev git raspberrypi-dev \ + && export DHT_VERSION="$(cat /root/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 \ diff --git a/machine/raspberrypi3-64 b/machine/raspberrypi3-64 index 6c62811778..d69e64850d 100644 --- a/machine/raspberrypi3-64 +++ b/machine/raspberrypi3-64 @@ -35,7 +35,8 @@ ENV LD_LIBRARY_PATH=/opt/vc/lib:${LD_LIBRARY_PATH} # Install DHT RUN apk add --no-cache --virtual .build-dependencies \ gcc libc-dev git raspberrypi-dev \ - && git clone --depth 1 -b 1.3.4 https://github.com/adafruit/Adafruit_Python_DHT /usr/src/dht \ + && export DHT_VERSION="$(cat /root/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 \