From f463bb5990ee8a70be3665e96c4486fed2fe29d5 Mon Sep 17 00:00:00 2001 From: Garrett Brown Date: Tue, 19 Mar 2024 16:26:26 +0100 Subject: [PATCH] tooling: Updte build scripts for latest macOS --- oasis_tooling/scripts/build_ros2_desktop.sh | 26 ++++++------- .../scripts/depinstall_ros2_desktop.sh | 39 ++++++++++++------- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/oasis_tooling/scripts/build_ros2_desktop.sh b/oasis_tooling/scripts/build_ros2_desktop.sh index c7908496..889cc03f 100755 --- a/oasis_tooling/scripts/build_ros2_desktop.sh +++ b/oasis_tooling/scripts/build_ros2_desktop.sh @@ -37,20 +37,20 @@ CMAKE_PREFIX_PATH= if [[ "${OSTYPE}" == "darwin"* ]]; then COLCON_FLAGS+=" --packages-skip-by-dep python_qt_binding" CMAKE_PREFIX_PATH="$(brew --prefix qt@5)/lib/cmake/Qt5" -fi - -# Add ccache support -COLCON_FLAGS+=" \ - --cmake-args \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -" +else + # Add ccache support and fix locating Python + COLCON_FLAGS+=" \ + --cmake-args \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + " -# Skip Qt dependencies, Shiboken is too old on Ubuntu 18.04 -COLCON_FLAGS+=" \ - --packages-ignore \ - qt_gui_cpp \ - rqt_gui_cpp \ -" + # Skip Qt dependencies, Shiboken is too old on Ubuntu 18.04 + COLCON_FLAGS+=" \ + --packages-ignore \ + qt_gui_cpp \ + rqt_gui_cpp \ + " +fi # Uncomment these to force building in serial #MAKE_FLAGS+=" -j1 -l1" diff --git a/oasis_tooling/scripts/depinstall_ros2_desktop.sh b/oasis_tooling/scripts/depinstall_ros2_desktop.sh index debfa1e5..c3d319c7 100755 --- a/oasis_tooling/scripts/depinstall_ros2_desktop.sh +++ b/oasis_tooling/scripts/depinstall_ros2_desktop.sh @@ -125,13 +125,18 @@ fi if [[ "${OSTYPE}" == "darwin"* ]]; then brew update + # Install build utilities + brew install \ + ccache \ + wget \ + + # Install ROS dependencies # Note: qt@6 causes problems with rviz_rendering, make sure qt@6 isn't installed brew install \ asio \ assimp \ bison \ bullet \ - ccache \ cmake \ console_bridge \ cppcheck \ @@ -139,9 +144,9 @@ if [[ "${OSTYPE}" == "darwin"* ]]; then eigen \ freetype \ graphviz \ - log4cxx \ opencv \ openssl \ + orocos-kdl \ pcre \ poco \ pyqt5 \ @@ -151,12 +156,13 @@ if [[ "${OSTYPE}" == "darwin"* ]]; then spdlog \ tinyxml \ tinyxml2 \ - wget \ + # Update Python utilities python3 -m pip install --upgrade \ pip \ setuptools \ + # Install ROS Python dependencies python3 -m pip install --upgrade \ argcomplete \ catkin_pkg \ @@ -165,7 +171,7 @@ if [[ "${OSTYPE}" == "darwin"* ]]; then cryptography \ empy \ flake8 \ - flake8-blind-except \ + flake8-blind-except==0.1.1 \ flake8-builtins \ flake8-class-newline \ flake8-comprehensions \ @@ -173,30 +179,31 @@ if [[ "${OSTYPE}" == "darwin"* ]]; then flake8-docstrings \ flake8-import-order \ flake8-quotes \ - ifcfg \ importlib-metadata \ - lark-parser \ + jsonschema \ + lark==1.1.1 \ lxml \ matplotlib \ mock \ - mypy==0.761 \ + mypy==0.931 \ netifaces \ nose \ pep8 \ psutil \ pydocstyle \ pydot \ - pyparsing \ + pyparsing==2.4.7 \ pytest-mock \ rosdep \ rosdistro \ + setuptools==59.6.0 \ vcstool \ GRAPHVIZ_VERSION=$(brew list --version | grep graphviz | cut -d " " -f 2) python3 -m pip install --upgrade \ --global-option=build_ext \ - --global-option="-I/usr/local/Cellar/graphviz/${GRAPHVIZ_VERSION}/include" \ - --global-option="-L/usr/local/Cellar/graphviz/${GRAPHVIZ_VERSION}/lib" \ + --global-option="-I$(brew --prefix)/Cellar/graphviz/${GRAPHVIZ_VERSION}/include" \ + --global-option="-L$(brew --prefix)/Cellar/graphviz/${GRAPHVIZ_VERSION}/lib" \ pygraphviz fi @@ -208,11 +215,13 @@ fi mkdir -p "${ROS2_SOURCE_DIRECTORY}" mkdir -p "${ROS2_INSTALL_DIRECTORY}" -# After updating to Ubuntu 22.04, ament packages couldn't be found because -# they were installed to a different directory -if [ ! -L "${AMENT_INSTALL_DIRECTORY}" ]; then - rm -rf "${AMENT_INSTALL_DIRECTORY}" - ln -s "${ROS2_INSTALL_DIRECTORY}" "${AMENT_INSTALL_DIRECTORY}" +if [[ "${OSTYPE}" != "darwin"* ]]; then + # After updating to Ubuntu 22.04, ament packages couldn't be found because + # they were installed to a different directory + if [ ! -L "${AMENT_INSTALL_DIRECTORY}" ]; then + rm -rf "${AMENT_INSTALL_DIRECTORY}" + ln -s "${ROS2_INSTALL_DIRECTORY}" "${AMENT_INSTALL_DIRECTORY}" + fi fi #