diff --git a/Dockerfile.agnos b/Dockerfile.agnos index 12901a85..77549cf9 100644 --- a/Dockerfile.agnos +++ b/Dockerfile.agnos @@ -29,6 +29,12 @@ COPY ./userspace/openpilot_dependencies.sh /tmp/agnos/ RUN /tmp/agnos/openpilot_dependencies.sh # Individual compiling images +FROM agnos-compiler AS agnos-compiler-pyqt5 +COPY ./userspace/openpilot_python_dependencies.sh /tmp/agnos/ +RUN /tmp/agnos/openpilot_python_dependencies.sh +COPY ./userspace/compile-pyqt5.sh /tmp/agnos/ +RUN /tmp/agnos/compile-pyqt5.sh + FROM agnos-compiler AS agnos-compiler-capnp COPY ./userspace/compile-capnp.sh /tmp/agnos/ RUN /tmp/agnos/compile-capnp.sh @@ -72,13 +78,16 @@ RUN /tmp/agnos/openpilot_python_dependencies.sh COPY --from=agnos-compiler-ffmpeg /tmp/ffmpeg.deb /tmp/ffmpeg.deb RUN cd /tmp && apt-get -o Dpkg::Options::="--force-overwrite" install -yq ./ffmpeg.deb +# Use pre-compiled PyQt5 wheel +COPY --from=agnos-compiler-pyqt5 /tmp/PyQt5-5.15.9/PyQt5-5.15.9-cp38-abi3-manylinux_2_17_aarch64.whl /tmp/PyQt5-5.15.9.whl + RUN export PATH="/usr/local/pyenv/bin:/usr/local/pyenv/shims:$PATH" && \ export PYENV_ROOT="/usr/local/pyenv" && \ eval "$(pyenv init -)" && \ eval "$(pyenv virtualenv-init -)" && \ export MAKEFLAGS="-j$(nproc)" && \ pip install pyqt5-sip==12.12.1 && \ - pip install pyqt5==5.15.9 --verbose --config-settings --confirm-license= && \ + pip install /tmp/PyQt5-5.15.9.whl --verbose --config-settings --confirm-license= && \ pyenv rehash # Install openpilot python packages diff --git a/userspace/compile-pyqt5.sh b/userspace/compile-pyqt5.sh new file mode 100755 index 00000000..9742bca1 --- /dev/null +++ b/userspace/compile-pyqt5.sh @@ -0,0 +1,16 @@ +#!/bin/bash -e + +# Use pyenv venv +export PATH="/usr/local/pyenv/bin:/usr/local/pyenv/shims:$PATH" +export PYENV_ROOT="/usr/local/pyenv" +eval "$(pyenv init -)" +eval "$(pyenv virtualenv-init -)" + +# Build PyQt5 wheel +cd /tmp +wget https://files.pythonhosted.org/packages/5c/46/b4b6eae1e24d9432905ef1d4e7c28b6610e28252527cdc38f2a75997d8b5/PyQt5-5.15.9.tar.gz +tar xf PyQt5-5.15.9.tar.gz +cd PyQt5-5.15.9 + +export MAKEFLAGS="-j$(nproc)" +pip wheel -w . --verbose --config-settings --confirm-license= .