split out dev apt dependencies (#32476)

* init

* add more extra packages

* update Dockerfile

* cleanup

* Update Dockerfile.openpilot_base

* needed to build

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: e0fa26b1a4
This commit is contained in:
macdoos 2024-05-21 02:35:33 +02:00 committed by GitHub
parent d9c8f22082
commit 52dbb6eae4
2 changed files with 30 additions and 17 deletions

View File

@ -13,14 +13,10 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
COPY tools/install_ubuntu_dependencies.sh /tmp/tools/
RUN cd /tmp && \
tools/install_ubuntu_dependencies.sh && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
# remove unused architectures from gcc for panda
RUN INSTALL_EXTRA_PACKAGES=no /tmp/tools/install_ubuntu_dependencies.sh && \
rm -rf /var/lib/apt/lists/* /tmp/* && \
cd /usr/lib/gcc/arm-none-eabi/9.2.1 && \
rm -rf arm/ && \
rm -rf thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp
rm -rf arm/ thumb/nofp thumb/v6* thumb/v8* thumb/v7+fp thumb/v7-r+fp.sp
# Add OpenCL
RUN apt-get update && apt-get install -y --no-install-recommends \
@ -83,4 +79,4 @@ RUN cd /tmp && \
rm -rf /home/$USER/pyenv/versions/3.11.4/lib/python3.11/test
USER root
RUN sudo git config --global --add safe.directory /tmp/openpilot
RUN sudo git config --global --add safe.directory /tmp/openpilot

View File

@ -12,21 +12,17 @@ if [[ ! $(id -u) -eq 0 ]]; then
SUDO="sudo"
fi
# Install packages present in all supported versions of Ubuntu
# Install common packages
function install_ubuntu_common_requirements() {
$SUDO apt-get update
$SUDO apt-get install -y --no-install-recommends \
autoconf \
build-essential \
ca-certificates \
casync \
clang \
cmake \
make \
cppcheck \
libtool \
gcc-arm-none-eabi \
bzip2 \
liblzma-dev \
libarchive-dev \
libbz2-dev \
@ -62,9 +58,7 @@ function install_ubuntu_common_requirements() {
opencl-headers \
ocl-icd-libopencl1 \
ocl-icd-opencl-dev \
clinfo \
portaudio19-dev \
qml-module-qtquick2 \
qtmultimedia5-dev \
qtlocation5-dev \
qtpositioning5-dev \
@ -75,7 +69,18 @@ function install_ubuntu_common_requirements() {
libqt5serialbus5-dev \
libqt5x11extras5-dev \
libqt5opengl5-dev \
libreadline-dev \
libreadline-dev
}
# Install extra packages
function install_extra_packages() {
echo "Installing extra packages..."
$SUDO apt-get install -y --no-install-recommends \
bzip2 \
clinfo \
casync \
cmake \
make \
libdw1
}
@ -125,7 +130,19 @@ if [ -f "/etc/os-release" ]; then
install_ubuntu_lts_latest_requirements
fi
esac
# Install extra packages
if [[ -z "$INSTALL_EXTRA_PACKAGES" ]]; then
read -p "Base setup done. Do you want to install extra development packages? [Y/n]: " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
INSTALL_EXTRA_PACKAGES="yes"
fi
fi
if [[ "$INSTALL_EXTRA_PACKAGES" == "yes" ]]; then
install_extra_packages
fi
else
echo "No /etc/os-release in the system"
echo "No /etc/os-release in the system. Make sure you're running on Ubuntu, or similar."
exit 1
fi