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