-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-dependencies.sh
executable file
·59 lines (49 loc) · 1.68 KB
/
make-dependencies.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
#!/bin/sh
set -e
# Build path
if [ -z "$BUILD_PATH" ]; then
export BUILD_PATH=`readlink -f ${PWD}/build`
fi
# Dependencies
RAWRTC_VERSION="0.2.2"
RAWRTC_URL="https://github.com/rawrtc/rawrtc/archive/v${RAWRTC_VERSION}.tar.gz"
RAWRTC_PATH="rawrtc"
# Prefix
export PREFIX=${BUILD_PATH}/prefix
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${BUILD_PATH}/dependencies/rawrtc/build/prefix/lib/pkgconfig
export CFLAGS="${CFLAGS} -I${PREFIX}/include"
export CPPFLAGS="${CFLAGS}"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
echo "Environment vars:"
echo "PREFIX: ${PREFIX}"
echo "PKG_CONFIG_PATH: ${PKG_CONFIG_PATH}"
echo "CFLAGS: ${CFLAGS}"
echo "CPPFLAGS: ${CPPFLAGS}"
echo "LDFLAGS: ${LDFLAGS}"
echo ""
DEPS_DIR=${BUILD_PATH}/dependencies
mkdir -p ${BUILD_PATH}/dependencies
cd ${DEPS_DIR}
if [ ! -d "${RAWRTC_PATH}" ]; then
echo "Fetching RawRTC"
curl -L -C - -o rawrtc-v${RAWRTC_VERSION}.tar.gz ${RAWRTC_URL}
tar -xzf rawrtc-v${RAWRTC_VERSION}.tar.gz
mv rawrtc-${RAWRTC_VERSION} ${RAWRTC_PATH}
fi
have_rawrtc=true
pkg-config --atleast-version=${RAWRTC_VERSION} rawrtc || have_rawrtc=false
if [ "$have_rawrtc" = false ]; then
echo "\n\n============================"
echo "Building RawRTC Dependencies"
cd ${DEPS_DIR}/rawrtc
echo "Patching WERROR=OFF for usrsctp"
sed -i 's/-DSCTP_DEBUG=1 ../-DSCTP_DEBUG=1 -DWERROR=OFF .. /g' ${DEPS_DIR}/rawrtc/make-dependencies.sh
${DEPS_DIR}/rawrtc/make-dependencies.sh
echo "\n\n==============="
echo "Building RawRTC"
mkdir -p ${DEPS_DIR}/rawrtc
cd ${DEPS_DIR}/rawrtc
cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} ${DEPS_DIR}/rawrtc
make install
fi