From fa1d68641cb6e1af6cb1c214675dc5f60140895a Mon Sep 17 00:00:00 2001
From: Gabriele Buondonno <gbuondon@laas.fr>
Date: Fri, 1 Nov 2019 18:19:01 +0100
Subject: [PATCH] [travis] Handle Mac OS X

---
 .travis.yml                                  | 11 ++---------
 travis_custom/custom_before_install_linux.sh | 11 +++++++++++
 travis_custom/custom_before_install_osx.sh   |  9 +++++++++
 3 files changed, 22 insertions(+), 9 deletions(-)
 create mode 100755 travis_custom/custom_before_install_linux.sh
 create mode 100755 travis_custom/custom_before_install_osx.sh

diff --git a/.travis.yml b/.travis.yml
index 1bb5e0fc..491585f9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -88,15 +88,8 @@ matrix:
             - octomap
 
 before_install:
-  # Add robotpkg
-  - sudo sh -c "echo \"deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg\" >> /etc/apt/sources.list"
-  - curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
-  - sudo apt-get update
-  # install eigenpy
-  - sudo apt-get -qqy install robotpkg-py27-eigenpy
-  # set environment variables
-  - export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/opt/openrobots/lib/pkgconfig"
-  - export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/openrobots/lib"
+  - if [ "$TRAVIS_OS_NAME" = "linux" ]; then source travis_custom/custom_before_install_linux.sh ; fi
+  - if [ "$TRAVIS_OS_NAME" = "osx" ]; then source travis_custom/custom_before_install_osx.sh ; fi
 
 script:
   # Create build directory
diff --git a/travis_custom/custom_before_install_linux.sh b/travis_custom/custom_before_install_linux.sh
new file mode 100755
index 00000000..37285b80
--- /dev/null
+++ b/travis_custom/custom_before_install_linux.sh
@@ -0,0 +1,11 @@
+# Add robotpkg
+sudo sh -c "echo \"deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg\" >> /etc/apt/sources.list"
+curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
+sudo apt-get update
+
+# install eigenpy
+sudo apt-get -qqy install robotpkg-py27-eigenpy
+
+# set environment variables
+export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/opt/openrobots/lib/pkgconfig"
+export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/openrobots/lib"
\ No newline at end of file
diff --git a/travis_custom/custom_before_install_osx.sh b/travis_custom/custom_before_install_osx.sh
new file mode 100755
index 00000000..8050eac6
--- /dev/null
+++ b/travis_custom/custom_before_install_osx.sh
@@ -0,0 +1,9 @@
+# Add gepetto tap
+brew tap gepetto/homebrew-gepetto
+
+# install eigenpy
+brew install eigenpy
+
+# set environment variables
+export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/opt/openrobots/lib/pkgconfig"
+export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/openrobots/lib"
\ No newline at end of file
-- 
GitLab