Skip to content

Commit

Permalink
fix travis builds
Browse files Browse the repository at this point in the history
  • Loading branch information
freemountain authored and freemountain committed Nov 23, 2016
1 parent 722cfc6 commit 548c5c4
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ dist: trusty
language: generic
os:
- osx
- linux

script:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install qt5 p7zip; fi
Expand All @@ -14,7 +15,7 @@ script:
- cd tools && make bootstrap && cd ..
- mkdir build && cd build && qmake .. && make && make clean
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then ../tools/deploy_linux.sh quark && mv Quark-x86_64.AppImage quark-linux-x64.AppImage; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then ../tools/deploy_mac.sh quark.app && 7z a quark-osx-x64.7z quark.app; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then ../tools/deploy_mac.sh quark.app && ../tools/fixTravis.sh quark.app /usr/local/Cellar/qt5/5.7.0/lib && 7z a quark-osx-x64.7z quark.app; fi
- ls .
- pwd

Expand Down
2 changes: 1 addition & 1 deletion tools/deploy_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
PROJECT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../"
TARGET_APP=$1

macdeployqt $TARGET_APP -qmldir=$PROJECT_PATH/src/qml
macdeployqt $TARGET_APP -qmldir=$PROJECT_PATH/src/qml -no-strip
50 changes: 50 additions & 0 deletions tools/fixTravis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

PROJECT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../"
TARGET_APP=$(realpath $1)
QT_LIB_PATH=$2

cd "$TARGET_APP/Contents"

QT_FRAMEWORKS=$(ls Frameworks|grep -e 'Qt\w*\.framework')
QT_PLUGINS=$(find PlugIns -name '*.dylib')

for lib in $QT_FRAMEWORKS
do
echo $lib
name="${lib%.*}"
install_name_tool -id @executable_path/../Frameworks/$lib/Versions/5/$name $TARGET_APP/Contents/Frameworks/$lib/Versions/5/$name
done

for lib in $QT_FRAMEWORKS
do
echo $lib
name="${lib%.*}"
install_name_tool -change $QT_LIB_PATH/$lib/Versions/5/$name \
@executable_path/../Frameworks/$lib/Versions/5/$name \
$TARGET_APP/Contents/MacOS/quark
done

for lib in $QT_FRAMEWORKS
do
echo $lib
name="${lib%.*}"
for dep in $QT_FRAMEWORKS
do
dep_name="${dep%.*}"
install_name_tool -change $QT_LIB_PATH/$dep/Versions/5/$dep_name \
@executable_path/../Frameworks/$dep/Versions/5/$dep_name \
$TARGET_APP/Contents/Frameworks/$lib/Versions/5/$name
done
done

for plugin in $QT_PLUGINS
do
for lib in $QT_FRAMEWORKS
do
name="${lib%.*}"
install_name_tool -change $QT_LIB_PATH/$lib/Versions/5/$name \
@executable_path/../Frameworks/$lib/Versions/5/$name \
$TARGET_APP/Contents/$plugin
done
done

0 comments on commit 548c5c4

Please sign in to comment.