travis-setup.sh 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/bash
  2. # Script to configure travis environment prior to build
  3. CACHE=$HOME/cache
  4. mkdir -p $CACHE
  5. if [[ "$BUILD_PL" == true ]]; then
  6. WXVERSION=302
  7. if [ ! -e $CACHE/slic3r-perlbrew-5.24.tar.bz2 ]; then
  8. echo "Downloading http://www.siusgs.com/slic3r/buildserver/slic3r-perl.524.travis.tar.bz2 => $CACHE/slic3r-perlbrew-5.24.tar.bz2"
  9. curl -L "http://www.siusgs.com/slic3r/buildserver/slic3r-perl.524.gcc49.travis.tar.bz2" -o $CACHE/slic3r-perlbrew-5.24.tar.bz2;
  10. fi
  11. if [ ! -e $CACHE/boost-compiled.tar.bz2 ]; then
  12. echo "Downloading http://www.siusgs.com/slic3r/buildserver/boost_1_63_0.built.gcc-4.9.4-buildserver.tar.bz2 => $CACHE/boost-compiled.tar.bz2"
  13. curl -L "http://www.siusgs.com/slic3r/buildserver/boost_1_63_0.built.gcc-4.9.4-buildserver.tar.bz2" -o $CACHE/boost-compiled.tar.bz2
  14. fi
  15. if [ ! -e $CACHE/local-lib-wx${WXVERSION}.tar.bz2 ]; then
  16. echo "Downloading http://www.siusgs.com/slic3r/buildserver/slic3r-dependencies.gcc49.travis-wx${WXVERSION}.tar.bz2 => $CACHE/local-lib-wx${WXVERSION}.tar.bz2"
  17. curl -L "http://www.siusgs.com/slic3r/buildserver/slic3r-dependencies.travis-wx${WXVERSION}.tar.bz2" -o $CACHE/local-lib-wx${WXVERSION}.tar.bz2
  18. fi
  19. if [ ! -e $CACHE/wx${WXVERSION}.tar.bz2 ]; then
  20. echo "Downloading http://www.siusgs.com/slic3r/buildserver/wx${WXVERSION}-libs.tar.bz2 => $CACHE/wx${WXVERSION}.tar.bz2"
  21. curl -L "http://www.siusgs.com/slic3r/buildserver/wx${WXVERSION}-libs.tar.bz2" -o $CACHE/wx${WXVERSION}.tar.bz2
  22. fi
  23. tar -C$TRAVIS_BUILD_DIR -xjf $CACHE/local-lib-wx${WXVERSION}.tar.bz2
  24. tar -C$HOME/perl5/perlbrew/perls -xjf $CACHE/slic3r-perlbrew-5.24.tar.bz2
  25. tar -C$HOME -xjf $CACHE/boost-compiled.tar.bz2
  26. tar -C$HOME -xjf $CACHE/wx${WXVERSION}.tar.bz2
  27. else
  28. if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  29. if [[ "$WXVERSION" != "pkg" ]]; then
  30. export WXDIR=$HOME/wx${WXVERSION}
  31. if [ ! -e $CACHE/wx${WXVERSION}.tar.bz2 ]; then
  32. echo "Downloading http://www.siusgs.com/slic3r/buildserver/wx${WXVERSION}-libs.tar.bz2 => $CACHE/wx${WXVERSION}.tar.bz2"
  33. curl -L "http://www.siusgs.com/slic3r/buildserver/wx${WXVERSION}-libs.tar.bz2" -o $CACHE/wx${WXVERSION}.tar.bz2
  34. fi
  35. tar -C$HOME -xjf $CACHE/wx${WXVERSION}.tar.bz2
  36. fi
  37. if [ ! -e $CACHE/boost-compiled.tar.bz2 ]; then
  38. echo "Downloading http://www.siusgs.com/slic3r/buildserver/boost_1_63_0.built.gcc-4.9.4-buildserver.tar.bz2 => $CACHE/boost-compiled.tar.bz2"
  39. curl -L "http://www.siusgs.com/slic3r/buildserver/boost_1_63_0.built.gcc-4.9.4-buildserver.tar.bz2" -o $CACHE/boost-compiled.tar.bz2
  40. fi
  41. tar -C$HOME -xjf $CACHE/boost-compiled.tar.bz2
  42. elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
  43. if [[ "$WXVERSION" != "pkg" ]]; then
  44. WXVER_EXPANDED=${WXVERSION:0:1}.${WXVERSION:1:1}.${WXVERSION:2:1}
  45. export WXDIR=$HOME/wx${WXVERSION}
  46. if [ ! -e $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2 ]; then
  47. curl -L "https://github.com/wxWidgets/wxWidgets/releases/download/v${WXVER_EXPANDED}/wxWidgets-${WXVER_EXPANDED}.tar.bz2" -o $HOME/wx${WXVERSION}-src.tar.bz2
  48. tar -C$HOME -xjf $HOME/wx${WXVERSION}-src.tar.bz2
  49. mkdir $WXDIR
  50. cd $HOME/$WXDIR && cmake $HOME/wxWidgets-${WXVER_EXPANDED} -DwxBUILD_SHARED=OFF
  51. cmake --build . --target -- -j4
  52. tar -C$HOME -cjf $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2 $(basename ${WXDIR})
  53. else
  54. tar -C$HOME -xjf $CACHE/wx${WXVERSION}-${TRAVIS_OS_NAME}.tar.bz2
  55. fi
  56. export PATH=${PATH}:${WXDIR}
  57. cd $TRAVIS_BUILD_DIR # go back to the build dir
  58. else
  59. brew install wxmac # install via homebrew
  60. fi
  61. fi
  62. fi