From acb08aaebe012d4a0a22aa26a62091fdb0a5d353 Mon Sep 17 00:00:00 2001 From: zilongshanren Date: Fri, 11 Nov 2016 14:38:20 +0800 Subject: [PATCH] try to fix osx python build --- native/tools/travis-scripts/before-install.sh | 9 ++++++- .../tools/travis-scripts/generate-bindings.sh | 26 ++++++++++--------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/native/tools/travis-scripts/before-install.sh b/native/tools/travis-scripts/before-install.sh index 015be61282..9e4c11a198 100755 --- a/native/tools/travis-scripts/before-install.sh +++ b/native/tools/travis-scripts/before-install.sh @@ -29,8 +29,15 @@ install_android_ndk() mv android-ndk-r11c android-ndk } +function install_python_module_for_osx() +{ + sudo easy_install pip + sudo pip install PyYAML + sudo pip install Cheetah +} + #we only use osx for generate bindings if [ $TRAVIS_OS_NAME == 'osx' ]; then install_android_ndk - sudo pip install PyYAML + install_python_module_for_osx fi diff --git a/native/tools/travis-scripts/generate-bindings.sh b/native/tools/travis-scripts/generate-bindings.sh index 93684c124f..637ff04777 100755 --- a/native/tools/travis-scripts/generate-bindings.sh +++ b/native/tools/travis-scripts/generate-bindings.sh @@ -29,18 +29,20 @@ JS_COMMIT_PATH="cocos/scripting/js-bindings/auto" # Exit on error set -e -mkdir -p $HOME/bin -pushd $HOME/bin -curl -O http://pyyaml.org/download/pyyaml/PyYAML-3.10.zip -unzip PyYAML-3.10.zip 2> /dev/null > /dev/null -cd PyYAML-3.10 -sudo python setup.py install 2> /dev/null > /dev/null -cd .. -curl -O https://pypi.python.org/packages/source/C/Cheetah/Cheetah-2.4.4.tar.gz -tar xzf Cheetah-2.4.4.tar.gz -cd Cheetah-2.4.4 -sudo python setup.py install 2> /dev/null > /dev/null -popd +if [ $TRAVIS_OS_NAME == 'osx' ]; then + mkdir -p $HOME/bin + pushd $HOME/bin + curl -O http://pyyaml.org/download/pyyaml/PyYAML-3.10.zip + unzip PyYAML-3.10.zip 2> /dev/null > /dev/null + cd PyYAML-3.10 + sudo python setup.py install 2> /dev/null > /dev/null + cd .. + curl -O https://pypi.python.org/packages/source/C/Cheetah/Cheetah-2.4.4.tar.gz + tar xzf Cheetah-2.4.4.tar.gz + cd Cheetah-2.4.4 + sudo python setup.py install 2> /dev/null > /dev/null + popd +fi generate_bindings_glue_codes() {