Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Travis #1029

Draft
wants to merge 8 commits into
base: unstable
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 48 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
language: cpp
os:
- osx

jobs:
allow_failures:
- os: osx

include:
- os: osx
osx_image: xcode11.3
# TODO, try both compilers
compiler: clang
env:
- Qt5_DIR="/usr/local/opt/qt"
addons:
homebrew:
update: true
packages:
- qt5
- eigen
- opencv
- cmake
- libusb
- create-dmg
- imagemagick
- tree
before_install:
- export PATH="/usr/local/opt/qt/bin:$PATH"
install:
- pip install dmgBuild

before_install:
- eval "${MATRIX_EVAL}"

script:
- pwd
- which cmake
- cmake --version
- rm -rf build
- mkdir build
- travis/build-opentrackdepends.sh
- travis/generate-travis-cmake.sh
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make install
- tree -dl install

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Intro

[<img src="https://ci.appveyor.com/api/projects/status/n0j9h38jnif5qbe9/branch/unstable?svg=true"/>](https://ci.appveyor.com/project/sthalik/opentrack/branch/unstable)
![Travis (.org) branch](https://img.shields.io/travis/opentrack/opentrack/travis?label=OSX&style=flat-square&logo=travis)

opentrack project home is located at <<http://github.com/opentrack/opentrack>>.

Expand Down
124 changes: 124 additions & 0 deletions macosx/dmgSettings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import biplist
import os.path

macosxPath = defines.get('macosxPath')
installPath = defines.get('installPath')
application = installPath + 'opentrack.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)

# .. Basics ....................................................................

# Uncomment to override the output filename
# filename = 'test.dmg'

# Uncomment to override the output volume name
volume_name = 'Opentrack'

# Volume format (see hdiutil create -help)
format = defines.get('format', 'UDBZ')

# Volume size
size = defines.get('size', None)

# Files to include
files = [ application,
installPath + 'Documentation',
installPath + 'X-Plane-Plugin',
installPath + 'source-code',
installPath + 'thirdparty'
]

# Symlinks to create
symlinks = { 'Applications': '/Applications' }

# 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 = {
'opentrack.app': (200, 180),
'Applications': (420, 180),
'Documentation': (20,40),
'source-code': (220,40),
'X-Plane-Plugin': (420,40),
'thirdparty': (620,40)
}

background = macosxPath + 'dmgbackground.png'

show_status_bar = False
show_tab_view = False
show_toolbar = False
show_pathbar = False
show_sidebar = False
sidebar_width = 180

window_rect = ((200, 120), (800, 450))

default_view = 'icon-view'

show_icon_preview = False

include_icon_view_settings = 'auto'
include_list_view_settings = 'auto'

# .. Icon view configuration ...................................................
arrange_by = None
grid_offset = (0, 0)
grid_spacing = 100
scroll_position = (0, 0)
label_pos = 'bottom' # or 'right'
text_size = 16
icon_size = 80

# .. List view configuration ...................................................
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',
}
35 changes: 11 additions & 24 deletions macosx/make-app-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
set -e

# keep track of the last executed command
trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
#trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG
# echo an error message before exiting
trap 'echo "--\n--\n--\n--\n\"${last_command}\" command failed with exit code $?."' EXIT
#trap 'echo "--\n--\n--\n--\n\"${last_command}\" command failed with exit code $?."' EXIT

APPNAME=opentrack
# Alternative we could look at https://github.com/arl/macdeployqtfix ??
Expand Down Expand Up @@ -59,32 +59,19 @@ sips -z 512 512 "$tmp/opentrack.png" --out "$tmp/$APPNAME.iconset/icon_512x512
iconutil -c icns -o "$install/$APPNAME.app/Contents/Resources/$APPNAME.icns" "$tmp/$APPNAME.iconset"
rm -rf "$tmp"

# Rename additional directories
mv $install/xplane $install/X-Plane-Plugin
mv $install/doc $install/Documentation

#Build DMG
#https://github.com/andreyvit/create-dmg
rm -rf $install/../*.dmg
create-dmg \
--volname "$APPNAME" \
--volicon "$install/$APPNAME.app/Contents/Resources/$APPNAME.icns" \
--window-pos 200 120 \
--window-size 800 450 \
--icon-size 80 \
--background "$dir/dmgbackground.png" \
--icon "$APPNAME.app" 200 180 \
--app-drop-link 420 180 \
--hide-extension "$APPNAME.app" \
--no-internet-enable \
--add-folder "Document" "$install/doc" 20 40 \
--add-folder "source-code" "$install/source-code" 220 40 \
--add-folder "Xplane-Plugin" "$install/xplane" 420 40 \
--add-folder "thirdparty" "$install/thirdparty" 620 40 \
"$version.dmg" \
"$install/$APPNAME.app"
#https://dmgbuild.readthedocs.io/en/latest/
dmgbuild -s $dir/dmgSettings.py -D macosxPath="$dir/" -D installPath="$install/" $APPNAME $install/../$version.dmg

# Check if we have a DMG otherwise fail
FILE=$install/../$version.dmg
if [ -f $FILE ]; then
ls -ial $install/../*.dmg
ls -ial $install/../*.dmg
else
echo "Failed to create ${FILE}"
exit 2
echo "Failed to create ${FILE}"
exit 2
fi
8 changes: 8 additions & 0 deletions travis/build-opentrackdepends.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
pwd=`pwd`
git clone --recurse-submodules -j8 https://github.com/opentrack/opentrack-depends
mkdir opentrack-depends/aruco/build
cd opentrack-depends/aruco/build
cmake ..
make
cd $pwd
15 changes: 15 additions & 0 deletions travis/generate-travis-cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

cat << EOF > sdk-paths-$LOGNAME@Clang-Darwin.cmake
set(__depdir "${CMAKE_CURRENT_LIST_DIR}/opentrack-depends")

function(set_sdk name value)
set("${name}" "${__depdir}/${value}" CACHE INTERNAL "" FORCE)
endfunction()

set_sdk(SDK_ARUCO_LIBPATH "aruco/build/src/libaruco.a")
#set_sdk(SDK_HYDRA "SixenseSDK")
#set_sdk(SDK_VALVE_STEAMVR "steamvr")
#set_sdk(SDK_WINE TRUE)
set_sdk(SDK_XPLANE "X-Plane-SDK")
EOF
1 change: 1 addition & 0 deletions video-ps3eye/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ps3eye-driver/CMakeLists.txt")
if(libusb_FOUND)
include_directories(SYSTEM ${libusb_INCLUDE_DIRS})
link_libraries(${libusb_LIBRARIES})
link_directories(${libusb_LIBRARY_DIRS})
endif()
else()
set(SDK_LIBUSB CACHE PATH "")
Expand Down