Added Travis CI, DMG creation, and VLC install script on macOS

This commit is contained in:
alby128 2017-09-28 19:52:58 +02:00
parent b27f353e71
commit 4cac5d503c
4 changed files with 217 additions and 1 deletions

3
.gitignore vendored
View File

@ -9,4 +9,5 @@ venv
/syncplay v*
syncplay_setup.nsi
dist.7z
.*
.*
!.travis.yml

52
.travis.yml Normal file
View File

@ -0,0 +1,52 @@
language: objective-c
osx_image: xcode7.3
branches:
only:
- pyside2
script:
- python buildPy2app.py py2app
before_install:
- curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/fdfc724dd532345f5c6cdf47dc43e99654e6a5fd/Formula/qt5.rb
- brew install ./qt5.rb
- which python
- which pip
- pip install http://syncplay.s3.amazonaws.com/PySide2-5.6-cp27-cp27m-macosx_10_11_x86_64.whl
- ln -s /usr/local/lib/python2.7/site-packages/PySide2/libshiboken2-python2.7v.2.0.0.dylib /usr/local/lib/
- ln -s /usr/local/lib/python2.7/site-packages/PySide2/libshiboken2-python2.7v.2.0.dylib /usr/local/lib/
- ln -s /usr/local/lib/python2.7/site-packages/PySide2/libshiboken2-python2.7v.dylib /usr/local/lib/
- ln -s /usr/local/lib/python2.7/site-packages/PySide2/libpyside2-python2.7v.2.0.0.dylib /usr/local/lib/
- ln -s /usr/local/lib/python2.7/site-packages/PySide2/libpyside2-python2.7v.2.0.dylib /usr/local/lib/
- ln -s /usr/local/lib/python2.7/site-packages/PySide2/libpyside2-python2.7v.dylib /usr/local/lib/
- python -c "from PySide2 import QtCore"
- hg clone https://alby128@bitbucket.org/alby128/py2app
- cd py2app
- python setup.py install
- python -c "from py2app.recipes import pyside2"
install:
- pip install twisted appnope pyobjc
- git clone -b pyside2 https://github.com/alby128/syncplay.git syncplay_PySide2
- cd syncplay_PySide2
- git checkout pyside2
before_deploy:
- pip install dmgbuild
- mkdir dist_dmg
- mv resources/macos_vlc_install.command resources/.macos_vlc_install.command
- dmgbuild -s appdmg.py "Syncplay" dist_dmg/Syncplay-PySide2.dmg
deploy:
provider: s3
access_key_id: AKIAJS554GLAZJ5L6TUA
secret_access_key:
secure: "iDuHZ6lgASU1O/9UKncgKfJZ96PpLzdKKvASDKCDPWBXXI5LyjGIIZJxbdjcE+WVoHYCCrN9Xn2XvhEjapqBzD2uKMH4QvN5mOG62FaPPOIPr+CCZxuEQuUQ8LUSIwQO3huu0K4eLn6q5b/ihmiWkTAssZFx1pccv15CJiwVPDwunULC2P55d/GxRohN2HcHDHGbHwlXasgvOx68xxbDEO4Ox7KRwcSIHnmx6vInQtzpqdnme8t1kmGG2vp6juyh39vCN0RzoJ5aH17qht/0nNvkbxnPcUg7jsDayOuWiwMgp4s+EYdyCh33IM3LQugxPqa3za5yjYQqC92SoaQg8FnsoU1sf7FHMCmb4mv8ZwgTD78+Ood/7lKHaOVGnxkoBtdrtXXf2tU/WyAGXTw4zc6eA+MIXC6FmNQFJaRUvGZPF+u+awHNJGAlmIhFOASBW4Ua6qahNzcasRE8e3cuzYuVzK4R24TRWqjYCadHd6SNh2FKVGYEKK1FcADUxn5GzldcovG3wsHRK6ONCS57s5xBlajVfEB4b78EqYkRgQQTAnCvNcUAbfsJOYywtSj/4keaGQeRydoY9qMl6MPpVXqn+r9bbglLBIOPzUr2EWXj/O6gq7bd9eSwCa1PvGplboDahkfWmVZKJ6rZpuvUfoQcKmuJiIpgowCczP9NNco="
bucket: syncplay
skip_cleanup: true
region: eu-central-1
local_dir: dist_dmg
on:
branch: pyside2

158
appdmg.py Normal file
View File

