diff --git a/.travis.yml b/.travis.yml
index 1bb5e0fc5f1e7a7f54427c5910de0f4601388b35..491585f9cf9219c3c6a83cb9f9b710adc6b7eacc 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 0000000000000000000000000000000000000000..37285b80c268fc4b86cb0b224e4a407bbf44d8bb
--- /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 0000000000000000000000000000000000000000..8050eac617a6312a5ce8f50bd862cf3c1c33fdb9
--- /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