-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbootstrap-liblinphone.sh
executable file
·62 lines (47 loc) · 1.67 KB
/
bootstrap-liblinphone.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
#!/bin/bash
## exit if an error occurs or on unset variables
set -eu -o pipefail
declare -r BRANCH=${1:-"5.3.63"} ## use master to build current git revision
declare -r PROJECT_DIR="$(dirname $(greadlink -f $0))"
declare -r COMPILE_SCRIPT="${PROJECT_DIR}/compile-liblinphone.sh"
declare -r LINPHONE_SDK_PATCH_DIR="${PROJECT_DIR}/patches/linphone-sdk"
declare -r LIBLINPHONE_PATCH_DIR="${PROJECT_DIR}/patches/liblinphone"
declare -r MEDIASTREAMER2_PATCH_DIR="${PROJECT_DIR}/patches/mediastreamer2"
declare -r BELLESIP_PATCH_DIR="${PROJECT_DIR}/patches/belle-sip"
declare -r ORTP_PATCH_DIR="${PROJECT_DIR}/patches/ortp"
declare -r BZRTP_PATCH_DIR="${PROJECT_DIR}/patches/bzrtp"
declare -r LIBOQS_PATCH_DIR="${PROJECT_DIR}/patches/liboqs"
declare -r BUILD_DIR="${PROJECT_DIR}/liblinphone_build_$(basename "${BRANCH}")_$(date '+%Y%m%d_%H%M%S')"
mkdir "${BUILD_DIR}"
cd "${BUILD_DIR}"
git clone https://gitlab.linphone.org/BC/public/linphone-sdk.git
cd linphone-sdk
git checkout "${BRANCH}"
declare -r GIT_HASH=$(git log -n1 --format="%H")
if [ -d "${LINPHONE_SDK_PATCH_DIR}" ] ; then
git am "${LINPHONE_SDK_PATCH_DIR}"/*.patch
fi
git submodule sync
git submodule update --recursive --init
if [ -d "${LIBLINPHONE_PATCH_DIR}" ] ; then
pushd liblinphone/
git am "${LIBLINPHONE_PATCH_DIR}"/*.patch
popd
fi
if [ -d "${MEDIASTREAMER2_PATCH_DIR}" ] ; then
pushd mediastreamer2
git am "${MEDIASTREAMER2_PATCH_DIR}"/*.patch
popd
fi
if [ -d "${BZRTP_PATCH_DIR}" ] ; then
pushd bzrtp/
git am "${BZRTP_PATCH_DIR}"/*.patch
popd
fi
if [ -d "${LIBOQS_PATCH_DIR}" ] ; then
pushd external/liboqs
git am "${LIBOQS_PATCH_DIR}"/*.patch
popd
fi
cd ../..
"${COMPILE_SCRIPT}" "${BUILD_DIR}" "${GIT_HASH}"