-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
198 lines (132 loc) · 5.14 KB
/
build.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
#!/bin/sh
set -e
#--------------------------------------------------------------------------------------------------
# Settings
#--------------------------------------------------------------------------------------------------
external="$PWD/../3rdparty"
#--------------------------------------------------------------------------------------------------
VLC_version="3.0.16"
#--------------------------------------------------------------------------------------------------
# Android
VLC_version_android="3.4.5"
#--------------------------------------------------------------------------------------------------
# Syntax
#--------------------------------------------------------------------------------------------------
if [ $# != 1 ] \
|| \
[ $1 != "win32" -a $1 != "win64" -a $1 != "macOS" -a $1 != "linux" -a $1 != "android" ]; then
echo "Usage: build <win32 | win64 | macOS | linux | android>"
exit 1
fi
#--------------------------------------------------------------------------------------------------
# Configuration
#--------------------------------------------------------------------------------------------------
external="$external/$1"
if [ $1 = "win32" -o $1 = "win64" ]; then
os="windows"
elif [ $1 = "android" ]; then
os="default"
VLC_version=$VLC_version_android
else
os="default"
fi
#--------------------------------------------------------------------------------------------------
if [ $1 = "android" ]; then
VLC_url="https://code.videolan.org/videolan/vlc-android"
else
VLC_url="https://download.videolan.org/pub/videolan/vlc/$VLC_version/vlc-$VLC_version.tar.xz"
fi
#--------------------------------------------------------------------------------------------------
# Clean
#--------------------------------------------------------------------------------------------------
echo "CLEANING"
rm -rf deploy
mkdir deploy
touch deploy/.gitignore
rm -rf vlc-$VLC_version
#--------------------------------------------------------------------------------------------------
# Install
#--------------------------------------------------------------------------------------------------
if [ $1 = "linux" ]; then
sudo apt-get -y install build-essential pkg-config libtool automake autopoint gettext
#elif [ $1 = "android" ]; then
#
# sudo apt-get -y install automake ant autopoint cmake build-essential libtool-bin patch \
# pkg-config protobuf-compiler ragel subversion unzip git \
# openjdk-8-jre openjdk-8-jdk flex python wget
fi
#--------------------------------------------------------------------------------------------------
# Download
#--------------------------------------------------------------------------------------------------
if [ $1 != "android" ]; then
echo ""
echo "DOWNLOADING VLC"
echo $VLC_url
curl -L -o VLC.tar.xz $VLC_url
fi
#--------------------------------------------------------------------------------------------------
# Extract
#--------------------------------------------------------------------------------------------------
# NOTE Windows: We need to use 7z otherwise it seems to freeze Azure.
if [ $os = "windows" ]; then
echo ""
echo "EXTRACTING VLC"
7z x VLC.tar.xz > /dev/null
7z x VLC.tar > /dev/null
elif [ $1 != "android" ]; then
echo ""
echo "EXTRACTING VLC"
tar -xf VLC.tar.xz
fi
#--------------------------------------------------------------------------------------------------
# Clone
#--------------------------------------------------------------------------------------------------
if [ $1 = "android" ]; then
echo ""
echo "CLONING VLC"
echo $VLC_url
git clone $VLC_url vlc-$VLC_version
fi
#--------------------------------------------------------------------------------------------------
# Dependencies
#--------------------------------------------------------------------------------------------------
if [ $1 = "linux" ]; then
echo ""
echo "GET DEPENDENCIES"
sudo apt-get -y build-dep vlc
fi
#--------------------------------------------------------------------------------------------------
# Configure
#--------------------------------------------------------------------------------------------------
echo ""
echo "CONFIGURING VLC"
cd vlc-$VLC_version
if [ $1 = "linux" ]; then
./configure --prefix=$PWD/../deploy
elif [ $1 = "android" ]; then
git checkout tags/$VLC_version
fi
#--------------------------------------------------------------------------------------------------
# Build
#--------------------------------------------------------------------------------------------------
echo ""
echo "BUILDING VLC"
if [ $os = "windows" ]; then
mingw32-make
mingw32-make install
elif [ $1 = "android" ]; then
sh buildsystem/compile.sh -r
else
make
make install
fi
#--------------------------------------------------------------------------------------------------
# Deploy
#--------------------------------------------------------------------------------------------------
if [ $1 = "android" ]; then
echo ""
echo "DEPLOYING VLC"
mv vlc/include ../deploy
mv libvlc ../deploy
mv application/app ../deploy
fi