diff --git a/.gitignore b/.gitignore index 9e37669..4ae898f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ *_ws +.DS_Store +/tango-icon-theme-0.8.90 +/tango-icon-theme-0.8.90.tar.gz diff --git a/README.md b/README.md index be94aee..c663948 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,67 @@ -ros-install-osx [![Build Status](https://travis-ci.org/mikepurvis/ros-install-osx.svg?branch=master)](https://travis-ci.org/mikepurvis/ros-install-osx) +ros-install-osx =============== -This repo aims to maintain a usable, scripted, up-to-date installation procedure for -[ROS](http://ros.org), currently Lunar. The intent is that the `install` script may -be executed on a El Capitan or newer machine and produce a working desktop_full -installation, including RQT, rviz, and Gazebo. +* This commonly breaks depending on what gets pushed over brew and whether the corresponding packages update deprecated code. Efforts have been made to pick out working versions of specific packages, but nothing is guaranteed. -This is the successor to my [popular gist on the same topic][1]. +This repo aims to maintain a usable, scripted, up-to-date installation procedure for [ROS](http://ros.org), currently melodic. The intent is that the `install` script may be executed on a Catalina or newer machine and produce a working desktop_full installation, including RQT, rviz, and Gazebo. -[1]: https://gist.github.com/mikepurvis/9837958 +This is the successor to the [popular gist on the same topic][1]. Also thanks to [Boris Gromov](https://gist.github.com/bgromov) for [his helpful gist](https://gist.github.com/bgromov/23a74bbe846d965964b150080cb2d574). +## Current Status + +**Note: This should work as of Jan 22, 2021 on macOS Big Sur 11.1**. **Only ROS Noetic is supported.** + +Required software versions (installed via script): + +* **Boost**: 1.73 +* **Opencv**: 4.5 +* **Python**: 3.8 Usage ----- -```shell -git clone https://github.com/mikepurvis/ros-install-osx.git -cd ros-install-osx -./install -``` +The `install` script should just work for most users, although you may need to run it multiple times. Run these steps first to have a better chance of success: + +1. [Disable system integrity protection](https://www.imore.com/how-turn-system-integrity-protection-macos). + +2. If on Catalina, set your terminal back to bash. This is very helpful for building software via brew, and roslaunch will not autocomplete using zsh. + + ```bash + chsh -s /bin/bash + ``` + +3. Attempting to clone this repo onto your machine should trigger the xcode command line tools to download. + + ```bash + xcode-select --install + git clone https://github.com/smnogar/ros-install-osx.git + cd ros-install-osx + ``` + +4. Install brew + + ```bash + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile + source ~/.bash_profile + brew doctor + ``` + +5. Install xquartz + + ```bash + brew cask install xquartz + ``` + +6. Run: `./install` + +7. After it completes successfully, add the following to your bash_profile: + + ```bash + cat bash_profile_recommendations.sh >> ~/.bash_profile + ``` + + Note that if you do not yet have XQuartz installed, you will be forced to log out and in after that installation, and re-run this script. @@ -36,23 +79,6 @@ installed, rosdep is already installed and initialized, and you set the `ROS_INS environment variable to a path which already exists and you have write access to. -Step by Step ------------- - -The `install` script should just work for most users. However, if you run into trouble, -it's a pretty big pain to rebuild everything. Note that in this scenario, it may make -sense to treat the script as a list of instructions, and execute them one by one, -manually. - -If you have a build fail, for example with rviz, note that you can modify the `catkin build` -line to start at a particular package. Inside your `indigo_desktop_full_ws` dir, run: - - catkin build --start-with rviz - -If you've resolved whatever issue stopped the build previously, this will pick up where -it left off. - - ## Troubleshooting ### Python and pip packages @@ -89,7 +115,7 @@ If you are getting permission errors when you `sudo uninstall` pip packages, see [Issue #11](https://github.com/mikepurvis/ros-install-osx/issues/11) and [this StackOverflow Q&A](http://stackoverflow.com/a/35051066/2653356). -### El Capitan support +### El Capitan (and newer) support The `install` script may not work as smoothly in OS X El Capitan. Here are some pointers, tips, and hacks to help you complete the installation. @@ -128,3 +154,133 @@ have [System Integrity Protection](https://support.apple.com/en-us/HT204899) ena The installation script should have detected that and *suggested* a quick fix. Please refer to the very last section of [`install`](https://github.com/mikepurvis/ros-install-osx/blob/master/install) + +**It is strongly recommended to disable SIP** + +#### Assorted notes + +Below are assorted tips that I have compiled for fixing any issues that can crop up. + +* It is basically impossible to get indigo to work on macOS sierra + + * This has to do with home-brew dropping qt4 support: https://github.com/mikepurvis/ros-install-osx/issues/63 + +* rosdep —skip-keys command is useful for resolving dependencies + + * rosdep check --from-paths src --ignore-src --rosdistro kinetic --skip-keys geographiclib --skip-keys geographiclib-tools + +* Indigo still doesn’t work using qt@4 + + * Can’t detect correct qt installation + +* Important steps to get kinetic to work (all of these are critical): + * Make sure using brew python/pip + * Rviz needs ogre1.9 + +* Gazebo8 + + * Uses Ogre1.9 + +* High Sierra + * Make sure to set `ROS_MASTER_URI` to the actual machine name + * Otherwise significant delays exist in running especially python based commands + +* If having QT errors compiling look at the end of this thread: + * https://github.com/Homebrew/legacy-homebrew/issues/29938 + * Basically add path + +* Command for updating pip if getting weird python errors + + * pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U + +* If you start getting weird errors with accessing too many files, try: + * `ulimit -n 4096` + * See [here](https://superuser.com/questions/433746/is-there-a-fix-for-the-too-many-open-files-in-system-error-on-os-x-10-7-1) for details + * or + * `sudo sysctl -w kern.maxfiles=99999` + * `sudo sysctl -w kern.maxfilesperproc=99999` + * `ulimit -n 65536` + +* [If running out of pty devices](https://codybonney.com/increase-the-max-number-of-ptys-on-os-x-10-8-3/) + + * `sudo sysctl -w kern.tty.ptmx_max=999` + +* image_publisher currently fails. [See this fix](https://github.com/ros-perception/image_pipeline/pull/304) + +* For Gazebo plugins, don't forget to setup `/opt/ros/kinetic/lib` in `GAZEBO_PLUGIN_PATH` and to export it into env + +* mavros/mavlink + + * [workaround to get mavros to compile (endian.h) errors] (https://github.com/mavlink/mavros/issues/851) + +* If errors are encountered such as: + + ``` + Errors << qt_gui_cpp:cmake /Users/steve/Documents_local/temp/kinetic/logs/qt_gui_cpp/build.cmake.000.log + CMake Error at /Users/steve/Documents/ARL/Snapdragon/ros-install-osx/kinetic_desktop_full_ws/src/qt_gui_core/qt_gui_cpp/src/qt_gui_cpp/CMakeLists.txt:3 (find_package): + By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project + has asked CMake to find a package configuration file provided by + "Qt5Widgets", but CMake did not find one. + + Could not find a package configuration file provided by "Qt5Widgets" with + any of the following names: + + Qt5WidgetsConfig.cmake + qt5widgets-config.cmake + + Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set + "Qt5Widgets_DIR" to a directory containing one of the above files. If + "Qt5Widgets" provides a separate development package or SDK, be sure it has + been installed. + ``` + + * It means qt or pyqt are not correctly installed or in the path. Try the various relevant lines in the installation script such as: + + * + + ``` + pushd /usr/local/share/sip + if [ ! -e PyQt5 ]; then + ln -s Qt5 PyQt5 + fi + popd + ``` + + * `export PATH=$(pwd)/shim:$PATH` + + * `brew link qt --force ` + + * `export PATH="/usr/local/opt/qt/bin:$PATH" ` + +* Python Crypto errors + + * ``` + pip uninstall Crypto + pip uninstall pycrypto + pip install pycrypto + ``` + +* If having issues with packages not finding terminal_color, you need to up catkin_pkg_modules + + ```bash + sudo pip install --upgrade catkin_pkg_modules + ``` + +* If the standard library is missing: such as + + ```bash + error: no member named 'isfinite' in namespace 'std'; did you mean 'finite'? + ``` + + Run the following command (from [here](https://github.com/PointCloudLibrary/pcl/issues/2601)) + + ```bash + #Check the current sdk + xcrun --show-sdk-path + + #Change sdk + sudo xcode-select -s /Library/Developer/CommandLineTools #Using CommandLineTools SDK + sudo xcode-select -s /Applications/Xcode.app/Contents/Developer #Using XCode.app SDK + ``` + + \ No newline at end of file diff --git a/bash_profile_recommendations.sh b/bash_profile_recommendations.sh new file mode 100644 index 0000000..dc375b2 --- /dev/null +++ b/bash_profile_recommendations.sh @@ -0,0 +1,6 @@ + +# recommended bash_profile lines for ROS +export PYTHONPATH=/usr/local/lib/python3.8/site-packages +export PYTHONWARNINGS=ignore::yaml.YAMLLoadWarning +export ROS_PYTHON_VERSION=3 +export PATH="/usr/local/opt/python3.8/libexec/bin:$PATH" diff --git a/install b/install index 051e380..2eccac3 100755 --- a/install +++ b/install @@ -22,7 +22,7 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -ROS_DISTRO=${ROS_DISTRO:-lunar} +ROS_DISTRO=${ROS_DISTRO:-noetic} ROS_CONFIGURATION=${ROS_CONFIGURATION:-desktop_full} ROS_EXTRA_PACKAGES=${ROS_EXTRA_PACKAGES:-} ROS_INSTALL_DIR=${ROS_INSTALL_DIR:-/opt/ros/${ROS_DISTRO}} @@ -33,7 +33,7 @@ do_install() # Homebrew if ! hash brew 2>/dev/null; then - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile source ~/.bash_profile brew doctor @@ -42,8 +42,7 @@ do_install() # XQuartz if ! hash xquartz 2>/dev/null; then - brew install caskroom/cask/brew-cask - brew cask install xquartz + brew install --cask xquartz echo "Log out and in to finalize XQuartz setup." exit 0 fi @@ -53,11 +52,11 @@ do_install() echo "These instructions are about to install Python from Homebrew. However, there are already" echo "pip packages installed against the system python, in the following path:" echo - echo " /Library/Python/2.7/site-packages/" + echo " /Library/Python/3.8/site-packages/" echo echo "If you have problems, please uninstall these packages:" echo - echo " for i in \$( pip freeze ); do sudo -H pip uninstall -y \$i; done" + echo " for i in \$( pip3 freeze ); do sudo -H pip3 uninstall -y \$i; done" echo echo "Then delete the build directory and start over again from scratch." fi @@ -73,47 +72,91 @@ do_install() echo echo "Alternatively, you could try chowning the contents of /usr/local to yourself:" echo - echo " sudo chown -R $USER:admin /usr/local/*" + echo " sudo chown -R ${USER}:staff /usr/local" fi + # This tap gives us formulae for Gazebo and its dependencies, including SDF. + brew tap osrf/simulation + + # build ignition messages from source to fix any out of date links for gazebo + # brew install -s ignition-msgs5 ignition-common3 ignition-math6 ignition-fuel-tools4 ignition-transport8 protobuf protobuf-c sdformat9 + + # I'm not sure why gazebo is looking for the wrong sdk folder. This creates + # a symlink to fix it. Hopefully this gets fixed. More info at + # https://github.com/osrf/homebrew-simulation/issues/1248 + if [ ! -e /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk ]; then + sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/ /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk + fi + + # ROS infrastructure tools + brew install \ + gazebo11 \ + libyaml \ + git \ + git-lfs \ + wget \ + intltool \ + gettext \ + icon-naming-utils \ + imagemagick \ + automake \ + qt5 \ + pyqt5 \ + sip \ + openssl \ + fltk \ + poco \ + lz4 \ + gpgme \ + yaml-cpp \ + opencv \ + pcl \ + orocos-kdl \ + log4cxx \ + boost-python3 + git lfs install + brew link --force gettext + # Brewed Python - if [ ! "$(which python2)" = "/usr/local/bin/python2" ]; then - brew install python - mkdir -p ~/Library/Python/2.7/lib/python/site-packages - echo "$(brew --prefix)/lib/python2.7/site-packages" >> ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth + if [ ! "$(which python3.8)" = "/usr/local/bin/python3.8" ]; then + brew unlink python@3.9 + brew install python@3.8 + brew link python@3.8 + + mkdir -p ~/Library/Python/3.8/lib/python/site-packages + echo "$(brew --prefix)/lib/python3.8/site-packages" >> ~/Library/Python/3.8/lib/python/site-packages/homebrew.pth fi + # export PATH="/usr/local/opt/python@3.8/bin:$PATH" - # Gives us console_bridge, urdfdom, and gtest. - brew tap ros/deps - # This tap gives us formulae for Gazebo and its dependencies, including SDF. - brew tap osrf/simulation + pip3 install -U setuptools rosdep rosinstall_generator wstool rosinstall bloom empy sphinx pycurl osrf_pycommon termcolor vcstool pycryptodomex - # Homebrew science gives us vtk and PCL, among other things. - brew tap homebrew/science + # install catkin_tools from git (necessary until 0.7.0 release https://github.com/catkin/catkin_tools/issues/594) + pip3 install -U git+https://github.com/catkin/catkin_tools.git - # ROS infrastructure tools - brew install libyaml || true - pip2 install -U setuptools rosdep rosinstall_generator wstool rosinstall catkin_tools bloom empy sphinx pycurl + # patch rospkg to recognize macOS big sur (see PR https://github.com/ros-infrastructure/rospkg/pull/216) + set +e + patch -N -p3 -d /usr/local/lib/python3.8/site-packages/rospkg < patches/rospkg.patch + set -e # Rosdep has an issue detecting that qt5 is correctly installed, so preinstall it. This is a keg-only formula, # so add its location to the prefix path in order for workspace packages to be able to find it. - brew install qt5 pyqt5 sip - export CMAKE_PREFIX_PATH=$(brew --prefix qt5) + export CMAKE_PREFIX_PATH="$(brew --prefix qt5)" # This hack is required to make qt_gui_cpp compile correctly. See https://github.com/mikepurvis/ros-install-osx/pull/84#issuecomment-338209466 + export PATH="/usr/local/opt/qt5/bin:$PATH" pushd /usr/local/share/sip if [ ! -e PyQt5 ]; then - ln -s Qt5 PyQt5 + ln -fvs Qt5 PyQt5 fi popd - # Get homebrew's opencv3 from a bottle so that we don't have to build it. - brew install opencv3 + # get openssl and gpgme working for rosbag_storage + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/openssl/lib/pkgconfig" # Mock out python and pip so that we get the brewed versions when rosdep and other programs call them. # Mock out pip so that we get the brewed pip2 when rosdep calls it to make an installation. - export PATH=$(pwd)/shim:$PATH + # export PATH=$(pwd)/shim:$PATH # Initialize and update rosdep if [ ! -d /etc/ros/rosdep/ ]; then @@ -131,40 +174,52 @@ do_install() if [ -d "$WS" ]; then rm -rf "$WS" fi - mkdir $WS + mkdir -p $WS/src cd $WS + # patch rosdep to fix brew list function (see PR https://github.com/ros-infrastructure/rosdep/pull/792) + set +e + patch -N -p3 -d /usr/local/lib/python3.8/site-packages/rosdep2 < ../patches/rosdep.patch + set -e + # Standard source install rosinstall_generator ${ROS_CONFIGURATION} ${ROS_EXTRA_PACKAGES} --rosdistro ${ROS_DISTRO} --deps --tar > ${WS}.rosinstall - wstool init src - pushd src - # Avoid downloading opencv3; we already installed it from homebrew. - wstool merge file://$(pwd)/../${WS}.rosinstall - wstool remove opencv3 - wstool update -j8 - - # See: https://github.com/ros/catkin/pull/784 - if [ -d catkin ]; then - curl https://raw.githubusercontent.com/ros/catkin/8a47f4eceb4954beb4a5b38b50793d0bbe2c96cf/cmake/catkinConfig.cmake.in > catkin/cmake/catkinConfig.cmake.in - fi + vcs import src < ${WS}.rosinstall + rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root pip:false -y - # Pending release: https://github.com/ros-visualization/rviz/pull/1165 - if [ -d rviz ]; then - curl https://raw.githubusercontent.com/mikepurvis/rviz/21eac2bcc061bb623fd17aa449f6215c493b27f2/CMakeLists.txt > rviz/CMakeLists.txt - fi + # custom built dependencies + brew tap smnogar/ros-noetic + brew install \ + smnogar/ros-noetic/boost@1.73 \ + smnogar/ros-noetic/boost-python3@1.73 \ + smnogar/ros-noetic/sip@4.19.24 \ + smnogar/ros-noetic/pyqt@5.15.0 \ + smnogar/ros-noetic/opencv@4.5 \ + smnogar/ros-noetic/tango-icon-theme + brew unlink boost && brew link boost@1.73 + brew unlink boost-python3 && brew link boost-python3@1.73 + brew unlink opencv && brew link opencv@4.5 + brew unlink sip && brew link sip@4.19.24 + brew unlink pyqt && brew link pyqt@5.15.0 - if [ -d image_pipeline ]; then - # Pending merge and release: https://github.com/ros-perception/image_pipeline/pull/303 - curl https://raw.githubusercontent.com/mikepurvis/image_pipeline/d308d00aed5b66961f9e13ab7a50660a24be7c7f/image_proc/CMakeLists.txt > image_pipeline/image_proc/CMakeLists.txt - curl https://raw.githubusercontent.com/mikepurvis/image_pipeline/d308d00aed5b66961f9e13ab7a50660a24be7c7f/stereo_image_proc/CMakeLists.txt > image_pipeline/stereo_image_proc/CMakeLists.txt + set +e - # Pending merge and release: https://github.com/ros-perception/image_pipeline/pull/304 - curl https://raw.githubusercontent.com/mbreyer/image_pipeline/4bf67d3c861cb157e8174f67250680263b18d2b7/image_publisher/CMakeLists.txt > image_pipeline/image_publisher/CMakeLists.txt - fi + # # rosbag_strorage encryption (PR https://github.com/ros/ros_comm/pull/2114) + patch -N -p3 -d src/ros_comm/rosbag_storage/ < ../patches/rosbag_storage.patch - # Package dependencies. - rosdep install --from-paths . --ignore-src --rosdistro ${ROS_DISTRO} -y --as-root pip:no - popd + # # fix boost components in camera_calibration_parsers (related PR https://github.com/ros-perception/image_common/pull/143/files) + patch -N -d src/image_common/camera_calibration_parsers/ < ../patches/camera_calibration_parsers.patch + + # # fix boost components (see PR https://github.com/ros-perception/vision_opencv/pull/274) + patch -N -d src/vision_opencv/cv_bridge/ < ../patches/cv_bridge.patch + + # # make harfbuzz and gtk optional (related PR https://github.com/ros-perception/image_pipeline/pull/601) + patch -N -d src/image_pipeline/image_view/ < ../patches/image_view.patch + + # fix assimp and remove twist plugin + patch -N -p1 -d src/rviz/ < ../patches/rviz.patch + + set -e # Clean out or create the install directory. if [ -d ${ROS_INSTALL_DIR} ]; then @@ -173,29 +228,32 @@ do_install() echo "This sudo prompt is to create and chown ${ROS_INSTALL_DIR}." sudo mkdir -p ${ROS_INSTALL_DIR} sudo chown $USER ${ROS_INSTALL_DIR} + sudo chown $USER ${ROS_INSTALL_DIR}/../ fi # Parallel build. catkin config --install \ --install-space ${ROS_INSTALL_DIR} \ --cmake-args \ - -DCATKIN_ENABLE_TESTING=1 \ + -DCMAKE_CXX_STANDARD=14 \ + -DCATKIN_ENABLE_TESTING=0 \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_FIND_FRAMEWORK=LAST \ - -DPYTHON_EXECUTABLE=$(which python2) \ - -DPYTHON_LIBRARY=$(python2 -c "import sys; print sys.prefix")/lib/libpython2.7.dylib \ - -DPYTHON_INCLUDE_DIR=$(python2 -c "import sys; print sys.prefix")/include/python2.7 - catkin build --limit-status-rate 1 + -DPYTHON_EXECUTABLE=$(which python3) \ + -DPYTHON_LIBRARY=$(python3 -c "import sys; print(sys.prefix)")/lib/libpython3.8.dylib \ + -DPYTHON_INCLUDE_DIR=$(python3 -c "import sys; print(sys.prefix)")/include/python3.8 \ + -DBoost_NO_BOOST_CMAKE=ON + catkin build echo "Installation successful, please source the ROS workspace:" echo - echo " source ${ROS_INSTALL_DIR}/setup.bash" + echo " source ${ROS_INSTALL_DIR}/setup.zsh" echo # Check for SIP if on OSX/macOS 10.11 (El Capitan) or later if [[ `sw_vers -productVersion` > "10.10" ]] then - if `csrutil status | grep -q enabled` + if `csrutil status | grep -q 'Filesystem Protections: enabled'` then echo "You have System Integrity Protection enabled." echo diff --git a/patches/camera_calibration_parsers.patch b/patches/camera_calibration_parsers.patch new file mode 100644 index 0000000..8b33452 --- /dev/null +++ b/patches/camera_calibration_parsers.patch @@ -0,0 +1,26 @@ +From 1302dbf942e2693f6029985afdb4675f32fe5e88 Mon Sep 17 00:00:00 2001 +From: Stephen Nogar +Date: Wed, 6 Jan 2021 14:44:54 -0500 +Subject: [PATCH] fix boost python + +--- + camera_calibration_parsers/CMakeLists.txt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/camera_calibration_parsers/CMakeLists.txt b/camera_calibration_parsers/CMakeLists.txt +index 4f08187..981c0c9 100644 +--- a/camera_calibration_parsers/CMakeLists.txt ++++ b/camera_calibration_parsers/CMakeLists.txt +@@ -4,7 +4,8 @@ project(camera_calibration_parsers) + find_package(catkin REQUIRED sensor_msgs rosconsole roscpp roscpp_serialization) + + find_package(PythonLibs REQUIRED) +-find_package(Boost REQUIRED COMPONENTS filesystem python) ++find_package(PythonInterp REQUIRED) ++find_package(Boost REQUIRED COMPONENTS filesystem python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}) + include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}) + + catkin_python_setup() +-- +2.24.3 (Apple Git-128) + diff --git a/patches/cv_bridge.patch b/patches/cv_bridge.patch new file mode 100644 index 0000000..37a6588 --- /dev/null +++ b/patches/cv_bridge.patch @@ -0,0 +1,33 @@ +From 5dcaf516e272ccee80ec39bff6942804d3535086 Mon Sep 17 00:00:00 2001 +From: Stephen Nogar +Date: Wed, 6 Jan 2021 15:18:10 -0500 +Subject: [PATCH] fixes for loading correct version of boost python + +--- + cv_bridge/CMakeLists.txt | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/cv_bridge/CMakeLists.txt b/cv_bridge/CMakeLists.txt +index ef804b9..3ac0a19 100644 +--- a/cv_bridge/CMakeLists.txt ++++ b/cv_bridge/CMakeLists.txt +@@ -5,14 +5,8 @@ find_package(catkin REQUIRED COMPONENTS rosconsole sensor_msgs) + + if(NOT ANDROID) + find_package(PythonLibs) +- +- if(PYTHONLIBS_VERSION_STRING VERSION_LESS "3.8") +- # Debian Buster +- find_package(Boost REQUIRED python37) +- else() +- # Ubuntu Focal +- find_package(Boost REQUIRED python) +- endif() ++ find_package(PythonInterp REQUIRED) ++ find_package(Boost REQUIRED python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}) + else() + find_package(Boost REQUIRED) + endif() +-- +2.24.3 (Apple Git-128) + diff --git a/patches/image_view.patch b/patches/image_view.patch new file mode 100644 index 0000000..75d2f7f --- /dev/null +++ b/patches/image_view.patch @@ -0,0 +1,40 @@ +From 1de0086f610c09cb752c0ee6d382b9611b2f4e42 Mon Sep 17 00:00:00 2001 +From: Stephen Nogar +Date: Wed, 6 Jan 2021 15:40:45 -0500 +Subject: [PATCH] make harfbuzz and gtk optional + +--- + image_view/CMakeLists.txt | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/image_view/CMakeLists.txt b/image_view/CMakeLists.txt +index 747e0ab..14b4a8c 100644 +--- a/image_view/CMakeLists.txt ++++ b/image_view/CMakeLists.txt +@@ -39,11 +39,19 @@ if(ANDROID) + endif() + + find_package(PkgConfig REQUIRED) +-pkg_check_modules(GTK3 REQUIRED gtk+-3.0) +-include_directories(${GTK3_INCLUDE_DIRS}) ++pkg_check_modules(GTK3 gtk+-3.0) ++if(GTK3_FOUND) ++ include_directories(${GTK3_INCLUDE_DIRS}) ++else() ++ message(STATUS "GTK3 is not found. Some features are disabled.") ++endif() + +-pkg_check_modules(PC_HB REQUIRED harfbuzz) +-include_directories(${PC_HB_INCLUDE_DIRS}) ++pkg_check_modules(PC_HB harfbuzz) ++if(PC_HB_FOUND) ++ include_directories(${PC_HB_INCLUDE_DIRS}) ++else() ++ message(STATUS "harfbuzz is not found. Some features are disabled.") ++endif() + + # Nodelet library + add_library(image_view src/nodelets/image_nodelet.cpp src/nodelets/disparity_nodelet.cpp src/nodelets/window_thread.cpp) +-- +2.24.3 (Apple Git-128) + diff --git a/patches/rosbag_storage.patch b/patches/rosbag_storage.patch new file mode 100644 index 0000000..b21c63f --- /dev/null +++ b/patches/rosbag_storage.patch @@ -0,0 +1,53 @@ +From 894a150c2e5e168d1244c3274f57829c41ace2d0 Mon Sep 17 00:00:00 2001 +From: Stephen Nogar +Date: Tue, 5 Jan 2021 17:12:31 -0500 +Subject: [PATCH] fix building encrypted bags on mac + +--- + tools/rosbag_storage/CMakeLists.txt | 20 ++++++++++++++------ + 1 file changed, 14 insertions(+), 6 deletions(-) + +diff --git a/tools/rosbag_storage/CMakeLists.txt b/tools/rosbag_storage/CMakeLists.txt +index 82532b91f..7545d8bd9 100644 +--- a/tools/rosbag_storage/CMakeLists.txt ++++ b/tools/rosbag_storage/CMakeLists.txt +@@ -22,22 +22,30 @@ catkin_package( + # Support large bags (>2GB) on 32-bit systems + add_definitions(-D_FILE_OFFSET_BITS=64) + +-include_directories(include ${catkin_INCLUDE_DIRS} ${console_bridge_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIR}) +-add_definitions(${BZIP2_DEFINITIONS}) +- + set(AES_ENCRYPT_SOURCE "") + set(AES_ENCRYPT_LIBRARIES "") ++set(AES_ENCRYPT_INCLUDES "") + if(NOT WIN32) + set(AES_ENCRYPT_SOURCE "src/aes_encryptor.cpp" "src/gpgme_utils.cpp") + find_library(GPGME_LIBRARY + NAMES "gpgme" + PATHS /usr/local/lib) +- find_library(CRYPTO_LIBRARY +- NAMES "crypto" +- PATHS /usr/local/lib) ++ ++ if(APPLE) ++ find_package(OpenSSL REQUIRED) ++ set(CRYPTO_LIBRARY ${OPENSSL_CRYPTO_LIBRARY}) ++ set(AES_ENCRYPT_INCLUDES ${OPENSSL_INCLUDE_DIR}) ++ else() ++ find_library(CRYPTO_LIBRARY ++ NAMES "crypto" ++ PATHS /usr/local/lib) ++ endif() + set(AES_ENCRYPT_LIBRARIES ${GPGME_LIBRARY} ${CRYPTO_LIBRARY}) + endif() + ++include_directories(include ${catkin_INCLUDE_DIRS} ${console_bridge_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIR} ${AES_ENCRYPT_INCLUDES}) ++add_definitions(${BZIP2_DEFINITIONS}) ++ + add_library(rosbag_storage + src/bag.cpp + src/bag_player.cpp +-- +2.24.3 (Apple Git-128) + diff --git a/patches/rosdep.patch b/patches/rosdep.patch new file mode 100644 index 0000000..f7cb0eb --- /dev/null +++ b/patches/rosdep.patch @@ -0,0 +1,29 @@ +From fd935ad0bc75fd0a9791033d719e01c9ac215109 Mon Sep 17 00:00:00 2001 +From: Stephen Nogar +Date: Tue, 5 Jan 2021 14:12:05 -0500 +Subject: [PATCH] fix brew list warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes “Error: Calling `brew list` to only list formulae is disabled! Use `brew list --formula` instead.” warning +--- + src/rosdep2/platforms/osx.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/rosdep2/platforms/osx.py b/src/rosdep2/platforms/osx.py +index 13b0723..aadcb46 100644 +--- a/src/rosdep2/platforms/osx.py ++++ b/src/rosdep2/platforms/osx.py +@@ -184,7 +184,7 @@ def brew_detect(resolved, exec_fn=None): + """ + if exec_fn is None: + exec_fn = read_stdout +- std_out = exec_fn(['brew', 'list']) ++ std_out = exec_fn(['brew', 'list', '--formula']) + installed_formulae = std_out.split() + + def is_installed(r): +-- +2.24.3 (Apple Git-128) + diff --git a/patches/rospkg.patch b/patches/rospkg.patch new file mode 100644 index 0000000..bb7f4ed --- /dev/null +++ b/patches/rospkg.patch @@ -0,0 +1,62 @@ +From 24947cc053381396ae961d28412331512cb85355 Mon Sep 17 00:00:00 2001 +From: Stephen Nogar +Date: Mon, 4 Jan 2021 17:40:51 -0500 +Subject: [PATCH] fix for detecting big sur (and newer) versions of macOS + +--- + src/rospkg/os_detect.py | 35 ++++++++++++++++++++--------------- + 1 file changed, 20 insertions(+), 15 deletions(-) + +diff --git a/src/rospkg/os_detect.py b/src/rospkg/os_detect.py +index 0027baa..c6915d7 100644 +--- a/src/rospkg/os_detect.py ++++ b/src/rospkg/os_detect.py +@@ -343,25 +343,30 @@ class Rhel(Fedora): + + # Source: https://en.wikipedia.org/wiki/MacOS#Versions + _osx_codename_map = { +- 4: 'tiger', +- 5: 'leopard', +- 6: 'snow', +- 7: 'lion', +- 8: 'mountain lion', +- 9: 'mavericks', +- 10: 'yosemite', +- 11: 'el capitan', +- 12: 'sierra', +- 13: 'high sierra', +- 14: 'mojave', +- 15: 'catalina', ++ '10.4': 'tiger', ++ '10.5': 'leopard', ++ '10.6': 'snow', ++ '10.7': 'lion', ++ '10.8': 'mountain lion', ++ '10.9': 'mavericks', ++ '10.10': 'yosemite', ++ '10.11': 'el capitan', ++ '10.12': 'sierra', ++ '10.13': 'high sierra', ++ '10.14': 'mojave', ++ '10.15': 'catalina', ++ '11': 'big sur' + } + + + def _osx_codename(major, minor): +- if major != 10 or minor not in _osx_codename_map: +- raise OsNotDetected("unrecognized version: %s.%s" % (major, minor)) +- return _osx_codename_map[minor] ++ if major == 10: ++ key = '%s.%s' % (major, minor) ++ else: ++ key = '%s' % (major) ++ if key not in _osx_codename_map: ++ raise OsNotDetected("unrecognized version: %s" % key) ++ return _osx_codename_map[key] + + + class OSX(OsDetector): +-- +2.24.3 (Apple Git-128) + diff --git a/patches/rviz.patch b/patches/rviz.patch new file mode 100644 index 0000000..fc3e385 --- /dev/null +++ b/patches/rviz.patch @@ -0,0 +1,63 @@ +From c2e255f0b477afd431cf4678b34916fdaf55690b Mon Sep 17 00:00:00 2001 +From: Stephen Nogar +Date: Wed, 6 Jan 2021 18:51:54 -0500 +Subject: [PATCH] fix build for mac + +remove screw/twist plugin, fix assimp link +--- + CMakeLists.txt | 23 +++++++++++++++++++---- + src/rviz/default_plugin/CMakeLists.txt | 4 ++-- + 2 files changed, 21 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 674e1033..e66828f5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,10 +26,25 @@ find_package(Boost REQUIRED + find_package(urdfdom_headers REQUIRED) + + set(CMAKE_POLICY_DEFAULT_CMP0012 NEW) # required due to a bug in assimp 5.0 +-find_package(ASSIMP REQUIRED) +-if(NOT DEFINED ASSIMP_LIBRARIES AND TARGET assimp::assimp) +- # ASSIMP >= 5.0 no longer defines ASSIMP_LIBRARIES +- set(ASSIMP_LIBRARIES assimp::assimp) ++find_package(ASSIMP QUIET) ++if (ASSIMP_FOUND) ++ if( NOT ${ASSIMP_VERSION} VERSION_LESS "2.0.1150" ) ++ add_definitions(-DASSIMP_UNIFIED_HEADER_NAMES) ++ message(STATUS "Assimp version has unified headers") ++ else() ++ message(STATUS "Assimp version does not have unified headers") ++ endif() ++ include_directories(${ASSIMP_INCLUDE_DIRS}) ++ #catkin_lint: ignore_once link_directory ++ link_directories(${ASSIMP_LIBRARY_DIRS}) ++else() ++ message(STATUS "could not find assimp (perhaps available thorugh ROS package?), so assimping assimp v2") ++ set(ASSIMP_LIBRARIES assimp) ++ set(ASSIMP_LIBRARY_DIRS) ++ set(ASSIMP_CXX_FLAGS) ++ set(ASSIMP_CFLAGS_OTHER) ++ set(ASSIMP_LINK_FLAGS) ++ set(ASSIMP_INCLUDE_DIRS) + endif() + + find_package(OGRE QUIET COMPONENTS Overlay) +diff --git a/src/rviz/default_plugin/CMakeLists.txt b/src/rviz/default_plugin/CMakeLists.txt +index 196c2521..41b13d0e 100644 +--- a/src/rviz/default_plugin/CMakeLists.txt ++++ b/src/rviz/default_plugin/CMakeLists.txt +@@ -47,8 +47,8 @@ set(SOURCE_FILES + range_display.cpp + relative_humidity_display.cpp + robot_model_display.cpp +- screw_display.cpp +- screw_visual.cpp ++# screw_display.cpp ++# screw_visual.cpp + temperature_display.cpp + tf_display.cpp + tools/focus_tool.cpp +-- +2.24.3 (Apple Git-128) + diff --git a/rosdeps.yaml b/rosdeps.yaml index 576ee79..6dfa053 100644 --- a/rosdeps.yaml +++ b/rosdeps.yaml @@ -3,8 +3,16 @@ libogre-dev: osx: homebrew: packages: [ogre1.9] +libogre: + osx: + homebrew: + packages: [ogre1.9] -# Use Gazebo 8 instead of 7. +# Gazebo +gazebo: + osx: + homebrew: + packages: [gazebo8] gazebo7: osx: homebrew: @@ -13,6 +21,22 @@ libgazebo7-dev: osx: homebrew: packages: [gazebo8] +gazebo9: + osx: + homebrew: + packages: [gazebo9] +libgazebo9-dev: + osx: + homebrew: + packages: [gazebo9] +gazebo11: + osx: + homebrew: + packages: [gazebo11] +libgazebo11-dev: + osx: + homebrew: + packages: [gazebo11] # Don't try to install opencv3 opencv3: @@ -20,31 +44,116 @@ opencv3: homebrew: packages: [] +geographiclib: + osx: + homebrew: + packages: [geographiclib] +geographiclib-tools: + osx: + homebrew: + packages: [] + +# ignore joystick drivers +joy: + osx: + homebrew: + packages: [] + # Installing all this Python stuff from homebrew instead of pip # means we get pre-built bottles and don't have to build it all # each time. -python: + +python3: osx: homebrew: - packages: [python] + packages: [python3@3.8] pip: packages: [pip, setuptools, nose] -python-matplotlib: +python3-matplotlib: osx: - homebrew: - packages: [homebrew/science/matplotlib] -python-numpy: + pip: + packages: [matplotlib] +python3-numpy: osx: homebrew: packages: [numpy] -python-scipy: +python3-scipy: osx: homebrew: packages: [scipy] -python-wxtools: +python3-wxtools: osx: homebrew: packages: [wxmac] +python3-gnupg: + osx: + pip: + packages: [gnupg] +libgpgme-dev: + osx: + homebrew: + packages: [gpgme] +tango-icon-theme: + osx: + homebrew: + packages: [] +python3-empy: + osx: + pip: + packages: [empy] +python3-pykdl: + osx: + homebrew: + packages: [orocos-kdl] +python3-nose: + osx: + pip: + packages: [nose] +python3-paramiko: + osx: + pip: + packages: [paramiko] +python3-mock: + osx: + pip: + packages: [mock] +python3-coverage: + osx: + pip: + packages: [coverage] +python3-pydot: + osx: + pip: + packages: [pydot] +python3-defusedxml: + osx: + pip: + packages: [defusedxml] +python3-opengl: + osx: + pip: + packages: [] +python3-opencv: + osx: + homebrew: + packages: [opencv] +python3-cairo: + osx: + homebrew: + packages: [py3cairo] +python3-netifaces: + osx: + pip: + packages: [netifaces] +python3-catkin-pkg: + osx: + pip: + packages: [catkin-pkg] +python3-rosdep-modules: + osx: + pip: + packages: [] + # Zero out all the QT5 keys. We'll install it ourselves upfront. libqt5-opengl-dev: @@ -59,11 +168,11 @@ libqt5-core: osx: homebrew: packages: [] -python-qt5-bindings-gl: +python3-qt5-bindings-gl: osx: homebrew: packages: [] -python-qt5-bindings-webkit: +python3-qt5-bindings-webkit: osx: homebrew: packages: [] @@ -83,7 +192,55 @@ qt5-qmake: osx: homebrew: packages: [] -python-qt5-bindings: +python3-qt5-bindings: osx: homebrew: packages: [] + +# boost +libboost-thread-dev: + osx: + homebrew: + packages: [boost] +libboost-regex-dev: + osx: + homebrew: + packages: [boost] +libboost-filesystem-dev: + osx: + homebrew: + packages: [boost] +libboost-system-dev: + osx: + homebrew: + packages: [boost] +libboost-date-time-dev: + osx: + homebrew: + packages: [boost] +libboost-program-options-dev: + osx: + homebrew: + packages: [boost] +libboost-dev: + osx: + homebrew: + packages: [boost] +libboost-chrono-dev: + osx: + homebrew: + packages: [boost] + +# misc +gtk3: + osx: + homebrew: + packages: [gtk+3] +google-mock: + osx: + homebrew: + pacakges: [] +gtest: + osx: + homebrew: + packages: [] \ No newline at end of file diff --git a/shim/pip b/shim/pip deleted file mode 100755 index ad72626..0000000 --- a/shim/pip +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# This wrapper allows rosdep to call pip and it actually be -# the pip2 that's part of brewed Python, rather than the missing -# system pip. -pip2 $@ -exit $?