Commit 6424fdb9 authored by carlosperate's avatar carlosperate

Update travis config to create MAC build:

Updated appveyor s3 ssh key
Updated circle s3 ssh key
Renamed build_linux to build_pyinstaller as it now covers linux and mac
Updated build_pyinstaller to properly cover mac
Upatded pack_ardublockly to not have to filter out deb packages no longer saved on build folder
parent 0fa03a9a
......@@ -54,9 +54,9 @@ before_deploy:
deploy:
name: ardublockly-s3-deployment
provider: S3
access_key_id: AKIAIWAS6AEEZDXQUNTA
access_key_id: AKIAJYJV7NN6HVHCX5NQ
secret_access_key:
secure: 3Ewa1E9tDLawiGZvbUA3NbuGkK/uKw+zrQXtBPeZwd/pS4EHL0k0bu2n9hf7M9Cs
secure: PlLCQKTcf9IzBXpEnXUxbJifb0usS7qcghnM0VxBTX0IL3C975JPidrYjP39ge7P
bucket: ardublockly-builds
set_public: true
folder: windows
# Setting the language to python creates virtual environments, which affect the
# current python packages and pyinstaller build, we only test against python
# 2.7, so don't need them. Skip all of it using language c.
language: ruby
# We are using the iOS build system to create Mac OS X python builds
language: objective-c
before_install:
- sudo apt-get update -qq
# Travis is on 64 bit, so need some 32 bit libs
#- dpkg -l ia32-libs
#- sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch
#- sudo apt-get install -qq --force-yes gcc-multilib
# Ensuring libstdc is installer
- sudo apt-get install -y libstdc++6
- dpkg -s libstdc++6
# libproxy.so is not present, install glib-networking
- sudo apt-get install -y glib-networking glib-networking-common glib-networking-services
- dpkg -s glib-networking
- dpkg -s libstdc++6
- dpkg -s libc6
- echo $LD_LIBRARY_PATH
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/
- echo $LD_LIBRARY_PATH
# Install mlocate to search for files
- sudo apt-get install mlocate
- sudo updatedb
- locate libproxy.so
- locate libstdc++.so.6
# OS extra info
- uname -a
- ldd --version
- python --version
- python -c "import struct; print(struct.calcsize('P') * 8)"
# Install wxPython and tkinker
- sudo apt-get install -y python-support
- sudo apt-get install python-tk
- sudo apt-get install -y python-wxgtk2.8 python-wxtools wx2.8-i18n
# Install python
- brew install python
- brew link --overwrite python
- pip install --upgrade pip
- PATH=/usr/local/bin:$PATH
- echo $PATH
- python --version
- python -c "import struct; print(struct.calcsize('P') * 8)"
- brew install libcouchbase
# Install wxPython
- brew install wxpython
#- sudo wget https://dl.dropboxusercontent.com/u/74034/ardublockly-dep/mac/wxPython3.0-osx-3.0.2.0-cocoa-py2.7.dmg --directory-prefix=../
#- sudo hdiutil attach ../wxPython3.0-osx-3.0.2.0-cocoa-py2.7.dmg
#- ls /Volumes
#- sudo installer -pkg /Volumes/wxPython3.0-osx-3.0.2.0-cocoa-py2.7/wxPython3.0-osx-cocoa-py2.7.pkg -target /
#- sudo hdiutil detach /Volumes/wxPython3.0-osx-3.0.2.0-cocoa-py2.7
# Install cefpython3 (cef from official dropbox link)
- sudo wget https://www.dropbox.com/sh/zar95p27yznuiv1/AACGmGx08UMq8uEGDFlINFdwa/31.2/Linux/python-cefpython3_31.2-1_amd64.deb?dl=1 --directory-prefix=../
- sudo dpkg -i ../python-cefpython3_31.2-1_amd64.deb?dl=1
# - sudo wget https://www.dropbox.com/sh/zar95p27yznuiv1/AABsIDcodIk8cgPo9jjygF4Pa/31.2/Linux/cefpython3-31.2-linux64-setup.zip?dl=1 --directory-prefix=../
# - cd ..
# - unzip cefpython3-31.2-linux64-setup.zip?dl=1
# - cd cefpython3-31.2-linux64-setup
# - sudo python setup.py install
# - cd ../ardublockly
- sudo pip install cefpython3
# Run the build script
# Build and Pack ardublockly
install:
# Adding cefpython installation dir to travis-ci python paths, listed in:
# https://code.google.com/p/cefpython/wiki/Download_CEF3_Linux
- export PYTHONPATH=$PYTHONPATH:/usr/share/pyshared/
- export PYTHONPATH=$PYTHONPATH:/usr/lib/pymodules/python2.7/
# Build and pack
- python package/build_linux.py
- python package/build_pyinstaller.py mac
- python package/pack_ardublockly.py
......@@ -73,13 +45,13 @@ script:
# Deploy the build version in an S3 bucket
deploy:
provider: s3
access_key_id: AKIAJYJV7NN6HVHCX5NQ
access_key_id: AKIAIBDOPX6GSMBDEFPQ
secret_access_key:
secure: PlLCQKTcf9IzBXpEnXUxbJifb0usS7qcghnM0VxBTX0IL3C975JPidrYjP39ge7P
secure: QNNNIgHpcTYJZS1K4w8iPqJWq1Xhx8ICoVJ79QURS5Vi4ppnP0smuW13+XdmjoZyoceSoR4iOcKX7o4HXDozsejy3ft72tXgNntVQoOOKYxnV1zKYHc7Q6ID6L3GlPKV2EQid30CM4bP0mm4P8ntuemUOwhqm4mjRwDxAMpxsEbXgNAHAMifn40g5u2rHuwo64+UUll6m2Ues6mekAlwq6YQKn0numrcHRZX9F3kMLyrSHO671EkyfVsBbZpk7+HIEXmgXgPb4juefcxUlhYQFvnlBPyyTG1ec0BE2un714vZe+Gq0w1UYQbIpsAvM1HDWQKa2S9m2gz1TXC5YXOKAfoenyFsrgvdT00zpxVrTLAGhmIgtxsbAYXVPRg/6g5E+DW/JJ2xBfMJyw3j/82vexkHpvQcut9zZ74CE2H0CtyNXHvwdcwMs+qoja6tLw1dvFD7yrTo2T/jCOxFoGYjneF3Syuh8GpALSGGUJDnyFiK0yD2B0r2567csFj5Sc0CO/ExFwfG9zmiVtkm0Xpfq09VcZFjVnJ4k8QyNvrHmnGB/H7P6CskSA1X9gGIyk36Cu17XyyrtIuM+UUIdnrZhWCI3zA/2UVawkEjA+zhpbKFKsxIe37bPpIpNM+OyMLppZzzpcaRAynh6a/8Hcc+ckh4zMg7qWu7VXyYvjSkl0=
bucket: ardublockly-builds
skip_cleanup: true
local-dir: upload
upload-dir: linux
upload-dir: mac
acl: public_read
on:
repo: carlosperate/ardublockly
......
......@@ -54,7 +54,7 @@ dependencies:
- export PYTHONPATH=$PYTHONPATH:/usr/lib/pymodules/python2.7/
# Build and pack
- python package/build_linux.py
- python package/build_pyinstaller.py linux
- python package/pack_ardublockly.py
# Get the upload file as a environmenta variable
......@@ -70,7 +70,6 @@ dependencies:
test:
override:
- python ArdublocklyServer/tests/SketchCreator_test.py
- echo $ardublocklyZipFile
## Customize deployment commands
deployment:
......
......@@ -30,11 +30,17 @@
# include a -v flag to select a verbose mode.
from __future__ import unicode_literals, print_function
import os
import sys
import shutil
import platform
import subprocess
import cefpython3
from glob import glob
# Importing cef and wx to ensure they are reachable and get their location
import cefpython3
import wx
# The project_root_dir depends on the location of this file, so it cannot be
# moved without updating this line
project_root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
......@@ -46,6 +52,40 @@ script_tab = " "
# verbose_print = print if verbose else lambda *a, **k: None
def get_os():
"""
Gets the OS to based on the command line argument of the platform info.
Only possibilities are: "windows", "mac", "linux".
"""
valid_os = ["windows", "linux", "mac"]
print(script_tab + "Checking for command line argument indicated OS:")
if len(sys.argv) > 1:
if sys.argv[1] in valid_os:
# Take the first argument and use it as the os
print(script_tab + "Valid command line argument found: %s" %
sys.argv[1])
return "%s" % sys.argv[1]
else:
print(script_tab + "Invalid command line argument found: %s\n" %
sys.argv[1] + script_tab + "Options available: %s" % valid_os)
print(script_tab + "Valid command line arg not found, checking system.")
os_found = platform.system()
if os_found == "Windows":
raise SystemExit(script_tab + "OS found is: %s\n" % valid_os[0] +
"Exit: This script is not design to run on Windows.")
elif os_found == "Linux":
print(script_tab + "OS found is: %s" % valid_os[1])
return valid_os[1]
elif os_found == "Darwin":
print(script_tab + "OS found is: %s" % valid_os[2])
return valid_os[2]
else:
raise SystemExit("Exit: OS data found is invalid '%s'" % os_found)
def remove_pyinstaller_temps():
""" Removes the temporary folders created by PyInstaller. """
dist_dir = os.path.join(os.getcwd(), "dist")
......@@ -69,12 +109,12 @@ def pyinstaller_build():
package folder. Captures the output streams and checks for errors.
:return: Boolean indicating the success state of the operation.
"""
process_args = ["python",
"package/pyinstaller/pyinstaller.py",
"package/pyinstaller.spec"]
process_args = [
"python",
"%s" % os.path.join("package", "pyinstaller", "pyinstaller.py"),
"%s" % os.path.join("package", "pyinstaller.spec")]
print(script_tab + "Command: %s" % process_args)
pipe = subprocess.PIPE
pyinstaller_process = subprocess.Popen(
process_args)
std_op, std_err_op = pyinstaller_process.communicate()
......@@ -114,36 +154,59 @@ def move_executable_folder():
return True
def copy_cefpython_data_files():
def copy_cefpython_data_files(os_type):
""" Copies into the executable folder required cefpython files. """
# Get the CEF python folder location and create a directory for exec folder
cef_path = os.path.dirname(cefpython3.__file__)
cef_exec_folder = os.path.join(
project_root_dir, exec_folder_name, "cefpython3")
cef_exec_locales = os.path.join(cef_exec_folder, "locales")
data_files = [
"%s/libcef.so" % cef_path,
"%s/libffmpegsumo.so" % cef_path,
"%s/subprocess" % cef_path]
locales = glob(r"%s/locales/*.*" % cef_path)
# Ensure the cefpython3 folders are created
if not os.path.exists(cef_exec_folder):
os.makedirs(cef_exec_folder)
if not os.path.exists(cef_exec_locales):
os.makedirs(cef_exec_locales)
# The data files depend on the operating system
data_files = []
if os_type == "linux":
data_files = [
"%s/libcef.so" % cef_path,
"%s/libffmpegsumo.so" % cef_path,
"%s/subprocess" % cef_path]
elif os_type == "mac":
data_files = [
"%s/cefpython_py27.so" % cef_path,
"%s/ffmpegsumo.so" % cef_path,
"%s/libcef.dylib" % cef_path,
"%s/libplugin_carbon_interpose.dylib" % cef_path,
"%s/subprocess" % cef_path]
# Copy all the files
print(script_tab + "Copying CEF files from %s\n" % cef_path +
script_tab + "into %s" % cef_exec_folder)
# Ensure the cefpython3 folder is created and copy the files
if not os.path.exists(cef_exec_folder):
os.makedirs(cef_exec_folder)
for f in data_files:
shutil.copy(f, cef_exec_folder)
for f in locales:
shutil.copy(f, cef_exec_locales)
# Copying the libproxy.so
#shutil.copy("/usr/lib/x86_64-linux-gnu/libproxy.so.1", cef_exec_folder)
# The locales is only present in linux, mac uses a resources folder
if os_type == "linux":
cef_exec_locales = os.path.join(cef_exec_folder, "locales")
print(script_tab + "Copying CEF locales files from %s/locales\n" %
cef_path + script_tab + "into %s" % cef_exec_locales)
locales = glob(r"%s/locales/*.*" % cef_exec_folder)
# Ensure the cefpython3/locales folder is created and copy the files
if not os.path.exists(cef_exec_locales):
os.makedirs(cef_exec_locales)
for f in locales:
shutil.copy(f, cef_exec_locales)
# The Resources is only present in mac, linux uses a locales folder
if os_type == "mac":
cef_exec_resources = os.path.join(cef_exec_folder, "Resources")
print(script_tab + "Copying CEF Resources files from %s/Resources\n" %
cef_path + script_tab + "into %s" % cef_exec_resources)
resources = glob(r"%s/Resources/*.*" % cef_exec_folder)
# Ensure the cefpython3/Resources folder is created and copy the files
if not os.path.exists(cef_exec_resources):
os.makedirs(cef_exec_resources)
for f in resources:
shutil.copy(f, cef_exec_resources)
def create_bash_file():
......@@ -169,14 +232,18 @@ def create_bash_file():
def build_ardublockly():
print(script_tag + "Building Ardublockly for Linux.")
print(script_tag + "Build procedure started.")
print(script_tag + "Checking for OS.")
os_type = get_os()
print(script_tag + "Building Ardublockly for %s." % os_type)
print(script_tag + "Project directory is: %s" % project_root_dir)
print(script_tag + "Script working directory: %s" % os.getcwd())
print(script_tag + "Removing PyInstaller old temp directories.")
remove_pyinstaller_temps()
print(script_tag + "Running PyInstaller process:")
print(script_tag + "Running PyInstaller process.")
success = pyinstaller_build()
if not success:
print(script_tab + "Removing PyInstaller recent temp directories.")
......@@ -196,7 +263,7 @@ def build_ardublockly():
"the PyInstaller execution.")
print(script_tag + "Coping cefpython data files into executable directory.")
copy_cefpython_data_files()
copy_cefpython_data_files(os_type)
print(script_tag + "Removing PyInstaller recent temp directories.")
remove_pyinstaller_temps()
......
......@@ -66,8 +66,7 @@ def copy_ardublockly_folder():
:return: Boolean indicating the success state of the operation.
"""
ignore_pat = (".git*", ".svn", ".travis*", ".appveyor*", "TestTemp_*",
"package", "python-cefpython3*")
"package")
if not os.path.exists(copied_project_dir):
print(script_tab + "Copying contents of %s\n" % project_root_dir +
script_tab + "into %s" % copied_project_dir)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment