-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-vpx.sh
executable file
·69 lines (55 loc) · 1.32 KB
/
build-vpx.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
#!/bin/bash
TEMP_DIR="temp"
LIBVPX_DIR="libvpx"
VPX_FRAMEWORK="vpx.framework"
# $1 - framework directory
remove_old_framework() {
if [ -d "$1" ]; then
echo "Removing $1"
rm -rf "$1"
fi
}
clone_libvpx() {
echo "Cloning libvpx"
mkdir $TEMP_DIR
cd $TEMP_DIR
git clone --branch v1.4.0 --depth 1 https://github.com/webmproject/libvpx.git $LIBVPX_DIR
}
# $1 - patch file name
patch_vpx() {
echo "Patching libvpx"
cd $LIBVPX_DIR
git apply ../../$1
cd ../..
}
build_vpx() {
echo "Building vpx framework"
$TEMP_DIR/$LIBVPX_DIR/build/make/iosbuild.sh --show-build-output --verbose
echo "Moving headers from $VPX_FRAMEWORK/Headers/vpx/ to $VPX_FRAMEWORK/Headers/"
mv $VPX_FRAMEWORK/Headers/vpx/* $VPX_FRAMEWORK/Headers/
rm -rf $VPX_FRAMEWORK/Headers/vpx
}
# $2 - directory to move framework to
move_vpx() {
echo "Moving framework from $VPX_FRAMEWORK to $1/$VPX_FRAMEWORK"
mkdir $1
mv $VPX_FRAMEWORK $1/$VPX_FRAMEWORK
}
cleanup() {
echo "Removing $TEMP_DIR directory"
rm -rf $TEMP_DIR
}
# $1 - patch file name
# $2 - directory install framework to
do_all() {
echo "Building for $2"
remove_old_framework $2
clone_libvpx
patch_vpx $1
build_vpx
move_vpx $2
cleanup
}
do_all vpx-osx.diff osx
do_all vpx-ios.diff ios
echo "Done"