Skip to content

Commit

Permalink
Build PyQt5 wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-reckmann committed Aug 10, 2024
1 parent ba34182 commit 453c200
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Dockerfile.agnos
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions userspace/compile-pyqt5.sh
Original file line number Diff line number Diff line change
@@ -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= .

0 comments on commit 453c200

Please sign in to comment.