Skip to content

Commit

Permalink
Update build to not rely on cached components
Browse files Browse the repository at this point in the history
  • Loading branch information
lordofhyphens committed Jun 12, 2020
1 parent a392577 commit e1feb13
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 22 deletions.
16 changes: 11 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ before_install:
- export SLIC3R_GIT_VERSION=$(git rev-parse --short HEAD)

script:
- if [[ "${TRAVIS_OS_NAME}" == "linux" && "$TARGET" == "main" ]]; then ./package/linux/travis-build-main.sh || travis_terminate 1; fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" && "$TARGET" == "main" ]]; then ./package/linux/travis-build-main.sh -p -b -w || travis_terminate 1; fi
- if [[ "${TRAVIS_OS_NAME}" == "linux" && "$TARGET" == "cpp" ]]; then ./package/linux/travis-build-cpp.sh || travis_terminate 1; fi
- if [[ "${TRAVIS_OS_NAME}" == "osx" && "$TARGET" == "main" ]]; then ./package/osx/travis-build-main.sh || travis_terminate 1; fi
- if [[ "${TRAVIS_OS_NAME}" == "osx" && "$TARGET" == "cpp" ]]; then ./package/osx/travis-build-cpp.sh || travis_terminate 1; fi
Expand All @@ -32,6 +32,8 @@ branches:

addons:
apt:
sources:
- sourceline: "ppa:mhier/libboost-latest"
packages:
- g++
- gcc
Expand All @@ -40,8 +42,15 @@ addons:
- freeglut3
- cmake
- wx3.0-headers
- perl
- wx3.0-i18n
- libwx-perl
- libwxgtk3.0-0v5
- libwxgtk3.0-dev
- wx-common
- libboost
- libboost-dev

ssh_known_hosts: dl.slic3r.org

matrix:
Expand All @@ -51,12 +60,9 @@ matrix:
- TARGET=main
cache:
directories:
- $HOME/boost_1_63_0
- $HOME/perl5
- $HOME/wx302
- local-lib
after_success:
- if [[ "${TRAVIS_BRANCH}" != "cppgui" ]]; then source ${HOME}/perl5/perlbrew/etc/bashrc; perlbrew switch slic3r-perl; ./package/linux/travis-deploy-main.sh || travis_terminate 1; fi
- if [[ "${TRAVIS_BRANCH}" != "cppgui" ]]; then ./package/linux/travis-deploy-main.sh || travis_terminate 1; fi

- os: linux
env:
Expand Down
65 changes: 48 additions & 17 deletions package/linux/travis-build-main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,62 @@
### set -euo pipefail
set -eo pipefail

if [ ! -d $HOME/perl5/perlbrew/perls/slic3r-perl ]; then
echo "Downloading slic3r-perlbrew-5.28.tar.bz2"
curl -L "http://www.siusgs.com/slic3r/buildserver/slic3r-perl.528.gcc81.travis.tar.bz2" -o /tmp/slic3r-perlbrew-5.28.tar.bz2;
tar -C$HOME/perl5/perlbrew/perls -xjf /tmp/slic3r-perlbrew-5.28.tar.bz2
fi
USE_CC=gcc
USE_CXX=g++

while getopts ":c:pbw" opt; do
case ${opt} in
c )
USE_CC=gcc-${OPTARG}
USE_CXX=g++-${OPTARG}
;;
p )
CACHED_PERL="no"
;;
b )
CACHED_BOOST="no"
;;
w )
CACHED_WX="no"
;;
esac
done

source $HOME/perl5/perlbrew/etc/bashrc
perlbrew switch slic3r-perl
if [ ! ${CACHED_PERL} == "no" ]; then
if [ ! -d $HOME/perl5/perlbrew/perls/slic3r-perl ]; then
echo "Downloading slic3r-perlbrew-5.28.tar.bz2"
curl -L "http://www.siusgs.com/slic3r/buildserver/slic3r-perl.528.gcc81.travis.tar.bz2" -o /tmp/slic3r-perlbrew-5.28.tar.bz2;
tar -C$HOME/perl5/perlbrew/perls -xjf /tmp/slic3r-perlbrew-5.28.tar.bz2
fi

if [ ! -e $HOME/boost_1_63_0/boost/version.hpp ]; then
echo "Downloading boost_1_69_0.built.gcc-8.1.0-buildserver.tar.bz2"
curl -L "http://www.siusgs.com/slic3r/buildserver/boost_1_69_0.built.gcc-8.1.0-buildserver.tar.bz2" -o /tmp/boost-compiled.tar.bz2
tar -C$HOME -xjf /tmp/boost-compiled.tar.bz2
source $HOME/perl5/perlbrew/etc/bashrc
perlbrew switch slic3r-perl
fi

if [ ! -e ./local-lib/lib/perl5/x86_64-linux-thread-multi/Wx.pm ]; then
echo "Downloading slic3r-dependencies.gcc81.travis-wx302.tar.bz2"
curl -L "http://www.siusgs.com/slic3r/buildserver/slic3r-dependencies.gcc81.travis-wx302.tar.bz2" -o /tmp/local-lib-wx302.tar.bz2
tar -C$TRAVIS_BUILD_DIR -xjf /tmp/local-lib-wx302.tar.bz2
if [ ! ${CACHED_BOOST} == "no" ]; then
if [ ! -e $HOME/boost_1_63_0/boost/version.hpp ]; then
echo "Downloading boost_1_69_0.built.gcc-8.1.0-buildserver.tar.bz2"
curl -L "http://www.siusgs.com/slic3r/buildserver/boost_1_69_0.built.gcc-8.1.0-buildserver.tar.bz2" -o /tmp/boost-compiled.tar.bz2
tar -C$HOME -xjf /tmp/boost-compiled.tar.bz2
fi
fi

if [ ! ${CACHED_WX} == "no" ]; then
if [ ! -e ./local-lib/lib/perl5/x86_64-linux-thread-multi/Wx.pm ]; then
echo "Downloading slic3r-dependencies.gcc81.travis-wx302.tar.bz2"
curl -L "http://www.siusgs.com/slic3r/buildserver/slic3r-dependencies.gcc81.travis-wx302.tar.bz2" -o /tmp/local-lib-wx302.tar.bz2
tar -C$TRAVIS_BUILD_DIR -xjf /tmp/local-lib-wx302.tar.bz2
fi
fi

cpanm local::lib
eval $(perl -Mlocal::lib=${TRAVIS_BUILD_DIR}/local-lib)
CC=g++-8 CXX=g++-8 cpanm ExtUtils::CppGuess --force
CC=g++-8 CXX=g++-8 BOOST_DIR=$HOME/boost_1_69_0 perl ./Build.PL
CC=${USE_CC} CXX=${USE_CXX} cpanm ExtUtils::CppGuess --force
if [ ! ${CACHED_BOOST} == "no" ]; then
CC=${USE_CC} CXX=${USE_CXX} BOOST_DIR=$HOME/boost_1_69_0 perl ./Build.PL
else
CC=${USE_CC} CXX=${USE_CXX} perl ./Build.PL
fi
excode=$?
if [ $excode -ne 0 ]; then exit $excode; fi
perl ./Build.PL --gui
Expand Down

0 comments on commit e1feb13

Please sign in to comment.