Skip to content

Commit 8c88ada

Browse files
committed
Merge commit 'ed2eab52973eb614e14f6680b9c0bbd315b017a5' into scgamex-v3
* commit 'ed2eab52973eb614e14f6680b9c0bbd315b017a5': Fix animation duration calculation (cocos2d#19221) Simplify install-deps-linux.sh, tested on Ubuntu 16.04 (cocos2d#19212) Switch travis CI to xenial (cocos2d#19207) add testcase for lua downloader binding (cocos2d#19182) # Conflicts: # tests/lua-tests/src/mainMenu.lua
2 parents 304e29a + ed2eab5 commit 8c88ada

File tree

5 files changed

+8
-87
lines changed

5 files changed

+8
-87
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ matrix:
22
include:
33
# linux
44
- os: linux
5+
dist: xenial
56
env:
67
- BUILD_TARGET=linux
78
- GEN_BINDING_AND_COCOSFILE=true
@@ -61,9 +62,10 @@ matrix:
6162
sudo: required
6263
- os: linux
6364
env: BUILD_TARGET=android_cocos_new_test
64-
language: cpp
65+
language: android
6566
sudo: required
6667
- os: linux
68+
dist: xenial
6769
env: BUILD_TARGET=linux_cocos_new_test
6870
language: cpp
6971
sudo: required

build/install-deps-linux.sh

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/bin/bash
22

3-
# Change directory to the location of this script
43
echo "This Shell Script will install dependencies for cocos2d-x"
5-
echo "if you execute this shell more than once it will get errors when building libGLFW.so"
64
echo -n "Are you continue? (y/n) "
75
read answer
86
if echo "$answer" | grep -iq "^y" ;then
@@ -11,24 +9,13 @@ else
119
exit
1210
fi
1311

14-
cd $(dirname ${BASH_SOURCE[0]})
15-
16-
if [ ! $(command -v apt-get) ]; then
17-
echo "Not a .deb package system. Please install dependencies manually"
18-
exit 0
19-
fi
20-
21-
#install g++-4.9
22-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y > /dev/null
2312
sudo apt-get update
2413

2514
DEPENDS='libx11-dev'
2615
DEPENDS+=' libxmu-dev'
2716
DEPENDS+=' libglu1-mesa-dev'
2817
DEPENDS+=' libgl2ps-dev'
2918
DEPENDS+=' libxi-dev'
30-
DEPENDS+=' gcc-4.9'
31-
DEPENDS+=' g++-4.9'
3219
DEPENDS+=' libzip-dev'
3320
DEPENDS+=' libpng12-dev'
3421
DEPENDS+=' libcurl4-gnutls-dev'
@@ -39,38 +26,4 @@ DEPENDS+=' libssl-dev'
3926
DEPENDS+=' libgtk-3-dev'
4027
DEPENDS+=' binutils'
4128

42-
MISSING=
43-
echo "Checking for missing packages ..."
44-
for i in $DEPENDS; do
45-
if ! dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed" > /dev/null; then
46-
MISSING+="$i "
47-
fi
48-
done
49-
50-
if [ -n "$MISSING" ]; then
51-
TXTCOLOR_DEFAULT="\033[0;m"
52-
TXTCOLOR_GREEN="\033[0;32m"
53-
echo -e $TXTCOLOR_GREEN"Missing packages: $MISSING.\nYou may be asked for your password for package installation."$TXTCOLOR_DEFAULT
54-
CUR_APT_VERSION="$(apt --version | grep -o '[0-9].[0-9]')"
55-
REQ_APT_VERSION="1.1"
56-
if [ 1 -ge "$(echo "${CUR_APT_VERSION} >= ${REQ_APT_VERSION}" | bc)" ]
57-
then
58-
sudo apt-get install --allow-change-held-packages $MISSING -y > /dev/null
59-
else
60-
sudo apt-get install --force-yes --yes $MISSING > /dev/null
61-
fi
62-
fi
63-
64-
65-
66-
sudo update-alternatives --remove-all gcc
67-
sudo update-alternatives --remove-all g++
68-
69-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60
70-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 60
71-
72-
echo "Cocos uses GCC Version: `gcc --version`"
73-
echo "Cocos uses G++ Version: `g++ --version`"
74-
echo "Cocos uses ld Version: `ld --version`"
75-
echo "Cocos uses /usr/bin/ld Version: `/usr/bin/ld --version`"
76-
29+
sudo apt-get install --force-yes --yes $DEPENDS > /dev/null

cocos/2d/CCActionInterval.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void ExtraAction::step(float /*dt*/)
8989
bool ActionInterval::initWithDuration(float d)
9090
{
9191

92-
_duration = abs(d) <= MATH_EPSILON ? MATH_EPSILON : d;
92+
_duration = std::abs(d) <= MATH_EPSILON ? MATH_EPSILON : d;
9393
_elapsed = 0;
9494
_firstTick = true;
9595
_done = false;

tools/travis-scripts/before-install.sh

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,37 +24,6 @@ function install_android_ndk()
2424

2525
function install_linux_environment()
2626
{
27-
mkdir -p $HOME/bin
28-
pushd $HOME/bin
29-
30-
echo "GCC version: `gcc --version`"
31-
# install new version cmake
32-
CMAKE_VERSION="3.7.2"
33-
CMAKE_DOWNLOAD_URL="https://cmake.org/files/v3.7/cmake-${CMAKE_VERSION}.tar.gz"
34-
echo "Download ${CMAKE_DOWNLOAD_URL}"
35-
${CURL} -O ${CMAKE_DOWNLOAD_URL}
36-
tar -zxf "cmake-${CMAKE_VERSION}.tar.gz"
37-
cd "cmake-${CMAKE_VERSION}"
38-
./configure > /dev/null
39-
make -j2 > /dev/null
40-
sudo make install > /dev/null
41-
echo "CMake Version: `cmake --version`"
42-
cd ..
43-
44-
# install new version binutils
45-
BINUTILS_VERSION="2.27"
46-
BINUTILS_URL="http://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.gz"
47-
echo "Download ${BINUTILS_URL}"
48-
${CURL} -O ${BINUTILS_URL}
49-
tar -zxf "binutils-${BINUTILS_VERSION}.tar.gz"
50-
cd "binutils-${BINUTILS_VERSION}"
51-
./configure > /dev/null
52-
make -j2 > /dev/null
53-
sudo make install > /dev/null
54-
echo "ld Version: `ld --version`"
55-
echo "which ld: `which ld`"
56-
sudo rm /usr/bin/ld
57-
popd
5827
echo "Installing linux dependence packages ..."
5928
echo -e "y" | bash $COCOS2DX_ROOT/build/install-deps-linux.sh
6029
echo "Installing linux dependence packages finished!"

tools/travis-scripts/run-script.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ function do_retry()
2929

3030
function build_linux()
3131
{
32-
CPU_CORES=`grep -c ^processor /proc/cpuinfo`
3332
echo "Building tests ..."
3433
cd $COCOS2DX_ROOT/build
3534
mkdir -p linux-build
3635
cd linux-build
3736
cmake ../..
38-
echo "cpu cores: ${CPU_CORES}"
39-
make -j${CPU_CORES} VERBOSE=1
37+
cmake --build .
4038
}
4139

4240
function build_mac()
@@ -375,14 +373,13 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
375373
update_cocos_files
376374
python -u tools/cocos2d-console/bin/cocos.py --agreement n new -l lua -p my.pack.qqqq cocos_new_test
377375
popd
378-
CPU_CORES=`grep -c ^processor /proc/cpuinfo`
376+
379377
echo "Building tests ..."
380378
cd $COCOS2DX_ROOT/cocos_new_test
381379
mkdir -p linux-build
382380
cd linux-build
383381
cmake ..
384-
echo "cpu cores: ${CPU_CORES}"
385-
make -j${CPU_CORES} VERBOSE=1
382+
cmake --build .
386383
exit 0
387384
fi
388385
if [ $BUILD_TARGET == 'mac_cmake' ]; then

0 commit comments

Comments
 (0)