You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.8 KiB

  1. #!/bin/bash
  2. # Script installing dependencies
  3. # Inspired by https://github.com/google/fruit
  4. set -e
  5. # Helper for travis folding
  6. travis_fold() {
  7. local action=$1
  8. local name=$2
  9. echo -en "travis_fold:${action}:${name}\r"
  10. }
  11. # Helper for installing packages via homebrew
  12. install_brew_package() {
  13. if brew list -1 | grep -q "^$1\$"; then
  14. # Package is installed, upgrade if needed
  15. brew outdated "$1" || brew upgrade "$@"
  16. else
  17. # Package not installed yet, install.
  18. # If there are conflicts, try overwriting the files (these are in /usr/local anyway so it should be ok).
  19. brew install "$@" || brew link --overwrite gcc49
  20. fi
  21. }
  22. # Update packages
  23. travis_fold start brew_update
  24. brew update
  25. travis_fold end brew_update
  26. travis_fold start brew_install_util
  27. # For md5sum
  28. install_brew_package md5sha1sum
  29. # For `timeout'
  30. install_brew_package coreutils
  31. which cmake &>/dev/null || install_brew_package cmake
  32. # Install compiler
  33. case "${COMPILER}" in
  34. gcc-4.8) install_brew_package gcc@4.8 ;;
  35. gcc-4.9) install_brew_package gcc@4.9 ;;
  36. gcc-5) install_brew_package gcc@5 ;;
  37. gcc-6) install_brew_package gcc@6 ;;
  38. clang-default) ;;
  39. clang-3.7) install_brew_package llvm@3.7 --with-clang --with-libcxx;;
  40. clang-3.8) install_brew_package llvm@3.8 --with-clang --with-libcxx;;
  41. clang-3.9) install_brew_package llvm@3.9 --with-clang --with-libcxx;;
  42. clang-4.0) install_brew_package llvm --with-clang --with-libcxx;;
  43. *) echo "Compiler not supported: ${COMPILER}. See travis/install_osx.sh"; exit 1 ;;
  44. esac
  45. travis_fold end brew_install_util
  46. # Install dependencies
  47. travis_fold start brew_install_dependencies
  48. install_brew_package gmp --c++11
  49. install_brew_package cln
  50. install_brew_package ginac
  51. install_brew_package boost --c++11
  52. install_brew_package python
  53. install_brew_package python3
  54. travis_fold end brew_install_dependencies