forked from 3on/vlc-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompileVLCforiOS.sh
executable file
·321 lines (283 loc) · 6.99 KB
/
compileVLCforiOS.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
#!/bin/sh
# Copyright (C) Pierre d'Herbemont, 2010
# Copyright (C) Felix Paul Kühne, 2012-2013
set -e
PLATFORM=iphoneos
SDK=7.0
SDK_MIN=6.1
VERBOSE=no
CONFIGURATION="Release"
NONETWORK=no
SKIPLIBVLCCOMPILATION=no
TESTEDVLCKITHASH=c034a2455
TESTEDMEDIALIBRARYKITHASH=9c6382eb1
usage()
{
cat << EOF
usage: $0 [-s] [-v] [-k sdk]
OPTIONS
-k Specify which sdk to use (see 'xcodebuild -showsdks', current: ${SDK})
-v Be more verbose
-s Build for simulator
-d Enable Debug
-n Skip script steps requiring network interaction
-l Skip libvlc compilation
EOF
}
spushd()
{
pushd "$1" 2>&1> /dev/null
}
spopd()
{
popd 2>&1> /dev/null
}
info()
{
local green="\033[1;32m"
local normal="\033[0m"
echo "[${green}info${normal}] $1"
}
buildxcodeproj()
{
local target="$2"
if [ "x$target" = "x" ]; then
target="$1"
fi
info "Building $1 ($target, ${CONFIGURATION})"
local extra=""
if [ "$PLATFORM" = "Simulator" ]; then
extra="ARCHS=i386"
fi
xcodebuild -project "$1.xcodeproj" \
-target "$target" \
-sdk $PLATFORM$SDK \
-configuration ${CONFIGURATION} ${extra} \
IPHONEOS_DEPLOYMENT_TARGET=${SDK_MIN} > ${out}
}
while getopts "hvsdnlk:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
v)
VERBOSE=yes
;;
s)
PLATFORM=iphonesimulator
;;
d) CONFIGURATION="Debug"
;;
n)
NONETWORK=yes
;;
l)
SKIPLIBVLCCOMPILATION=yes
;;
k)
SDK=$OPTARG
;;
?)
usage
exit 1
;;
esac
done
shift $(($OPTIND - 1))
out="/dev/null"
if [ "$VERBOSE" = "yes" ]; then
out="/dev/stdout"
fi
if [ "x$1" != "x" ]; then
usage
exit 1
fi
# Get root dir
spushd .
aspen_root_dir=`pwd`
spopd
info "Preparing build dirs"
mkdir -p ImportedSources
rm -rf External
mkdir -p External
spushd ImportedSources
if [ "$NONETWORK" != "yes" ]; then
if ! [ -e MediaLibraryKit ]; then
git clone git://git.videolan.org/MediaLibraryKit.git
cd MediaLibraryKit
git checkout -B localAspenBranch ${TESTEDMEDIALIBRARYKITHASH}
git branch --set-upstream-to=origin/master localAspenBranch
cd ..
else
cd MediaLibraryKit
git pull --rebase
git reset --hard ${TESTEDMEDIALIBRARYKITHASH}
cd ..
fi
if ! [ -e VLCKit ]; then
git clone git://git.videolan.org/vlc-bindings/VLCKit.git
cd VLCKit
git checkout -B localAspenBranch ${TESTEDVLCKITHASH}
git branch --set-upstream-to=origin/master localAspenBranch
cd ..
else
cd VLCKit
git pull --rebase
git reset --hard ${TESTEDVLCKITHASH}
cd ..
fi
if ! [ -e OBSlider ]; then
git clone git://github.com/ole/OBSlider.git
else
cd OBSlider && git pull --rebase && cd ..
fi
if ! [ -e DAVKit ]; then
git clone git://github.com/mattrajca/DAVKit.git
else
cd DAVKit && git pull --rebase && cd ..
fi
if ! [ -e PLCrashReporter ]; then
git clone https://opensource.plausible.coop/stash/scm/plcr/plcrashreporter.git PLCrashReporter
cd PLCrashReporter
git am ../../patches/plcrashreporter/*.patch
if [ $? -ne 0 ]; then
git am --abort
info "Applying the patches failed, aborting git-am"
exit 1
fi
cd ..
fi
if ! [ -e QuincyKit ]; then
git clone git://github.com/TheRealKerni/QuincyKit.git
cd QuincyKit
git am ../../patches/quincykit/*.patch
if [ $? -ne 0 ]; then
git am --abort
info "Applying the patches failed, aborting git-am"
exit 1
fi
cd ..
fi
if ! [ -e GDrive ]; then
svn checkout http://google-api-objectivec-client.googlecode.com/svn/trunk/Source GDrive
else
cd GDrive && svn up && cd ..
fi
if ! [ -e GHSidebarNav ]; then
git clone git://github.com/gresrun/GHSidebarNav.git
else
cd GHSidebarNav && git pull --rebase && cd ..
fi
if ! [ -e upnpx ]; then
git clone git://github.com/fkuehne/upnpx.git
else
cd upnpx && git pull --rebase && cd ..
fi
if ! [ -e WhiteRaccoon ]; then
git clone git://github.com/fkuehne/WhiteRaccoon.git
else
cd WhiteRaccoon && git pull --rebase && cd ..
fi
if ! [ -e CocoaHTTPServer ]; then
git clone git://github.com/robbiehanson/CocoaHTTPServer.git
cd CocoaHTTPServer
git am ../../patches/cocoahttpserver/*.patch
if [ $? -ne 0 ]; then
git am --abort
info "Applying the patches failed, aborting git-am"
exit 1
fi
cd ..
else
cd CocoaHTTPServer && git pull --rebase && cd ..
fi
if ! [ -e Dropbox ]; then
DROPBOXSDKVERSION=1.3.9
curl -O https://www.dropbox.com/static/developers/dropbox-ios-sdk-${DROPBOXSDKVERSION}.zip
unzip -q dropbox-ios-sdk-${DROPBOXSDKVERSION}.zip
mv dropbox-ios-sdk-${DROPBOXSDKVERSION} Dropbox
rm dropbox-ios-sdk-${DROPBOXSDKVERSION}.zip
rm -rf __MACOSX
fi
if ! [ -e InAppSettingsKit ]; then
git clone git://github.com/futuretap/InAppSettingsKit.git
cd InAppSettingsKit
git am ../../patches/inappsettingskit/*.patch
if [ $? -ne 0 ]; then
git am --abort
info "Applying the patches failed, aborting git-am"
exit 1
fi
cd ..
fi
fi
info "Setup 'External' folders"
if [ "$PLATFORM" = "iphonesimulator" ]; then
xcbuilddir="build/${CONFIGURATION}-iphonesimulator"
else
xcbuilddir="build/${CONFIGURATION}-iphoneos"
fi
framework_build="${aspen_root_dir}/ImportedSources/VLCKit/${xcbuilddir}"
mlkit_build="${aspen_root_dir}/ImportedSources/MediaLibraryKit/${xcbuilddir}"
upnpx_build="${aspen_root_dir}/ImportedSources/upnpx/projects/xcode4/upnpx/${xcbuilddir}"
gtl_build="${aspen_root_dir}/ImportedSources/GDrive/${xcbuilddir}"
plcrashreporter_build="${aspen_root_dir}/ImportedSources/PLCrashReporter/${xcbuilddir}"
quincykit_build="${aspen_root_dir}/ImportedSources/QuincyKit/client/iOS/QuincyLib/${xcbuilddir}"
spopd #ImportedSources
ln -sf ${framework_build} External/MobileVLCKit
ln -sf ${mlkit_build} External/MediaLibraryKit
ln -sf ${upnpx_build} External/upnpx
ln -sf ${gtl_build} External/gtl
ln -sf ${plcrashreporter_build} External/PLCrashReporter
ln -sf ${quincykit_build} External/QuincyKit
#
# Build time
#
info "Building"
spushd ImportedSources
spushd VLCKit
echo `pwd`
args=""
if [ "$VERBOSE" = "yes" ]; then
args="${args} -v"
fi
if [ "$PLATFORM" = "iphonesimulator" ]; then
args="${args} -s"
fi
if [ "$NONETWORK" = "yes" ]; then
args="${args} -n"
fi
if [ "$SKIPLIBVLCCOMPILATION" = "yes" ]; then
args="${args} -l"
fi
./buildMobileVLCKit.sh ${args} -k "${SDK}"
buildxcodeproj MobileVLCKit "Aggregate static plugins"
buildxcodeproj MobileVLCKit "MobileVLCKit"
spopd
spushd MediaLibraryKit
rm -f External/MobileVLCKit
ln -sf ${framework_build} External/MobileVLCKit
buildxcodeproj MediaLibraryKit
spopd
spushd upnpx/projects/xcode4/upnpx
buildxcodeproj upnpx
spopd
spushd GDrive
buildxcodeproj GTL "GTLTouchStaticLib"
spopd
spushd PLCrashReporter
if [ "$PLATFORM" = "iphonesimulator" ]; then
buildxcodeproj CrashReporter "CrashReporter-iOS-Simulator"
else
buildxcodeproj CrashReporter "CrashReporter-iOS-Device"
fi
spopd
spushd QuincyKit/client/iOS/QuincyLib
buildxcodeproj QuincyLib
spopd
spopd # ImportedSources
# Build the Aspen Project now
buildxcodeproj "VLC for iOS" "vlc-ios"
info "Build completed"