@ -0,0 +1,158 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import biplist
import os.path
application = defines.get('app', 'dist/Syncplay.app')
appname = os.path.basename(application)
def icon_from_app(app_path):
plist_path = os.path.join(app_path, 'Contents', 'Info.plist')
plist = biplist.readPlist(plist_path)
icon_name = plist['CFBundleIconFile']
icon_root,icon_ext = os.path.splitext(icon_name)
if not icon_ext:
icon_ext = '.icns'
icon_name = icon_root + icon_ext
return os.path.join(app_path, 'Contents', 'Resources', icon_name)
# Volume format (see hdiutil create -help)
format = defines.get('format', 'UDZO')
# Compression level (if relevant)
compression_level = 9
# Volume size
size = defines.get('size', None)
# Files to include
files = [ application, 'resources/lua/intf/syncplay.lua', 'resources/.macos_vlc_install.command' ]
# Symlinks to create
symlinks = { 'Applications': '/Applications', 'Install in VLC': '.macos_vlc_install.command' }
# Volume icon
#
# You can either define icon, in which case that icon file will be copied to the
# image, *or* you can define badge_icon, in which case the icon file you specify
# will be used to badge the system's Removable Disk icon
#
#icon = '/path/to/icon.icns'
badge_icon = icon_from_app(application)
# Where to put the icons
icon_locations = {
appname: (80, 80),
'Applications': (280, 80),
'syncplay.lua': (80, 240),
'Install in VLC': (280, 240)
}
# .. Window configuration ......................................................
# Background
#
# This is a STRING containing any of the following:
#
# #3344ff - web-style RGB color
# #34f - web-style RGB color, short form (#34f == #3344ff)
# rgb(1,0,0) - RGB color, each value is between 0 and 1
# hsl(120,1,.5) - HSL (hue saturation lightness) color
# hwb(300,0,0) - HWB (hue whiteness blackness) color
# cmyk(0,1,0,0) - CMYK color
# goldenrod - X11/SVG named color
# builtin-arrow - A simple built-in background with a blue arrow
# /foo/bar/baz.png - The path to an image file
#
# The hue component in hsl() and hwb() may include a unit; it defaults to
# degrees ('deg'), but also supports radians ('rad') and gradians ('grad'
# or 'gon').
#
# Other color components may be expressed either in the range 0 to 1, or
# as percentages (e.g. 60% is equivalent to 0.6).
background = '#bacbe0'
show_status_bar = False
show_tab_view = False
show_toolbar = False
show_pathbar = False
show_sidebar = False
sidebar_width = 180
# Window position in ((x, y), (w, h)) format
window_rect = ((100, 100), (360, 400))
# Select the default view; must be one of
#
# 'icon-view'
# 'list-view'
# 'column-view'
# 'coverflow'
#
default_view = 'icon-view'
# General view configuration
show_icon_preview = False
# Set these to True to force inclusion of icon/list view settings (otherwise
# we only include settings for the default view)
include_icon_view_settings = 'auto'
include_list_view_settings = 'auto'
# .. Icon view configuration ...................................................
arrange_by = None
grid_offset = (0, 0)
grid_spacing = 20
scroll_position = (0, 0)
label_pos = 'bottom' # or 'right'
text_size = 12
icon_size = 80
# .. List view configuration ...................................................
# Column names are as follows:
#
# name
# date-modified
# date-created
# date-added
# date-last-opened
# size
# kind
# label
# version
# comments
#
list_icon_size = 16
list_text_size = 12
list_scroll_position = (0, 0)
list_sort_by = 'name'
list_use_relative_dates = True
list_calculate_all_sizes = False,
list_columns = ('name', 'date-modified', 'size', 'kind', 'date-added')
list_column_widths = {
'name': 300,
'date-modified': 181,
'date-created': 181,
'date-added': 181,
'date-last-opened': 181,
'size': 97,
'kind': 115,
'label': 100,
'version': 75,
'comments': 300,
}
list_column_sort_directions = {
'name': 'ascending',
'date-modified': 'descending',
'date-created': 'descending',
'date-added': 'descending',
'date-last-opened': 'descending',
'size': 'descending',
'kind': 'ascending',
'label': 'ascending',
'version': 'ascending',
'comments': 'ascending',
}

View File

@ -0,0 +1,5 @@
#!/bin/sh
mkdir -p $HOME/Library/Application\ Support/org.videolan.vlc/lua/intf/
cp /Volumes/Syncplay/syncplay.lua $HOME/Library/Application\ Support/org.videolan.vlc/lua/intf/