Skip to content

Commit

Permalink
Tools: install-prereqs-ubuntu.sh: add support for Ubuntu Noble (24.04)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed May 6, 2024
1 parent 06b7394 commit ca291b7
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions Tools/environment_install/install-prereqs-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ elif [ ${RELEASE_CODENAME} == 'mantic' ]; then
SITLCFML_VERSION="2.5"
PYTHON_V="python3"
PIP=pip3
elif [ ${RELEASE_CODENAME} == 'noble' ]; then
SITLFML_VERSION="2.6"
SITLCFML_VERSION="2.6"
PYTHON_V="python3"
PIP=pip3
elif [ ${RELEASE_CODENAME} == 'groovy' ] ||
[ ${RELEASE_CODENAME} == 'bullseye' ]; then
SITLFML_VERSION="2.5"
Expand Down Expand Up @@ -169,7 +174,8 @@ ARM_LINUX_PKGS="g++-arm-linux-gnueabihf $INSTALL_PKG_CONFIG"

if [ ${RELEASE_CODENAME} == 'bookworm' ] ||
[ ${RELEASE_CODENAME} == 'lunar' ] ||
[ ${RELEASE_CODENAME} == 'mantic' ]; then
[ ${RELEASE_CODENAME} == 'mantic' ] ||
[ ${RELEASE_CODENAME} == 'noble' ]; then
# on Lunar (and presumably later releases), we install in venv, below
PYTHON_PKGS+=" numpy pyparsing psutil"
SITL_PKGS="python3-dev"
Expand All @@ -181,7 +187,8 @@ fi
if [[ $SKIP_AP_GRAPHIC_ENV -ne 1 ]]; then
if [ ${RELEASE_CODENAME} == 'bookworm' ] ||
[ ${RELEASE_CODENAME} == 'lunar' ] ||
[ ${RELEASE_CODENAME} == 'mantic' ]; then
[ ${RELEASE_CODENAME} == 'mantic' ] ||
[ ${RELEASE_CODENAME} == 'noble' ]; then
PYTHON_PKGS+=" matplotlib scipy opencv-python pyyaml"
SITL_PKGS+=" xterm libcsfml-dev libcsfml-audio${SITLCFML_VERSION} libcsfml-dev libcsfml-graphics${SITLCFML_VERSION} libcsfml-network${SITLCFML_VERSION} libcsfml-system${SITLCFML_VERSION} libcsfml-window${SITLCFML_VERSION} libsfml-audio${SITLFML_VERSION} libsfml-dev libsfml-graphics${SITLFML_VERSION} libsfml-network${SITLFML_VERSION} libsfml-system${SITLFML_VERSION} libsfml-window${SITLFML_VERSION}"
else
Expand Down Expand Up @@ -274,7 +281,8 @@ elif [ ${RELEASE_CODENAME} == 'lunar' ]; then
SITL_PKGS+=" libpython3-stdlib" # for argparse
elif [ ${RELEASE_CODENAME} == 'buster' ]; then
SITL_PKGS+=" libpython3-stdlib" # for argparse
elif [ ${RELEASE_CODENAME} != 'mantic' ]; then
elif [ ${RELEASE_CODENAME} != 'mantic' ] &&
[ ${RELEASE_CODENAME} != 'noble' ]; then
SITL_PKGS+=" python-argparse"
fi

Expand All @@ -293,6 +301,9 @@ if [[ $SKIP_AP_GRAPHIC_ENV -ne 1 ]]; then
elif [ ${RELEASE_CODENAME} == 'mantic' ]; then
SITL_PKGS+=" libgtk-3-dev libwxgtk3.2-dev "
# see below
elif [ ${RELEASE_CODENAME} == 'noble' ]; then
SITL_PKGS+=" libgtk-3-dev libwxgtk3.2-dev "
# see below
elif apt-cache search python-wxgtk3.0 | grep wx; then
SITL_PKGS+=" python-wxgtk3.0"
elif apt-cache search python3-wxgtk4.0 | grep wx; then
Expand All @@ -312,7 +323,8 @@ if [[ $SKIP_AP_GRAPHIC_ENV -ne 1 ]]; then
PYTHON_PKGS+=" wxpython opencv-python"
SITL_PKGS+=" python3-wxgtk4.0"
SITL_PKGS+=" fonts-freefont-ttf libfreetype6-dev libpng16-16 libportmidi-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev" # for pygame
elif [ ${RELEASE_CODENAME} == 'mantic' ]; then
elif [ ${RELEASE_CODENAME} == 'mantic' ] ||
[ ${RELEASE_CODENAME} == 'noble' ]; then
PYTHON_PKGS+=" wxpython opencv-python"
SITL_PKGS+=" python3-wxgtk4.0"
SITL_PKGS+=" fonts-freefont-ttf libfreetype6-dev libpng16-16 libportmidi-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev" # for pygame
Expand Down Expand Up @@ -360,10 +372,17 @@ fi
PIP_USER_ARGUMENT="--user"

# create a Python venv on more recent releases:
PYTHON_VENV_PACKAGE=""
if [ ${RELEASE_CODENAME} == 'bookworm' ] ||
[ ${RELEASE_CODENAME} == 'lunar' ] ||
[ ${RELEASE_CODENAME} == 'mantic' ]; then
$APT_GET install python3.11-venv
PYTHON_VENV_PACKAGE=python3.11-venv
elif [ ${RELEASE_CODENAME} == 'noble' ]; then
PYTHON_VENV_PACKAGE=python3.12-venv
fi

if [ -n "$PYTHON_VENV_PACKAGE" ]; then
$APT_GET install $PYTHON_VENV_PACKAGE
python3 -m venv $HOME/venv-ardupilot

# activate it:
Expand All @@ -389,7 +408,8 @@ fi

if [ ${RELEASE_CODENAME} == 'bookworm' ] ||
[ ${RELEASE_CODENAME} == 'lunar' ] ||
[ ${RELEASE_CODENAME} == 'mantic' ]; then
[ ${RELEASE_CODENAME} == 'mantic' ] ||
[ ${RELEASE_CODENAME} == 'noble' ]; then
# must do this ahead of wxPython pip3 run :-/
$PIP install $PIP_USER_ARGUMENT -U attrdict3
fi
Expand Down

0 comments on commit ca291b7

Please sign in to comment.