-
Notifications
You must be signed in to change notification settings - Fork 3
/
ios.sh
executable file
·83 lines (63 loc) · 1.29 KB
/
ios.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
#!/bin/sh
set -e
set -o pipefail
source config.sh
config_for_ios
CWD=$(pwd)
LOG="${CWD}/${BUILD_DIR}/${BUILD_EXT}/build.log"
FAT="${BUILD_DIR}/${BUILD_EXT}/lib"
DEPS=(
aom
zvbi
freetype
fribidi
harfbuzz
libass
openssl
ffmpeg
mpv
)
ARCHS=(
arm64
x86_64
)
LIPO=
echo "Starting Build $(date)" | tee ${LOG}
for DEP in ${DEPS[@]}
do
cd ${CWD}
SCRIPT_PATH="scripts/build-${DEP}.sh"
for ARCH in ${ARCHS[@]}
do
echo "Building library ${DEP} for ${ARCH}" | tee -a ${LOG}
config_for_ios $ARCH
${SCRIPT_PATH} $ARCH 2>&1 | tee -a ${LOG}
[ "$?" != 0 ] && exit $?
done
done
if [ "$LIPO" ]
then
echo "Building fat libraries..." | tee -a ${LOG}
if [ ! -r $FAT ]
then
mkdir $FAT
fi
LIPO_ARCHS=(
arm64
x86_64
)
arch_0=${LIPO_ARCHS[0]}
for lib in $(ls ${BUILD_DIR}/${BUILD_EXT}/${arch_0}/lib/*.a)
do
lipo_arguments=""
lib_name=$(basename $lib)
for ARCH in ${LIPO_ARCHS[@]}
do
lipo_arguments="${lipo_arguments} ${BUILD_DIR}/${BUILD_EXT}/${ARCH}/lib/${lib_name}"
done
lipo -create \
$lipo_arguments \
-output "${FAT}/${lib_name}"
done
fi
echo "Done"