-
Notifications
You must be signed in to change notification settings - Fork 8
/
mac_deploy.sh
executable file
·123 lines (107 loc) · 3.31 KB
/
mac_deploy.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
APP='Tanglet'
BUNDLE="$APP.app"
VERSION='1.6.5'
# Locate deployment script
BIN_DIR=$(pwd)
cd $(dirname "${BASH_SOURCE[0]}")
# Remove any previous disk folder or DMG
echo -n 'Preparing... '
rm -f "${APP}_$VERSION.dmg"
if [ -e "/Volumes/$APP" ]; then
hdiutil detach -quiet "/Volumes/$APP"
fi
rm -Rf "$APP"
echo 'Done'
# Create disk folder
echo -n 'Copying application bundle... '
mkdir "$APP"
cp -Rf "${BIN_DIR}/${BUNDLE}" "$APP/"
strip "$APP/$BUNDLE/Contents/MacOS/$APP"
cp LICENSES/GPL-3.0-or-later.txt "$APP/License.txt"
echo 'Done'
# Create ReadMe
echo -n 'Creating ReadMe... '
cp README "$APP/Read Me.txt"
echo >> "$APP/Read Me.txt"
echo >> "$APP/Read Me.txt"
echo 'CREDITS' >> "$APP/Read Me.txt"
echo '=======' >> "$APP/Read Me.txt"
echo >> "$APP/Read Me.txt"
cat CREDITS >> "$APP/Read Me.txt"
echo >> "$APP/Read Me.txt"
echo >> "$APP/Read Me.txt"
echo 'NEWS' >> "$APP/Read Me.txt"
echo '====' >> "$APP/Read Me.txt"
echo >> "$APP/Read Me.txt"
cat ChangeLog >> "$APP/Read Me.txt"
echo 'Done'
# Copy Qt translations
echo -n 'Copying Qt translations... '
TRANSLATIONS="$APP/$BUNDLE/Contents/Resources/translations"
cp $QTDIR/translations/qt_* "$TRANSLATIONS"
cp $QTDIR/translations/qtbase_* "$TRANSLATIONS"
rm -f $TRANSLATIONS/qt_help_*
echo 'Done'
# Copy frameworks and plugins
echo -n 'Copying frameworks and plugins... '
macdeployqt "$APP/$BUNDLE"
rm -Rf "$APP/$BUNDLE/Contents/Frameworks/QtSvg.framework"
rm -Rf "$APP/$BUNDLE/Contents/PlugIns/iconengines"
rm -Rf "$APP/$BUNDLE/Contents/PlugIns/imageformats"
echo 'Done'
# Copy background
echo -n 'Copying background... '
mkdir "$APP/.background"
cp mac/background.tiff "$APP/.background/background.tiff"
echo 'Done'
# Create disk image
echo -n 'Creating disk image... '
hdiutil create -quiet -srcfolder "$APP" -volname "$APP" -fs HFS+ -format UDRW 'temp.dmg'
echo 'Done'
echo -n 'Configuring disk image... '
hdiutil attach -quiet -readwrite -noverify -noautoopen 'temp.dmg'
echo '
tell application "Finder"
tell disk "'$APP'"
open
tell container window
set the bounds to {400, 100, 949, 458}
set current view to icon view
set toolbar visible to false
set statusbar visible to true
set the bounds to {400, 100, 800, 460}
end tell
set viewOptions to the icon view options of container window
tell viewOptions
set arrangement to not arranged
set icon size to 80
set label position to bottom
set shows icon preview to true
set shows item info to false
end tell
set background picture of viewOptions to file ".background:background.tiff"
make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
set position of item "'$BUNDLE'" of container window to {90, 90}
set position of item "Applications" of container window to {310, 90}
set position of item "Read Me.txt" of container window to {140, 215}
set position of item "License.txt" of container window to {260, 215}
close
open
update without registering applications
delay 5
end tell
end tell
' | osascript
chmod -Rf go-w "/Volumes/$APP" >& /dev/null
sync
hdiutil detach -quiet "/Volumes/$APP"
echo 'Done'
echo -n 'Compressing disk image... '
hdiutil convert -quiet 'temp.dmg' -format UDBZ -o "${APP}_${VERSION}.dmg"
rm -f temp.dmg
echo 'Done'
# Clean up disk folder
echo -n 'Cleaning up... '
rm -Rf "$APP"
echo 'Done'