travis_linux_before_install.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/bash
  2. set -ev
  3. if [ -z ${DOCKER+x} ] && [ -z ${SONAR+x} ]; then
  4. # Only on non-docker builds required
  5. echo "=== Installing from external package sources in $LOCAL_PKG ===" && echo -en 'travis_fold:start:before_install.external\\r'
  6. # Increase the environment version to force a rebuild of the packages
  7. # The version is writen to the cache file after every build of the dependencies
  8. ENV_VERSION="1"
  9. ENV_INSTALLED=""
  10. if [ -e $LOCAL_PKG/.build_env ]; then
  11. echo "=== No cached build environment ==="
  12. read -r ENV_INSTALLED < $LOCAL_PKG/.build_env
  13. fi
  14. # travis caches the $LOCAL_PKG dir. If it is loaded, we don't need to reinstall the packages
  15. if [ "$ENV_VERSION" = "$ENV_INSTALLED" ]; then
  16. echo "=== The build environment is current ==="
  17. exit 0
  18. fi
  19. echo "=== The build environment is outdated ==="
  20. # Clean up
  21. rm -rf $LOCAL_PKG/*
  22. if [ "$CC" = "tcc" ]; then
  23. mkdir tcc_install && cd tcc_install
  24. wget https://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27.tar.bz2
  25. tar xf tcc-0.9.27.tar.bz2
  26. cd tcc-0.9.27
  27. ./configure --prefix=$LOCAL_PKG
  28. make
  29. make install
  30. cd ../..
  31. rm -rf tcc_install
  32. fi
  33. wget https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.7.1.tar.gz
  34. tar xf mbedtls-2.7.1.tar.gz
  35. cd mbedtls-mbedtls-2.7.1
  36. cmake -DENABLE_TESTING=Off -DCMAKE_INSTALL_PREFIX=$LOCAL_PKG .
  37. make -j
  38. make install
  39. echo -en 'travis_fold:end:script.before_install.external\\r'
  40. echo "=== Installing python packages ===" && echo -en 'travis_fold:start:before_install.python\\r'
  41. pip install --user cpp-coveralls
  42. pip install --user sphinx
  43. pip install --user sphinx_rtd_theme
  44. pip install --user cpplint
  45. echo -en 'travis_fold:end:script.before_install.python\\r'
  46. fi