travis_linux_before_install.sh 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/bash
  2. set -ev
  3. if [ $ANALYZE = "true" ]; then
  4. cd $LOCAL_PKG
  5. # travis caches the $LOCAL_PKG dir. If it is loaded, we don't need to reinstall the packages
  6. if [ "$CC" = "clang" ]; then
  7. clang --version
  8. else
  9. if [ ! -f $LOCAL_PKG/.cached_analyze ]; then
  10. # Install newer cppcheck
  11. wget https://github.com/danmar/cppcheck/archive/1.73.tar.gz -O cppcheck-1.73.tar.gz
  12. tar xf cppcheck-1.73.tar.gz
  13. cd $LOCAL_PKG/cppcheck-1.73
  14. make SRCDIR=build CFGDIR="$LOCAL_PKG/cppcheck-1.73/cfg" HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function" -j8
  15. ln -s $LOCAL_PKG/cppcheck-1.73/cppcheck $LOCAL_PKG/cppcheck
  16. # create cached flag
  17. touch $LOCAL_PKG/.cached_analyze
  18. else
  19. echo "\n## Using local packages from cache\n"
  20. fi
  21. g++ --version
  22. cppcheck --version
  23. fi
  24. else
  25. cd $LOCAL_PKG
  26. # travis caches the $LOCAL_PKG dir. If it is loaded, we don't need to reinstall the packages
  27. if [ ! -f $LOCAL_PKG/.cached ]; then
  28. # Install newer valgrind
  29. mkdir -p $LOCAL_PKG/package && cd $LOCAL_PKG/package
  30. wget http://valgrind.org/downloads/valgrind-3.11.0.tar.bz2
  31. tar xf valgrind-3.11.0.tar.bz2
  32. cd valgrind-3.11.0
  33. ./configure --prefix=$LOCAL_PKG
  34. make -s -j8 install
  35. echo "\n### Installed valgrind version: $(valgrind --version)"
  36. cd $LOCAL_PKG
  37. # Install specific check version which is not yet in the apt package
  38. wget http://ftp.de.debian.org/debian/pool/main/c/check/check_0.10.0-3_amd64.deb
  39. dpkg -x check_0.10.0-3_amd64.deb $LOCAL_PKG/package
  40. # change pkg-config file path
  41. sed -i "s|prefix=/usr|prefix=${LOCAL_PKG}|g" $LOCAL_PKG/package/usr/lib/x86_64-linux-gnu/pkgconfig/check.pc
  42. sed -i 's|libdir=.*|libdir=${prefix}/lib|g' $LOCAL_PKG/package/usr/lib/x86_64-linux-gnu/pkgconfig/check.pc
  43. # move files to globally included dirs
  44. cp -R $LOCAL_PKG/package/usr/lib/x86_64-linux-gnu/* $LOCAL_PKG/lib/
  45. cp -R $LOCAL_PKG/package/usr/include/* $LOCAL_PKG/include/
  46. cp -R $LOCAL_PKG/package/usr/bin/* $LOCAL_PKG/
  47. # Install specific liburcu version which is not yet in the apt package
  48. wget https://launchpad.net/ubuntu/+source/liburcu/0.8.5-1ubuntu1/+build/6513813/+files/liburcu2_0.8.5-1ubuntu1_amd64.deb
  49. wget https://launchpad.net/ubuntu/+source/liburcu/0.8.5-1ubuntu1/+build/6513813/+files/liburcu-dev_0.8.5-1ubuntu1_amd64.deb
  50. dpkg -x liburcu2_0.8.5-1ubuntu1_amd64.deb $LOCAL_PKG/package
  51. dpkg -x liburcu-dev_0.8.5-1ubuntu1_amd64.deb $LOCAL_PKG/package
  52. # move files to globally included dirs
  53. cp -R $LOCAL_PKG/package/usr/lib/x86_64-linux-gnu/* $LOCAL_PKG/lib/
  54. cp -R $LOCAL_PKG/package/usr/include/* $LOCAL_PKG/include/
  55. # create cached flag
  56. touch $LOCAL_PKG/.cached
  57. else
  58. echo "\n## Using local packages from cache\n"
  59. fi
  60. pip install --user cpp-coveralls
  61. pip install --user sphinx
  62. pip install --user sphinx_rtd_theme
  63. fi