wheel/Dockerfile.armhf

121 lines
3.7 KiB
Docker
Raw Normal View History

2020-11-30 02:11:50 +01:00
FROM ghcr.io/linuxserver/baseimage-alpine:arm32v7-3.12 as buildstage
2020-10-04 20:25:49 +02:00
# set version label
ARG BUILD_DATE
ARG VERSION
ARG HASS_RELEASE
ARG HACS_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="saarg"
# environment settings
ENV HOME="/tmp"
# install packages
2020-12-27 15:29:41 +01:00
# https://github.com/home-assistant/core/blob/11d74124cd06f48c1faf68df9a2ab9034130fafa/azure-pipelines-wheels.yml#L32
2020-10-04 20:25:49 +02:00
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
2020-12-27 15:29:41 +01:00
autoconf \
2020-10-04 20:25:49 +02:00
bluez-deprecated \
2020-12-27 15:29:41 +01:00
bluez-dev \
build-base \
ca-certificates \
cmake \
2020-10-04 20:25:49 +02:00
curl \
cython \
2020-12-27 15:29:41 +01:00
eudev-dev \
2020-10-04 20:25:49 +02:00
eudev-libs \
ffmpeg \
2020-12-27 15:29:41 +01:00
ffmpeg-dev \
2020-10-04 20:25:49 +02:00
g++ \
2020-12-27 15:29:41 +01:00
gcc \
git \
glib-dev \
jq \
2020-10-04 20:25:49 +02:00
libffi-dev \
libjpeg-turbo \
2020-12-27 15:29:41 +01:00
libjpeg-turbo-dev \
2020-10-04 20:25:49 +02:00
libstdc++ \
2020-12-27 15:29:41 +01:00
libxml2-dev \
2020-10-04 20:25:49 +02:00
libxslt \
2020-12-27 15:29:41 +01:00
libxslt-dev \
linux-headers \
2020-10-04 20:25:49 +02:00
make \
openssl \
2020-12-27 15:29:41 +01:00
openssl-dev \
2020-10-04 20:25:49 +02:00
py3-pip \
2020-12-27 15:29:41 +01:00
py3-wheel \
2020-10-04 20:25:49 +02:00
python3 \
python3-dev \
2020-12-27 15:29:41 +01:00
sudo \
unzip
2020-10-04 20:25:49 +02:00
RUN \
echo "**** find packages to build for homeassistant ****" && \
mkdir -p \
2020-12-27 15:29:41 +01:00
/tmp/core && \
if [ -z ${HASS_RELEASE+x} ]; then \
HASS_RELEASE=$(curl -sX GET https://api.github.com/repos/home-assistant/core/releases/latest \
| jq -r .tag_name); \
2020-10-04 20:25:49 +02:00
fi && \
curl -o \
/tmp/core.tar.gz -L \
2020-12-27 15:29:41 +01:00
"https://github.com/home-assistant/core/archive/${HASS_RELEASE}.tar.gz" && \
2020-10-04 20:25:49 +02:00
tar xf \
/tmp/core.tar.gz -C \
2020-12-27 15:29:41 +01:00
/tmp/core --strip-components=1
2020-10-04 20:25:49 +02:00
RUN \
echo "**** make folders for building wheels and upgrade pip ****" && \
mkdir -p \
2020-12-27 15:29:41 +01:00
/build/addons \
/build/core && \
2020-10-04 20:25:49 +02:00
pip3 install --no-cache-dir --upgrade \
2020-12-27 15:29:41 +01:00
pip==20.3 # https://github.com/home-assistant/core/pull/43771
2020-10-04 20:25:49 +02:00
RUN \
echo "**** build wheels for home assistant core ****" && \
2020-12-27 15:29:41 +01:00
awk '/# Home Assistant Core/,/^$/' /tmp/core/requirements_all.txt > /tmp/requirements_hass.txt && \
2020-10-04 20:25:49 +02:00
awk '/# homeassistant.components.trend/,/^$/' /tmp/core/requirements_all.txt >> /tmp/requirements_hass.txt && \
2020-12-27 15:29:41 +01:00
sed -i "s/-r requirements.txt/-r \/tmp\/core\/requirements.txt/g" /tmp/requirements_hass.txt && \
pip3 wheel --wheel-dir=/build/core --no-cache-dir --use-deprecated=legacy-resolver \
-r /tmp/requirements_hass.txt
2020-10-04 20:25:49 +02:00
2020-12-27 15:29:41 +01:00
# https://github.com/home-assistant/core/issues/43934 >> https://github.com/home-assistant/core/pull/36330
2020-10-04 20:25:49 +02:00
RUN \
echo "**** build wheels for home assistant addons ****" && \
sed -i "s/-r requirements_test.txt/-r \/tmp\/core\/requirements_test.txt/g" /tmp/core/requirements_test_all.txt && \
sed -i "s/-r requirements_test_pre_commit.txt/-r \/tmp\/core\/requirements_test_pre_commit.txt/g" /tmp/core/requirements_test.txt && \
2020-12-27 15:29:41 +01:00
pip3 wheel --wheel-dir /build/addons --no-cache-dir --find-links=/build/core --use-deprecated=legacy-resolver \
-r /tmp/core/requirements_test_all.txt
2020-10-04 20:25:49 +02:00
RUN \
echo "**** install dependencies for hacs.xyz ****" && \
if [ -z ${HACS_RELEASE+x} ]; then \
2020-12-27 15:29:41 +01:00
HACS_RELEASE=$(curl -sX GET "https://api.github.com/repos/hacs/integration/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
2020-10-04 20:25:49 +02:00
fi && \
mkdir -p \
2020-12-27 15:29:41 +01:00
/build/hacs \
/tmp/hacs-source && \
2020-10-04 20:25:49 +02:00
curl -o \
2020-12-27 15:29:41 +01:00
/tmp/hacs.tar.gz -L \
"https://github.com/hacs/integration/archive/${HACS_RELEASE}.tar.gz" && \
2020-10-04 20:25:49 +02:00
tar xf \
2020-12-27 15:29:41 +01:00
/tmp/hacs.tar.gz -C \
/tmp/hacs-source --strip-components=1 && \
pip3 wheel --wheel-dir=/build/hacs --no-cache-dir --find-links=/build/core --find-links=/build/addons --use-deprecated=legacy-resolver \
-r /tmp/hacs-source/requirements.txt
2020-10-04 20:25:49 +02:00
RUN \
mkdir -p \
2020-12-27 15:29:41 +01:00
/tmp/repo && \
2020-10-04 20:25:49 +02:00
mv /build/addons/* /tmp/repo/ && \
mv /build/core/* /tmp/repo/ && \
2020-11-30 02:11:50 +01:00
mv /build/hacs/* /tmp/repo/
2020-10-04 20:25:49 +02:00
2020-11-30 02:11:50 +01:00
FROM scratch
2020-12-27 15:29:41 +01:00
COPY --from=buildstage /tmp/repo /