This repository has been archived by the owner on Jul 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathcreate_osx_bundle.sh
executable file
·53 lines (41 loc) · 1.8 KB
/
create_osx_bundle.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# (No need to be changed)
libDir=../lib/osx
# /!\ Where is installed Qt?
qtDir=/Users/mbach/Qt5.6.0/5.6/clang_64
# /!\ Where is the player built with QtCreator?
build=/Users/mbach/dev/Miam-Player-build/src
# /!\ Current release
version=0.8.0
# Everything else below should be straight forward
### Libraries
# Copy and modify uncomplete App first
if [ -d MiamPlayer.app ]; then
rm -rf MiamPlayer.app
fi
cp -R ${build}/Player/MiamPlayer.app .
frameworks=MiamPlayer.app/Contents/Frameworks
mkdir -p ${frameworks}
# 3rd party dependencies (TagLib, QtAV)
cp ${libDir}/*.dylib ${frameworks}
cp -R ${libDir}/QtAV.framework ${frameworks}/QtAV.framework
# Change how MiamCore is linked to QtAV (removing absolute paths)
for core in MiamPlayer.app/Contents/Frameworks/libmiam-core.*.dylib
do
install_name_tool -change "${qtDir}/lib//QtAV.framework/Versions/1/QtAV" "@rpath/QtAV.framework/Versions/1/QtAV" ${core};
done
### Bundle
cp Info.plist MiamPlayer.app/Contents/
# Create bundle
${qtDir}/bin/macdeployqt MiamPlayer.app -always-overwrite -appstore-compliant
# Somehow, macdeployqt messes around with other packages
# Change how QtAV is linked to Qt Framework
install_name_tool -id "@rpath/QtAV.framework/Versions/1/QtAV" ${frameworks}/QtAV.framework/QtAV
install_name_tool -change "${qtDir}/lib//QtGui.framework/Versions/5/QtGui" "@rpath/QtGui.framework/Versions/5/QtGui" ${frameworks}/QtAV.framework/QtAV
install_name_tool -change "${qtDir}/lib//QtCore.framework/Versions/5/QtCore" "@rpath/QtCore.framework/Versions/5/QtCore" ${frameworks}/QtAV.framework/QtAV
# Create the final redistributable package
rm -rf MiamPlayer-${version}.dmg
appdmg spec.json MiamPlayer-${version}.dmg > /dev/null 2>&1 || {
echo >&2 "appdmg is required to build the final package. Please install npm and appdmg. Aborting.";
exit 1;
}