-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuildMobileVLC.sh
executable file
·166 lines (133 loc) · 2.81 KB
/
buildMobileVLC.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
#!/bin/sh
set -e
PLATFORM=OS
SDK=iphoneos3.2
VERBOSE=no
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
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)"
local extra=""
if [ "$PLATFORM" = "Simulator" ]; then
extra="ARCHS=i386"
fi
xcodebuild -project "$1.xcodeproj" \
-target "$target" \
-sdk $SDK \
-configuration "Release" ${extra} > ${out}
}
while getopts "hvsk:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
v)
VERBOSE=yes
;;
s)
PLATFORM=Simulator
SDK=iphonesimulator3.2
;;
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 .
mvlc_root_dir=`pwd`
spopd
info "Preparing build dirs"
mkdir -p ImportedSources
spushd ImportedSources
if ! [ -e vlc ]; then
git clone git://git.videolan.org/vlc.git
fi
if ! [ -e MediaLibraryKit ]; then
git clone git://github.com/pdherbemont/MediaLibraryKit.git
fi
if [ "$PLATFORM" = "Simulator" ]; then
xcbuilddir="build/Release-iphonesimulator"
else
xcbuilddir="build/Release-iphoneos"
fi
framework_build="${mvlc_root_dir}/ImportedSources/vlc/projects/macosx/framework/${xcbuilddir}"
mlkit_build="${mvlc_root_dir}/ImportedSources/MediaLibraryKit/${xcbuilddir}"
spushd MediaLibraryKit
rm -f External/MobileVLCKit
ln -sf ${framework_build} External/MobileVLCKit
spopd
spopd #ImportedSources
rm -f External/MobileVLCKit
rm -f External/MediaLibraryKit
ln -sf ${framework_build} External/MobileVLCKit
ln -sf ${mlkit_build} External/MediaLibraryKit
#
# Build time
#
info "Building"
spushd ImportedSources
spushd vlc/extras/package/ios
info "Building vlc"
args=""
if [ "$PLATFORM" = "Simulator" ]; then
args="${args} -s"
fi
if [ "$VERBOSE" = "yes" ]; then
args="${args} -v"
fi
./build.sh ${args} -k "${SDK}"
spopd
spushd vlc/projects/macosx/framework
buildxcodeproj MobileVLCKit "Aggregate static plugins"
buildxcodeproj MobileVLCKit "MobileVLCKit"
spopd
spushd MediaLibraryKit
buildxcodeproj MobileMediaLibraryKit
spopd
spopd # ImportedSources
# Build Mobile VLC now
buildxcodeproj MobileVLC
info "Build completed"