diff --git a/build/install-deps-linux.sh b/build/install-deps-linux.sh index 031e5c9b55b8..cf6bab4dae32 100755 --- a/build/install-deps-linux.sh +++ b/build/install-deps-linux.sh @@ -1,8 +1,6 @@ #!/bin/bash -# Change directory to the location of this script echo "This Shell Script will install dependencies for cocos2d-x" -echo "if you execute this shell more than once it will get errors when building libGLFW.so" echo -n "Are you continue? (y/n) " read answer if echo "$answer" | grep -iq "^y" ;then @@ -11,15 +9,6 @@ else exit fi -cd $(dirname ${BASH_SOURCE[0]}) - -if [ ! $(command -v apt-get) ]; then - echo "Not a .deb package system. Please install dependencies manually" - exit 0 -fi - -#install g++-4.9 -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y > /dev/null sudo apt-get update DEPENDS='libx11-dev' @@ -27,8 +16,6 @@ DEPENDS+=' libxmu-dev' DEPENDS+=' libglu1-mesa-dev' DEPENDS+=' libgl2ps-dev' DEPENDS+=' libxi-dev' -DEPENDS+=' gcc-4.9' -DEPENDS+=' g++-4.9' DEPENDS+=' libzip-dev' DEPENDS+=' libpng12-dev' DEPENDS+=' libcurl4-gnutls-dev' @@ -39,38 +26,4 @@ DEPENDS+=' libssl-dev' DEPENDS+=' libgtk-3-dev' DEPENDS+=' binutils' -MISSING= -echo "Checking for missing packages ..." -for i in $DEPENDS; do - if ! dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed" > /dev/null; then - MISSING+="$i " - fi -done - -if [ -n "$MISSING" ]; then - TXTCOLOR_DEFAULT="\033[0;m" - TXTCOLOR_GREEN="\033[0;32m" - echo -e $TXTCOLOR_GREEN"Missing packages: $MISSING.\nYou may be asked for your password for package installation."$TXTCOLOR_DEFAULT - CUR_APT_VERSION="$(apt --version | grep -o '[0-9].[0-9]')" - REQ_APT_VERSION="1.1" - if [ 1 -ge "$(echo "${CUR_APT_VERSION} >= ${REQ_APT_VERSION}" | bc)" ] - then - sudo apt-get install --allow-change-held-packages $MISSING -y > /dev/null - else - sudo apt-get install --force-yes --yes $MISSING > /dev/null - fi -fi - - - -sudo update-alternatives --remove-all gcc -sudo update-alternatives --remove-all g++ - -sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 -sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 60 - -echo "Cocos uses GCC Version: `gcc --version`" -echo "Cocos uses G++ Version: `g++ --version`" -echo "Cocos uses ld Version: `ld --version`" -echo "Cocos uses /usr/bin/ld Version: `/usr/bin/ld --version`" - +sudo apt-get install --force-yes --yes $DEPENDS > /dev/null diff --git a/tools/travis-scripts/before-install.sh b/tools/travis-scripts/before-install.sh index 5eff20158368..14483e5b170c 100755 --- a/tools/travis-scripts/before-install.sh +++ b/tools/travis-scripts/before-install.sh @@ -24,10 +24,6 @@ function install_android_ndk() function install_linux_environment() { - mkdir -p $HOME/bin - pushd $HOME/bin - - echo "GCC version: `gcc --version`" echo "Installing linux dependence packages ..." echo -e "y" | bash $COCOS2DX_ROOT/build/install-deps-linux.sh echo "Installing linux dependence packages finished!" diff --git a/tools/travis-scripts/run-script.sh b/tools/travis-scripts/run-script.sh index 366cd65bfd6e..0a3941d83a2a 100755 --- a/tools/travis-scripts/run-script.sh +++ b/tools/travis-scripts/run-script.sh @@ -29,14 +29,12 @@ function do_retry() function build_linux() { - CPU_CORES=`grep -c ^processor /proc/cpuinfo` echo "Building tests ..." cd $COCOS2DX_ROOT/build mkdir -p linux-build cd linux-build cmake ../.. - echo "cpu cores: ${CPU_CORES}" - make -j${CPU_CORES} VERBOSE=1 + cmake --build . } function build_mac() @@ -375,14 +373,13 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then update_cocos_files python -u tools/cocos2d-console/bin/cocos.py --agreement n new -l lua -p my.pack.qqqq cocos_new_test popd - CPU_CORES=`grep -c ^processor /proc/cpuinfo` + echo "Building tests ..." cd $COCOS2DX_ROOT/cocos_new_test mkdir -p linux-build cd linux-build cmake .. - echo "cpu cores: ${CPU_CORES}" - make -j${CPU_CORES} VERBOSE=1 + cmake --build . exit 0 fi if [ $BUILD_TARGET == 'mac_cmake' ]; then